<!--
var xmlHttp

function GetXmlHttpObject(){
	var xmlHttp=null;
	try{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}catch (e){
		// Internet Explorer
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e){
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

function getWidth(){
	var y;

	if(self.pageYOffset){
		y = self.pageYOffset;
	}else if(document.documentElement && document.documentElement.scrollTop){
		y = document.documentElement.scrollTop;
	}else if(document.body){
		y = document.body.scrollTop;
	}

	y = new Array('',y);
	return y;
}


function getPgSize(){
	
	var x, y;
	
	if(window.innerHeight && window.scrollMaxY){
		x = document.body.scrollWidth;
		y = window.innerHeight + window.scrollMaxY;
	}else if(document.body.scrollHeight > document.body.offsetHeight){
		x = document.body.scrollWidth;
		y = document.body.scrollHeight;
	}else{
		x = document.body.offsetWidth;
		y = document.body.offsetHeight;
	}
	
	var winX, winY;
	if(self.innerHeight){
		winX = self.innerWidth;
		winY = self.innerHeight;
	}else if(document.documentElement && document.documentElement.clientHeight){
		winX = document.documentElement.clientWidth;
		winY = document.documentElement.clientHeight;
	}else if(document.body){
		winX = document.body.clientWidth;
		winY = document.body.clientHeight;
	}
	
	// for small pages with total height less then height of the viewport
	if(y < x){
		var pgH = winY;
	}else{ 
		var pgH = y;
	}

	// for small pages with total width less then width of the viewport
	if(x < winX){
		var pgW = winX;
	}else{
		var pgW = x;
	}

	var PgSize = new Array(pgW,pgH,winX,winY);
	return PgSize;
}

function qa(div, q, e, p, c, s, pid){ 
//alert(str1);
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null){
		alert ("Your browser does not support AJAX!");
		return;
	}
//	alert(s + " " + l + " " + d + " " + w);
	var url="../include/questions-form.html";
	url=url+"?q="+q;
	url=url+"&e="+e;
	url=url+"&p="+p;
	url=url+"&div="+div;
	url=url+"&c="+c;
	url=url+"&pid="+pid
	if(s=="Y"){
		url=url+"&submit=Submit";
	}
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=function(){
		if (xmlHttp.readyState==4){
			document.getElementById(div).innerHTML=xmlHttp.responseText;
		}else{
		}
	};
	xmlHttp.open("get",url,true);
	xmlHttp.send(null);
}

function stateChanged(){
	if(xmlHttp.readyState==4){
		var pgSize = getPgSize();
		var wide = getWidth();

		document.getElementById('page-wrap').style.opacity = '.4';
		document.getElementById('page-wrap').style.filter = "alpha(opacity=40)";
		document.getElementById('popupwindow').style.display = 'block';
		document.getElementById('closeimg').style.display = 'block';
		if(navigator.appVersion.search("MSIE 6") > -1){
			 document.getElementById('ieframe').style.display = 'block';
		}

		var popW = parseInt(document.getElementById('popupwindow').style.width);
		var popH = parseInt(document.getElementById('popupwindow').style.height);

		document.getElementById('popupwindow').style.top = (wide[1] + ((pgSize[3] - 35 - popH) / 2) + 'px');
		document.getElementById("popupwindow").style.left = (((pgSize[0] - 20 - popW) / 2) + 'px');
		if(navigator.appVersion.search("MSIE 6") > -1){
			document.getElementById('ieframe').style.top = (wide[1] + ((pgSize[3] - 35 - popH) / 2) + 'px');
			document.getElementById("ieframe").style.left = (((pgSize[0] - 20 - popW) / 2) + 'px');
		}
		var poptop = wide[1] + ((pgSize[3] - 35 - popH) / 2);
		var popleft = ((pgSize[0] - 20 - popW) / 2);
		
		document.getElementById('popupwindow').style.top = (poptop < 0) ? "0px" : poptop + "px";
		document.getElementById("popupwindow").style.left = (popleft < 0) ? "0px" : popleft + "px";
		var imgtop = poptop;
		var imgleft = popleft+popW-18;
		document.getElementById('closeimg').style.top = (poptop < 0) ? "0px" : imgtop + "px";
		document.getElementById("closeimg").style.left = (popleft < 0) ? "0px" : imgleft + "px";
		if(navigator.appVersion.search("MSIE 6") > -1){
			document.getElementById('ieframe').style.top = (poptop < 0) ? "0px" : poptop + "px";
			document.getElementById("ieframe").style.left = (popleft < 0) ? "0px" : popleft + "px";
		}

		document.getElementById("popupwindow").style.width = popW + 'px';



		document.getElementById("popupwindow").innerHTML=xmlHttp.responseText;
	}
}

function closepopup(){
		document.getElementById('page-wrap').style.opacity = '1';
		document.getElementById('page-wrap').style.filter = "alpha(opacity=100)";
		document.getElementById('popupwindow').style.display = 'none';
		document.getElementById('ieframe').style.display = 'none';
		document.getElementById('closeimg').style.display = 'none';
}//end if

function popopen(swURL, swName, swFeatures, winName) {
  var remote = open(swURL, swName, swFeatures);
  if(window.focus){remote.focus()}
  if (remote.opener == null)
    remote.opener = window;
  remote.opener.name = winName;
  return remote;
}

function popUp(url, winName, wid, hgt){
//	newwindow=window.open(URL, winName,'resizable=yes, width='+wid+', height='+hgt+', scrollbars=yes');
//	if(window.focus){newwindow.focus()}
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null){
		alert ("Your browser does not support AJAX!");
		return;
	}

	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

}

