/*=============================================================================================*/
//function zoom(zoomwhat) {
//	window.open(zoomwhat, 'popup','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,width=540,height=458');
//}//end function
/*=============================================================================================*/
function clearme(FormField) {
	if (FormField.defaultValue==FormField.value) FormField.value=""
}//end function
/*=============================================================================================*/
function CopyBillingDetails() {
	document.getElementById("xdel_fname").value=document.getElementById("xbill_fname").value;
	document.getElementById("xdel_sname").value=document.getElementById("xbill_sname").value;
	document.getElementById("xdel_email").value=document.getElementById("xbill_email").value;
	document.getElementById("xdel_tel").value=document.getElementById("xbill_tel").value;
	document.getElementById("xdel_address").value=document.getElementById("xbill_address").value;
	document.getElementById("xdel_address2").value=document.getElementById("xbill_address2").value;
	document.getElementById("xdel_town").value=document.getElementById("xbill_town").value;
	document.getElementById("xdel_pc").value=document.getElementById("xbill_pc").value;
	document.getElementById("xdel_county").value=document.getElementById("xbill_county").value;
	document.getElementById("xdel_company").value=document.getElementById("xbill_company").value;
}//end function
/*====================================================================================================*/
function SetDarkDiv() {
	xDARKdiv=document.getElementById("DarkDiv");
	if (!xDARKdiv) {
		xDARKdiv=document.createElement("div");
		xDARKdiv.setAttribute("id", "DarkDiv");
		document.body.appendChild(xDARKdiv);
	}//end if (!DarkDiv)
	xWinWidth=window.innerWidth;
	xWinHeight=window.innerHeight;
	if (!xWinWidth) {
		xWinWidth=document.documentElement.clientWidth;
		xWinHeight=document.documentElement.clientHeight;
	}//end if (!xWinWidth)
	for(i=0;i<=25; i++) { 
		setTimeout("SetDarkDivStyle("+i+","+xWinWidth+","+xWinHeight+")",i*20); 
	}//next i<=100
}//end function
/*====================================================================================================*/
function SetDarkDivStyle(MyOpacity, MyWidth, MyHeight) {
	xDARKdiv=document.getElementById("DarkDiv");
	xDARKdivStyle="position: absolute;";
	xDARKdivStyle+="background-color: #000000;";
	xDARKdivStyle+="width: "+MyWidth+"px;";
	xDARKdivStyle+="height: "+MyHeight+"px;";
	xDARKdivStyle+="top: 0px;";
	xDARKdivStyle+="left: 0px;";
	xDARKdivStyle+="bottom: 0px;";
	xDARKdivStyle+="filter: alpha(opacity="+MyOpacity+");";
	xDARKdivStyle+="opacity: "+MyOpacity/100+";";
	xDARKdiv.setAttribute("style", xDARKdivStyle);
	xDARKdiv.style.setAttribute("style", xDARKdivStyle);
	xDARKdiv.style.cssText=xDARKdivStyle;
}//end function
/*====================================================================================================*/
function SetLightDiv(xIMGsrc) {
	xLIGHTdiv=document.getElementById("LightDiv");
	if (!xLIGHTdiv) {
		xLIGHTdiv=document.createElement("div");
		xLIGHTdiv.setAttribute("id", "LightDiv");
		document.body.appendChild(xLIGHTdiv);
	}//end if (!xLIGHTdiv)
	xWinWidth=window.innerWidth;
	xWinHeight=window.innerHeight;
	if (!xWinWidth) {
		xWinWidth=document.documentElement.clientWidth;
		xWinHeight=document.documentElement.clientHeight;
	}//end if (!xWinWidth)
	for(i=0;i<=500; i++) {
		setTimeout("SetLightDivStyle('"+i+"', '100', '"+xWinWidth+"', '"+xWinHeight+"')",i); 
	}//next i<=500
	for(i=100;i<=370; i++) {
		setTimeout("SetLightDivStyle('500', '"+i+"', '"+xWinWidth+"', '"+xWinHeight+"')",i+500); 
	}//next i<=375
	xIMGhtml="<a ";
	xIMGhtml+=" href=\"javascript:unzoom();\"";
	xIMGhtml+=" style=\"color: #000000; text-decoration: none; font-family: Arial, Helvetica, sans-serif; font-size: small;\"";
	xIMGhtml+="><img ";
	xIMGhtml+=" src=\"../../components/thumbs.aspx?xIMGfile=d:/home/blankkeyrings.co.uk/images/uploads/thumbs480/"+xIMGsrc+"&xIMGsize=480\"";
	xIMGhtml+=" width=\"480\"";
	xIMGhtml+=" height=\"360\"";
	xIMGhtml+=" border=\"0\"";
	xIMGhtml+=" alt=\"zoomed image\"";
	xIMGhtml+=" />";
	xIMGhtml+="<br />click to close";
	xIMGhtml+="</a>";
	setTimeout("xLIGHTdiv.innerHTML=xIMGhtml", 870);
}//end function
/*====================================================================================================*/
function SetLightDivStyle(MyWidth, MyHeight, WinWidth, WinHeight) {
	xLIGHTdiv=document.getElementById("LightDiv");
	xLIGHTdivLeft=(WinWidth-MyWidth)/2;
	xLIGHTdivTop=(WinHeight-MyHeight)/2;
	xLIGHTdivStyle="position: absolute;";
	xLIGHTdivStyle+="background-color: #ffffff;";
	xLIGHTdivStyle+="width: "+MyWidth+"px;";
	xLIGHTdivStyle+="height: "+MyHeight+"px;";
	xLIGHTdivStyle+="padding: 10px;";
	xLIGHTdivStyle+="left: "+xLIGHTdivLeft+"px;";
	xLIGHTdivStyle+="top: "+xLIGHTdivTop+"px;";
	xLIGHTdivStyle+="text-align: center;";
	xLIGHTdiv.setAttribute("style", xLIGHTdivStyle);
	xLIGHTdiv.style.setAttribute("style", xLIGHTdivStyle);
	xLIGHTdiv.style.cssText=xLIGHTdivStyle;
}//end function
/*====================================================================================================*/
function zoom(xIMGsrc) {
	SetDarkDiv();
	setTimeout("SetLightDiv('"+xIMGsrc+"')", 500);
}//end function
/*====================================================================================================*/
function unzoom() {
	xDARKdiv=document.getElementById("DarkDiv");
	xLIGHTdiv=document.getElementById("LightDiv");
	xLIGHTdiv.innerHTML="";
	for(i=370;i>=100; i--) { 
		setTimeout("SetLightDivStyle('500', '"+i+"', '"+xWinWidth+"', '"+xWinHeight+"')",370-i); 
	}//next i<=375
	for(i=500;i>=0; i--) { 
		setTimeout("SetLightDivStyle('"+i+"', '100', '"+xWinWidth+"', '"+xWinHeight+"')",870-i); 
	}//next i>=0
	setTimeout("document.body.removeChild(xLIGHTdiv)", 870);
	for(i=25;i>=0; i--) { 
		setTimeout("SetDarkDivStyle("+i+","+xWinWidth+","+xWinHeight+")",((25-i)*20)+870); 
	}//next i<=100
	setTimeout("document.body.removeChild(xDARKdiv)", 1495);
}//end function
/*====================================================================================================*/
function CentreLightDiv() {
	xLIGHTdiv=document.getElementById("LightDiv");
	xDARKdiv=document.getElementById("DARKDiv");
	if (xLIGHTdiv) {
		xWinWidth=window.innerWidth;
		xWinHeight=window.innerHeight;
		if (!xWinWidth) {
			xWinWidth=document.documentElement.clientWidth;
			xWinHeight=document.documentElement.clientHeight;
		}//end if (!xWinWidth)
		SetLightDivStyle(500, 370, xWinWidth, xWinHeight);
		SetDarkDivStyle(25, xWinWidth, xWinHeight);
	}//end if (!xLIGHTdiv)
}//end function
/*====================================================================================================*/
window.onresize=function() {
	CentreLightDiv();
}//end function
/*====================================================================================================*/
