// JavaScript Documentwindow.onload = loadLargeIms;var theBigOne;var largeImsList = new Array();function loadLargeIms(){	//alert("Ahoy there");	for (var i=0; i<document.images.length; i++){		var imid = document.images[i];		//alert("Building image "+imid.id);		if(imid.parentNode.className == "img-inner"){			loadBigImage(imid);		}	}}function loadBigImage(theImage){	theImage.largeImage = new Image();	theImage.smallImg = new Image();	var ss = theImage.src.split("/");	var num = ss[ss.length-2].length + ss[ss.length-1].length +1;	var rr = theImage.src.substr(0, (theImage.src.length - num));		theImage.largeImage.src = rr + "large/" + theImage.id + ".jpg";	theImage.type = ss[ss.length-3];	theImage.smallImg.src = theImage.src;		theImage.ondblclick = dblClick;	//alert(theImage.smallImg.src);	/*if (theImage.id == "vs0001"){		alert(theImage.smallImg.src);		alert(theImage.largeImage.src);	}*/		setUpLink(theImage);}function setUpLink(theImage) {	//alert("classname is: "+theImage.parentNode.parentNode.parentNode.parentNode.className);	if (theImage.parentNode.parentNode.parentNode.parentNode.className == "item"){		var itemDiv = theImage.parentNode.parentNode.parentNode.parentNode;		for (var i=0; i<itemDiv.childNodes.length; i++){			if(itemDiv.childNodes[i].className != undefined){				if(itemDiv.childNodes[i].className == "desc"){				//alert("found a desc!");				var nextNode = itemDiv.childNodes[i];					for(var j=0; j < nextNode.childNodes.length; j++){						if(nextNode.childNodes[j].className != undefined){							if(nextNode.childNodes[j].className == "picView"){								//alert("found a picView!");								var thisLink = nextNode.childNodes[j].childNodes[0];								//alert("thisLink is: "+thisLink.localName);								thisLink.imgToChange = theImage;								thisLink.imId = theImage.id;								//thisLink.onclick = enlargeImg;								//additional check to filter for IE6								var browserName=navigator.appName; 								var browserVer=parseInt(navigator.appVersion); 								if ((browserName=="Microsoft Internet Explorer" && browserVer<=6)) {								  //set functions for IE6								  thisLink.onclick = enlargeImgIE;								}								else 								{								  thisLink.onclick = enlargeImg; 								}							}						}					}				}			}		}	}}function enlargeImg() {	//check for enlarged image	if(largeImsList[0] != null){		//remove the div		closeLayer();		largeImsList.pop();	}		//alert(this.imgToChange.largeImage.src);	this.newDiv = document.createElement("div");    document.body.appendChild(this.newDiv);	this.newDiv.appendChild(this.imgToChange.largeImage);    this.newDiv.className = "top";	this.newDiv.id = "bigImage";	this.newDiv.onclick = closeLayer;	//add the click to close message	this.msgDiv = document.createElement("div");	this.msgDiv.className = "msgDiv";	this.newDiv.appendChild(this.msgDiv);	this.pDiv = document.createElement("p");	this.pDiv.innerText = "Click the image to close";	this.msgDiv.appendChild(this.pDiv);		//get top & left dimensions	var dims = getLocals();		this.newDiv.style.top = 120 + "px";	this.newDiv.style.left = 6 + "%";		largeImsList.push(this);		return false;}function getLocals(){		// calculate screen dimensions for the vertical display  // var cw = document.body.clientWidth;   var ch = document.body.clientHeight;   //var cx = document.body.scrollLeft + cw / 2;   var cy = document.body.scrollTop + 150;      var t = new Array();   t[0] = 32;   t[1] = cy;      return t;}function closeLayer() {		var theImToRemove = document.getElementById("bigImage");	var doc = document.getElementsByTagName("body")[0];	var removed = doc.removeChild(theImToRemove);	largeImsList.pop();}function enlargeImgIE() {	//first check to see if the large pic div exists on the page	if (theBigOne != null) {		//a large image is already open		for (var i=0; i<document.images.length; i++){						var im = document.images[i];			if(im.id == theBigOne){				//get the src as an array				var srcArr = im.src.split("/");				//imid.src = "images/flowersSmall/" + theImage.id + ".jpg";				//alert(srcArr[srcArr.length-2]);				var num = srcArr[srcArr.length-2].length + srcArr[srcArr.length-1].length +1;								var smallim = im.src.substr(0, (im.src.length - num)) + "small/" + theBigOne + ".jpg";				//alert("Need to reduce " + smallim );				im.src = smallim;			}		}	}	else	{		//no large image exists		//alert("No value for large image");	}	theBigOne = this.imId;	//alert("theBigOne is now " + theBigOne);	//alert(this.imgToChange.src);	//alert(this.imgToChange.largeImage.src);		this.imgToChange.src = this.imgToChange.largeImage.src;	this.imgToChange.onclick = closeLayerIE;	//alert(this.imgToChange.src);	return false;}function closeLayerIE() {	this.src = this.smallImg.src;	//alert("Making safe");	}function dblClick () {	//alert("Ow! Get off");		switch (this.type){		case "cards":			window.location = "contact.php";			break;		case "vases":			window.location = "contact.php";			break;		case "bouquets":			window.location = "contact.php";			break;		case "events":			window.location = "contact.php";			break;		case "gifts":			window.location = "contact.php";			break;		case "plants":			window.location = "contact.php";			break;		case "wines":			window.location = "contact.php";			break;		case "valentine":			var num = this.id.substr(this.id.length-1,this.id.length);			window.location = "valentineOrder.php?choice="+num;			break;		default:			break;	}}function popup(url,name,settings){	tcWin = window.open(url,name,settings);	return false;}