Questions = new Array(2);
Questions[0] = "<b>Shipping Charges</b><br />To receive a shipping quote, simply add the items you are interested in renting to your shopping basket.  Once all items are added, enter your zip code and click \"get rates\".  The rate listed includes the prepaid return labels to send the soiled linens back.<br /><center><a href=\"#\" onclick=\"hideBubble(); return false;\">Close</a>";
Questions[1] = "<b>When should I order?</b><br />You can order as soon as you know the date of your event.  We recommend ordering at least 2 weeks prior to your event, this way we can be sure the sizes and colors you are interested in will be available.  If your in a rush, please call to check availability, we can normally rush orders same day.<br /><center><a href=\"#\" onclick=\"hideBubble(); return false;\">Close</a>";

function showQBubble(TextNum, e){
	document.getElementById("fabricdesc").style.display= "block";
	document.getElementById("fabricdesc").style.position= "absolute";
	document.getElementById("fabricdesc").innerHTML= Questions[TextNum];
	
	var Explorer = document.all?true:false;
	var posx = 0;
	var posy = 0;
	
	if(Explorer){
		posx = e.clientX+document.body.scrollLeft;
		posy = e.clientY+document.body.scrollTop;
	}else{
		posx = e.pageX;
		posy =  e.pageY;
	}//end if

	document.getElementById("fabricdesc").style.left= posx + "px";
	document.getElementById("fabricdesc").style.top= posy + "px";

}

function hideBubble(){
	document.getElementById("fabricdesc").style.display= "none";
	document.getElementById("fabricdesc").innerHTML= "";
}


function showhide(area){
	if(document.getElementById(area).style.display == "none"){
		document.getElementById(area).style.display = "block";
	}else{
		document.getElementById(area).style.display = "none";
	}
}

function switchtab(num){
	tab = new Array("1","4","7","10");
	for(x=0; x<tab.length; x++){
		if(document.getElementById('tab'+tab[x])){
			if(tab[x] != num){
				document.getElementById('tabtext'+tab[x]).style.display = "none";
				document.getElementById('tab'+tab[x]).className = "";
			}else{
				document.getElementById('tabtext'+tab[x]).style.display = "block";
				document.getElementById('tab'+tab[x]).className = "active";
			}
		}
	}
}
-->

