function setCookie(name, value, expires) {
	var curCookie = name + "=" + escape(value) +	"; expires=" + expires.toGMTString() + "; path=/";
	document.cookie = curCookie;
}
function getCookie(name) { // use: getCookie("name");
  bikky = document.cookie;
  var index = bikky.indexOf(name + "=");
  if (index == -1) return null;
   index = bikky.indexOf("=", index) + 1;
 	  var endstr = bikky.indexOf(";", index);
 	  if (endstr == -1) endstr = bikky.length;
	  return unescape(bikky.substring(index, endstr));
}
document.write('<link REL="SHORTCUT ICON" href="http://www.greenteadesign.com/favicon.ico">');
var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;
if (checkIt('konqueror'))
{
	browser = "Konqueror";
	OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (checkIt('netscape')) browser = "Mozilla"
else if (!checkIt('compatible'))
{
	browser = "Netscape Navigator"
	version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac";
	else if (checkIt('win')) OS = "Windows"
	else OS = "an unknown operating system";
}

function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}

function writeCookie_screen() 
	{
	 var today = new Date();
	 var the_date = new Date("December 31, 2023");
	 var the_cookie_date = the_date.toGMTString();
	 var the_cookie = "users_resolution="+ screen.width +"x"+ screen.height;
	 var the_cookie = the_cookie + ";expires=" + the_cookie_date + "; path=/";
	 document.cookie=the_cookie
	}

writeCookie_screen();
	
function popitup_contact(url)
{}
	
function readCookie(name) {
	var cookieValue = "";
	var search = name + "=";
  	if(document.cookie.length > 0) { 
   		offset = document.cookie.indexOf(search);
	   	if (offset != -1)  { 
   			offset += search.length;
    		end = document.cookie.indexOf(";", offset);
	     	if (end == -1) end = document.cookie.length;
    			cookieValue = unescape(document.cookie.substring(offset, end))
	    }
	}
	return cookieValue;
}
	
// Example:
// writeCookie("myCookie", "my name", 24);
// Stores the string "my name" in the cookie "myCookie" which expires after 24 hours.
function writeCookie(name, value, hours) {
	var expire = "";
	if(hours != null) {
		expire = new Date((new Date()).getTime() + hours * 3600000);
	    expire = "; expires=" + expire.toGMTString();
	}
	document.cookie = name + "=" + escape(value) + expire;
}

function trackit (dowhat, dohow) {
if (window.XMLHttpRequest)     // Object of the current windows
{ 
 xhr = new XMLHttpRequest();     // Firefox, Safari, ...
}
else if (window.ActiveXObject)   // ActiveX version
 {
 	xhr = new ActiveXObject("Microsoft.XMLHTTP");  // Internet Explorer 
 } 

if (xhr.readyState == 4)
{
   // Received, OK
} else 
{
  // Wait...
}
file_loc = "prtracking_test.php?"+dowhat+"="+dohow;

xhr.open("GET", file_loc,  true); 
xhr.send(null); 
}


function check_email(e) {
	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
	for(i=0; i < e.length ;i++){
	if(ok.indexOf(e.charAt(i))<0){ 
	return (false);
	}	
	} 
	if (document.images) {
	re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
	re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
	if (!e.match(re) && e.match(re_two)) {
	return (-1);		
	} 
	}
}

function check_form(f) {
	if(!check_email(f.email.value)){
	alert("Your email address is invalid.  Please try again.");
	f.email.focus(); 
	if(document.all || document.getElementByID){
	f.email.style.background = "white";
	}
	return false;
	}
}

style_swatch = 'width: 130px;margin: 0px;padding: 0px;background: #fff;border: solid 1px #434343;color: #000;';
 	var cookievalue = 1;	
	var expired = 690;	// expired days	
	var now = new Date();
	now.setTime(now.getTime() + expired * 24 * 60 * 60 * 1000);
	
function bookmark(anchor){
	if(window.external)
	{	
		window.external.AddFavorite(anchor.getAttribute('href'), anchor.getAttribute('title'));
		return false;
	}
	return true;
	}
function popitup_sendpage(url)	{
	newwindow=window.open(url,'newname','height=410,width=236,left=600,top=300');
	if (window.focus) {newwindow.focus()}
	return false;
	}
function popitup_printpage(url)	{
	newwindow=window.open(url,'printname','height=680,width=750,left=0,top=0');
	if (window.focus) {newwindow.focus()}
	return false;
	}	
function popitup_custom(url)	{
	newwindow=window.open(url,'customname','height=500,width=500,left=100,top=100');
	if (window.focus) {newwindow.focus()}
	return false;
	}		
function popitup_enlarge(url) {
	newwindow=window.open(url,'enlargename','left=0, top=0, height=725,width=600,resizable=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
	return false;
	}
function popitup_specs(url) {
	newwindow=window.open(url,'specsname','left=0, top=0, height=700,width=700,resizable=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
	return false;
	}
function hideLoadMsg() {
	setTimeout("hideImg()",2040);
	}
function showImg(){
	document.getElementById("waitmsg").style.visibility = "visible";
	}
function hideImg(){
	document.getElementById("waitmsg").style.visibility = "hidden";
	}
function change_stain(stain_string){
 var imgnormal = document.getElementById("image-normal").src;
 var imgnormalstring = imgnormal.toString().toLowerCase();
 var imgnormalstring_array = imgnormalstring.split("/"); 
 var stain_array = imgnormalstring_array[6].split("-"); 
 	if (numberOfHandles == 0 && numberOfHinges == 0) {
  		var temp_stain_string1 = "-"+stain_array[2];
  		var temp_stain_string2 = "-"+stain_string+".jpg";
 		}	else	{
 		   var temp_stain_string1 = "-"+stain_array[2]+"-";
  	   var temp_stain_string2 = "-"+stain_string+"-";
  	}
 imgnormalstring = imgnormalstring.replace(temp_stain_string1,temp_stain_string2); 
 imgnormalstring = imgnormalstring.replace('cms_march4/images', 'images/zooomed_pics'); 
 imgnormalstring = imgnormalstring.replace('cms_nov21/images', 'images/zooomed_pics'); 
 
 document.getElementById("image-normal").src = imgnormalstring; 
 document.getElementById("wishstain").value = stain_string; 
 	if (hasZoomPic == "yes"){
 			var imgzoomstring = imgnormalstring.replace('normal', 'zoom');
 		} else {
 				var imgzoomstring = imgnormalstring.replace('normal', 'enlarge');
 			}
 imgzoomstring = imgzoomstring.toString().toLowerCase();
 zoom.bigImage.src = imgzoomstring;
 zoom.initZoom();
 showImg();
  hideLoadMsg(); 
  trackit('stain', 'yes');
}
function change_hardware(hardware_string){
 var imgnormal = document.getElementById("image-normal").src;
 var imgnormalstring = imgnormal.toString().toLowerCase();
 var imgnormalstring_array = imgnormalstring.split("/"); 
 var hardware_array = imgnormalstring_array[6].split("-"); 
 if (numberOfStains > 0){
 	var temp_hardware_string1 = "-" + hardware_array[3];
 }else {
 	var temp_hardware_string1 = "-" + hardware_array[2];
 }
 var temp_hardware_string2 = "-" + hardware_string + ".jpg"; 
 imgnormalstring = imgnormalstring.replace(temp_hardware_string1,temp_hardware_string2); 
 imgnormalstring = imgnormalstring.replace('cms_march4/images', 'images/zooomed_pics'); 
 imgnormalstring = imgnormalstring.replace('cms_nov21/images', 'images/zooomed_pics'); 
 document.getElementById("image-normal").src = imgnormalstring;
 document.getElementById("wishhardware").value = hardware_string; 
 if (hasZoomPic == "yes"){
 			var imgzoomstring = imgnormalstring.replace('normal', 'zoom');
 		} else {
 				var imgzoomstring = imgnormalstring.replace('normal', 'enlarge');
 			}
 imgzoomstring = imgzoomstring.toString().toLowerCase();
 zoom.bigImage.src = imgzoomstring;
 zoom.initZoom();
  showImg();  
 if (hardware_string == "iw")
 {document.getElementById("hardware_span").innerHTML="Iron Warabite";}
	else if (hardware_string == "bw")
	 {document.getElementById("hardware_span").innerHTML="Brass Warabite";}
		else if (hardware_string == "ih")
 			{document.getElementById("hardware_span").innerHTML="Iron Hirute";}
			else if (hardware_string == "bh")
 				{document.getElementById("hardware_span").innerHTML="Brass Hirute";}
				else if (hardware_string == "ik")
					 {document.getElementById("hardware_span").innerHTML="Iron Kakute";}
					 else if (hardware_string == "hi")
					 		{document.getElementById("hardware_span").innerHTML="Hidden Iron";}
					 		else if (hardware_string == "hb")
					 			{document.getElementById("hardware_span").innerHTML="Hidden Brass";}
					 			else if (hardware_string == "si")
					 				{document.getElementById("hardware_span").innerHTML="Square Iron";}
					 				else if (hardware_string == "sb")
					 					{document.getElementById("hardware_span").innerHTML="Square Brass";}
					 					else if (hardware_string == "ri")
					 						{	document.getElementById("hardware_span").innerHTML="Round Iron";}
					 						else if (hardware_string == "rb")
					 							{document.getElementById("hardware_span").innerHTML="Round Brass";}
		hideLoadMsg(); 			 							
 trackit('hardware', 'yes');
}
function change_stain_span (stain_span_string){ 	 
 document.getElementById("stain_span").innerHTML=stain_span_string;  
}
function change_stains_thumb(elt){
	make_stains_thumbs_normal();
	document.getElementById(elt).className = 'stainsactive';
}
function make_stains_thumbs_normal(){
	document.getElementById('stainthumb1').className = 'stainsnormal';
	document.getElementById('stainthumb2').className = 'stainsnormal';
	document.getElementById('stainthumb3').className = 'stainsnormal';
	document.getElementById('stainthumb4').className = 'stainsnormal';
	document.getElementById('stainthumb5').className = 'stainsnormal';
	document.getElementById('stainthumb6').className = 'stainsnormal';
}
function change_hardware_thumb(elt){
	make_hardware_thumbs_normal();
	document.getElementById(elt).className = 'hwareactive';
}
function make_hardware_thumbs_normal(){
	if (thisProductName == 'hibachitable'){
		document.getElementById('hwarethumb3').className = 'hwarenormal';
		document.getElementById('hwarethumb5').className = 'hwarenormal';
		}	else	{
			var numberofHandleHinges = numberOfHandles;
			if (numberOfHinges > 0) {numberofHandleHinges = numberOfHinges+1; }
			for (var zz = 1; zz <= numberofHandleHinges; zz++){
				document.getElementById('hwarethumb'+zz).className = 'hwarenormal';
			}
		}
	}
function change_doors(){
 sliding_string = 'sliding';
 document.getElementById("wishhardware").value = sliding_string; 
 var imgnormal = document.getElementById("image-normal").src;
 var imgnormalstring = imgnormal.toString().toLowerCase();
 var imgnormalstring_array = imgnormalstring.split("/"); 
 var sliding_array = imgnormalstring_array[6].split("-"); 
 if (numberOfStains > 0){
 	var temp_sliding_string1 = "-" + sliding_array[3];
 }else {
 	var temp_sliding_string1 = "-" + sliding_array[2];
 } 
 var temp_sliding_string2 = "-" + sliding_string + ".jpg"; 
 imgnormalstring = imgnormalstring.replace(temp_sliding_string1,temp_sliding_string2); 
 imgnormalstring = imgnormalstring.replace('cms_march4/images', 'images/zooomed_pics'); 
 imgnormalstring = imgnormalstring.replace('cms_nov21/images', 'images/zooomed_pics'); 
 document.getElementById("image-normal").src = imgnormalstring; 
 if (hasZoomPic == "yes"){
 			var imgzoomstring = imgnormalstring.replace('normal', 'zoom');
 		} else {
 				var imgzoomstring = imgnormalstring.replace('normal', 'enlarge');
 			}
 imgzoomstring = imgzoomstring.toString().toLowerCase();
 zoom.bigImage.src = imgzoomstring;
 zoom.initZoom();
}
function hide_caption()	{
		for(var i = 0; i < totalNumOfProducts; i++) {
			document.getElementById('caption_' + i).style.visibility = 'hidden';			
		}
	}
function show_caption(capid) {
		document.getElementById(capid).style.visibility = 'visible';	
	}		
function ask_question(descid1, descid2)	{
		document.getElementById(descid1).style.visibility = 'hidden';	
		document.getElementById(descid2).style.visibility = 'visible';	
		if (descid2 == 'desc_q'){
			trackit('askq', 'yes');
		}
	}
function change_ask_form(){
	if (document.getElementById('askcheckbox').checked == false) { document.getElementById('ask_q_form').action = 'http://www.greenteadesign.com/phppages/pr_askq_ty.php?nonews';  }
	else{ document.getElementById('ask_q_form').action = 'http://www.greenteadesign.com/phppages/pr_askq_ty.php?yesnews'; }
}

function getPageSize(){	
	var xScroll, yScroll;	
	if (window.innerHeight && window.scrollMaxY) {
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}		
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight*3;
	} else { 
		pageHeight = yScroll;
	}
	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

function fadeout_wishpointer_div(){
	var wishPointShow = getCookie('wishpoint');
	if (wishPointShow == 1){
		document.getElementById('wishpointer').style.display = 'block';
		setTimeout("fadout_wishpointer_div_help()", 7000);	
		setTimeout("fadout_wishpointer_div_help2()", 8000);	
		opacity('wishpointer', 0, 100, 1);
	} else {}
}
function fadout_wishpointer_div_help(){
	opacity('wishpointer', 100, 0, 500);
}
function fadout_wishpointer_div_help2(){
	document.getElementById('wishpointer').style.display = 'none';
}

function fadeout_gallery_div(){
	setTimeout("fadout_gallery_div_help()", 4000);	
}
function fadout_gallery_div_help(){
	opacity('gallery', 100, 0, 500);
}
function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 
    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 

function repositionDivSlickly(id, posIncrease, millisec) {
    //speed for each frame 
    speed2 = Math.round(millisec / 100); 
    timer2 = 0; 
    
    for(i = 0; i < posIncrease; i++) {
      setTimeout("changeDivPos(" + i + ",'" + id + "')",(timer2 * speed2)); 
	    timer2++; 
     }
}
function changeDivPos(size, id) {
		old_left = parseInt(document.getElementById(id).style.marginLeft) + 0.1;
		old_top = parseInt(document.getElementById(id).style.marginTop) + 0.1;
		
    var object2 = document.getElementById(id).style; 
    object2.marginLeft = old_left;    
    object2.marginTop = old_top;
}
function resizeDivSlickly(id, paddingStart, paddingEnd, millisec) { 
    //speed for each frame 
    speed = Math.round(millisec / 100); 
    timer = 0; 
    //determine the direction for the blending, if start and end are the same nothing happens 
    if(paddingStart > paddingEnd) {
        for(i = paddingStart; i >= paddingEnd; i--) { 
            setTimeout("changeDivSize(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(paddingStart < paddingEnd) { 
        for(i = paddingStart; i <= paddingEnd; i++) 
            {
            setTimeout("changeDivSize(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        }
    } 
}
function changeDivSize(size, id) {
    var object = document.getElementById(id).style; 
    object.padding = (size - 0.1);    
}
 
if(navigator.appName.indexOf("Microsoft") > -1){
var canSee = 'block';
} else {
var canSee = 'table-row';
}

function all_thumbs_normal (){
		for(var i = 0; i < numTotalPics; i++) {
			document.getElementById('enlthumb_' + i).className = 'normal';			
		}
	}	
function make_thumb_active(id) {
		all_thumbs_normal();
		document.getElementById(id).className = 'active';
		w = document.getElementById('midimg').width;
		neww = numTotalPics*102;
		if (neww > w){
			w = neww;
		}
		document.getElementById('topnav_enlarge').style.width = w;
	}

function all_enlcaptions_hidden(){
	for(var i = 0; i < numTotalPics; i++) {
		document.getElementById('enl_caption' + i).style.display='none';			
		}
}
	
function switchthumb(num, track){
			document.images['midimg'].src = enlpics[num];			
			all_enlcaptions_hidden();
			document.getElementById('enl_caption' + num).style.display=canSee;
			make_thumb_active('enlthumb_' + num);
			
			arrayPageSize = getPageSize();
			w = document.getElementById('midimg').width;
			totalSpDivW = parseFloat(w) + 212;	
			marginThisLeft = (arrayPageSize[0] - totalSpDivW) / 2;
			document.getElementById('enlarge_div').style.width = totalSpDivW;
		  document.getElementById('enlarge_div').style.marginLeft = marginThisLeft;
		  
			//resizeDivSlickly('enlarge_div_main_table', 8, 4, 20000);	
			//repositionDivSlickly('enlarge_div', 5, 20000);
			
			opacity('midimg', 50, 100, 1000);
			
		var currentPicNum = getCookie('currentpicnum');
		if (num == numTotalPics){
			nextPicNum = 0;
		} else {
			nextPicNum = num+1;
		}
		setCookie('currentpicnum', nextPicNum, now);
		if (track == 'yestrack'){
			trackit('enlfromenl', num);
		}
	}

function switchthumb_next(whattrack){
		var currentPicNum = getCookie('currentpicnum');
		if (currentPicNum == numTotalPics)
			{currentPicNum = 0;}
		
			document.images['midimg'].src = enlpics[currentPicNum];	
		
			all_enlcaptions_hidden();
			document.getElementById('enl_caption' + currentPicNum).style.display=canSee;
			make_thumb_active('enlthumb_' + currentPicNum);
			
			arrayPageSize = getPageSize();
			w = document.getElementById('midimg').width;
			totalSpDivW = parseFloat(w) + 212;	
			marginThisLeft = (arrayPageSize[0] - totalSpDivW) / 2;
			document.getElementById('enlarge_div').style.width = totalSpDivW;
		  document.getElementById('enlarge_div').style.marginLeft = marginThisLeft;
		  
			//resizeDivSlickly('enlarge_div_main_table', 8, 4, 20000);	
			//repositionDivSlickly('enlarge_div', 5, 20000);		
			
			opacity('midimg', 50, 100, 1000);
		
		currentPicNum++;
		setCookie('currentpicnum', currentPicNum, now);	
		trackit(whattrack, 'yes');	
	}

function show_slick_enlarge(num){	
	for (var z = 0; z < numTotalPics; z++){
		var img = new Image();
		img.src = enlpics[z];
	}
	document.getElementById('enlarge_div').style.marginLeft = 100;
	document.getElementById('enlarge_div').style.marginTop = 20 + document.body.scrollTop;
	switchthumb(num, 'notrack');
	arrayPageSize = getPageSize();
	document.getElementById('enlarge_div').style.visibility='visible';
	document.getElementById('overlay_enlarge_div').style.visibility='visible';
	document.getElementById('overlay_enlarge_div').style.width = arrayPageSize[0] +"px";
	document.getElementById('overlay_enlarge_div').style.height = arrayPageSize[1] +"px";
	opacity('overlay_enlarge_div', 0, 70, 1000);	
	trackit('enlfrompage', num);
}

function hideDHTML(id)	{
	document.getElementById(id).style.visibility = 'hidden';		
	document.getElementById('overlay_' + id).style.width = 0 +"px";
	document.getElementById('overlay_' + id).style.height = 0 +"px";	
	document.getElementById('overlay_' + id).style.visibility='hidden';	
}


function show_doorstlyes(){
	arrayPageSize = getPageSize();
	marginThisLeft2 = (arrayPageSize[0] - 876) / 2;
	document.getElementById('door_styles').style.marginLeft = marginThisLeft2;
	document.getElementById('door_styles').style.marginTop = 20 + document.body.scrollTop;
	document.getElementById('door_styles').style.visibility='visible';
	document.getElementById('overlay_door_styles').style.visibility='visible';
	document.getElementById('overlay_door_styles').style.width = arrayPageSize[0] +"px";
	document.getElementById('overlay_door_styles').style.height = arrayPageSize[1] +"px";
	opacity('overlay_door_styles', 0, 70, 1000);	
	trackit('doorstyles', 'yes');
}

function show_slick_wishlist(){
	if (document.getElementById('wishprice').value == 'null' || document.getElementById('wishdims').value == ''){
		alert("Please choose a size using the dropdown menu.");
		return;
	}
	arrayPageSize = getPageSize();
	marginThisLeft2 = (arrayPageSize[0] - 576) / 2;
	document.getElementById('wishlist_form').style.marginLeft = marginThisLeft2;
	document.getElementById('wishlist_form').style.marginTop = 20 + document.body.scrollTop;
	document.getElementById('wishlist_form').style.display = 'block';
	document.getElementById('wishlist_form').style.visibility='visible';	
	document.getElementById('overlay_wishlist_form').style.visibility='visible';
	document.getElementById('overlay_wishlist_form').style.width = arrayPageSize[0] +"px";
	document.getElementById('overlay_wishlist_form').style.height = arrayPageSize[1] +"px";
	opacity('overlay_wishlist_form', 0, 70, 1000);	
	trackit('wshl', 'dhtmlf');
}

function check_form_ask(f) {	
	if(!check_email(f.contact_email.value)){
		alert("Your email address is invalid.Please enter again.");
		return false;
	}
	if(!check_email(f.another_email.value)){
		alert("Your email address is invalid.Please enter again.");
		return false;
	}
	if(f.another_email.value != f.contact_email.value){
		alert("Please re-enter correct email address.");
		return false;
	}	
	if(f.comments.value == ''){
		alert("Please enter your question.");
		return false;
	}
}
var mTimerTvSchedule;
function grille_start_slide(sens){
		  var speed;
		  speed=1;		        
		  if(mTimerTvSchedule)
		    { return;}		               
			window.clearInterval(mTimerTvSchedule);		
			mSize = parseInt(document.getElementById('topnav_inside').style.width)- totalNumOfProducts*60;
			mDiv = document.getElementById("topnav_temp");
			if (sens == "leftwards"){
					mNewPosition = parseInt(mDiv.style.left) + 2*68;
					mTimerTvSchedule = window.setInterval(function(){grille_slide('leftwards', mNewPosition);}, speed);		
			} else {
					mNewPosition = parseInt(mDiv.style.left) - 2*68;
					mTimerTvSchedule = window.setInterval(function(){grille_slide('rightwards', mNewPosition);}, speed);		
			}
		}
function grille_slide(sens, position) {
			var scrollnum = 64*(totalNumOfProducts - 9) + 2*((totalNumOfProducts - 10)); 
			if (scrollnum > 0) { 
				mSize2 = -1*scrollnum;
			} else {
				mSize2 = -1;
			}			
		  var increment;
		  increment= 2;
			mDiv = document.getElementById("topnav_temp");
			if (sens == "leftwards"){				
				if (parseInt(mDiv.style.left) >= position){
					window.clearInterval(mTimerTvSchedule);
					mTimerTvSchedule=null;
					if (parseInt(mDiv.style.left) == 0) {
						document.getElementById('previous').style.visibility = 'hidden';	
						}				   	
				}	else if (parseInt(mDiv.style.left) > 0) {
					window.clearInterval(mTimerTvSchedule);
					mTimerTvSchedule=null;
					document.getElementById('previous').style.visibility = 'hidden';		
				}else {
					mDiv.style.left = parseInt(mDiv.style.left)+ parseInt(increment) + "px";					
				}
			} else {
				if (parseInt(mDiv.style.left)<= position) 
				{
					window.clearInterval(mTimerTvSchedule);
					mTimerTvSchedule=null;
					if (parseInt(mDiv.style.left) == mSize2) 
						{
						document.getElementById('next').style.visibility = 'hidden';	
						}
				}
				else if (parseInt(mDiv.style.left) < mSize2)
				{
					window.clearInterval(mTimerTvSchedule);
					mTimerTvSchedule=null;
					document.getElementById('next').style.visibility = 'hidden';					
				}
				else 
				{
					mDiv.style.left = parseInt(mDiv.style.left) - parseInt(increment)+ "px";
				}
			}			
		}
function stop_scroller(){
		window.clearInterval(mTimerTvSchedule);
		mTimerTvSchedule=null;	
	}	

/* Cool Zoom */
/* Copyright 2006 LuckyTeam.co.uk. To use this code on your own site, visit http://luckyteam.co.uk */
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('8 7=\'o\';8 W=2d.2e.2f();5(W.P("B")!=-1){7=\'B\'}m 5(W.P("o")!=-1){7=\'o\'}m 5(W.P("2c")!=-1){7=\'I\'}8 S=2b 28();a T(1H){h 9.29(1H)};a 1j(){h q};a O(M,n,L){5(7==\'I\'||7==\'B\'){M.2a(n,L,q)}m 5(7==\'o\'){M.2g("1i"+n,L)}};a 1y(M,n,L){5(7==\'I\'||7==\'B\'){M.2h(n,L,q)}m 5(7==\'o\'){M.2n("1i"+n,L)}};a F(1p,23){8 27=24;h a(){1p[23].2m(1p,24,"")}};a p(1Y,1X,1T,1U,b){4.17=q;4.g=T(1Y);4.z=T(1X);4.c=T(1T);4.d=T(1U);4.l=0;4.b=b;5(!4.b["R"]){4.b["R"]=""}4.1f=0;4.X=0;4.D=0;4.A=0;4.E=20;4.2l=20;4.t=0;4.s=0;4.2i=\'\';4.1o=q;S.2j(4);4.1m=F(4,"1a")};p.r.2k=a(){1y(u.9,"U",4.1m)};p.r.1a=a(e){8 y=0;8 x=0;5(7==\'o\'){y=e.15;x=e.11;5(9.V&&(9.V.1b||9.V.N)){y=e.15+9.V.N;x=e.11+9.V.1b}m 5(9.Y&&(9.Y.1b||9.Y.N)){y=e.15+9.Y.N;x=e.11+9.Y.1b}}m{y=e.15;x=e.11;5(W.P("1v")==-1){y+=u.1A;x+=u.1x}}K=J=0;8 j=4.z;1l(j.1d!="1Q"&&j.1d!="25"){K+=j.1Z;J+=j.1t;j=j.1W}5(x>v(J+4.D)){4.12();h q}5(x<v(J)){4.12();h q}5(y>v(K+4.A)){4.12();h q}5(y<v(K)){4.12();h q}h k};p.r.1n=a(e){5(7==\'I\'){e.Q=k;e.1h();e.1u()}m 5(7==\'o\'||7==\'B\'){u.n.Q=k}4.g.6.1g=\'1K\'};p.r.1r=a(e){5(7==\'I\'){e.Q=k;e.1h();e.1u()}m 5(7==\'o\'||7==\'B\'){u.n.Q=k}4.g.6.1g=\'2p\'};p.r.U=a(e){5(7==\'I\'){e.Q=k;e.1h();e.1u()}m 5(7==\'o\'||7==\'B\'){u.n.Q=k}26(i=0;i<S.2o;i++){5(S[i]!=4){S[i].1a(e)}}5(4.b&&4.b["1M"]==k){5(4.g.6.1g!=\'1K\'){h}}5(4.17){h}5(!4.1a(e)){h}4.17=k;8 1D=4.z;8 J=0;8 K=0;5(7==\'I\'||7==\'B\'){8 j=1D;1l(j.1d!="1Q"&&j.1d!="25"){K+=j.1Z;J+=j.1t;j=j.1W}}5(7==\'o\'){4.t=n.x-4.z.1t;8 N=0;4.s=n.y+N}m{4.t=e.11-J;4.s=e.15-K;5(W.P("1v")==-1){4.t+=u.1x;4.s+=u.1A}}5((4.t+4.E/2)>=4.D){4.t=4.D-4.E/2}5((4.s+4.C/2)>=4.A){4.s=4.A-4.C/2}5((4.t-4.E/2)<=0){4.t=4.E/2}5((4.s-4.C/2)<=0){4.s=4.C/2}1O(F(4,"1k"),10)};p.r.1k=a(){4.l.6.16=(4.t-4.E/2)+\'G\';4.l.6.1c=(4.s-4.C/2)+\'G\';4.l.6.Z="1e";1z=v(4.l.6.16)*(4.1f/4.D);1C=v(4.l.6.1c)*(4.X/4.A);4.d.6.16=(-1z)+\'G\';4.d.6.1c=(-1C)+\'G\';4.c.6.1q=\'1B\';4.c.6.Z=\'1e\';4.d.6.1q=\'1B\';4.d.6.Z=\'1e\';4.17=q};p.r.12=a(){5(4.b&&4.b["2P"]==k)h;4.l.6.Z="1G";4.c.6.1q=\'22\';4.c.6.Z=\'1e\'};p.r.1L=a(){4.l=9.14("1s");4.l.21=\'2M\';4.E=(v(4.c.6.H)-3)/(4.1f/4.D);5(4.b&&4.b["R"]!=""){4.C=(v(4.c.6.w)-3-19)/(4.X/4.A)}m{4.C=(v(4.c.6.w)-3)/(4.X/4.A)}4.l.6.H=4.E+\'G\';4.l.6.w=4.C+\'G\';4.g.13(4.l);4.g.2K="1i";4.g.6.2J="22";4.g.2I=1j;4.g.2q=1j};p.r.1N=a(){8 1F=4.d.1E;1l(4.c.1V){4.c.2O(4.c.1V)}5(7==\'o\'){8 f=9.14("2N");f.6.16=\'1S\';f.6.1c=\'1S\';f.6.1J=\'2L\';f.6.2G=\'2w:2H.2x.2v(6=0,2u=0)\';f.6.H=4.c.6.H;f.6.w=4.c.6.w;f.2r=0;4.c.13(f)}5(4.b&&4.b["R"]!=""){8 f=9.14("1s");f.21=\'2s\';f.2t=4.b["R"];4.c.13(f)}8 1R=9;8 1I=1R.2y;8 2z=1I.2E;8 18=9.14("1s");18.6.2F="1G";4.c.13(18);4.d=9.14("2D");4.d.1E=1F;4.d.6.1J=\'2C\';18.13(4.d)};p.r.1w=a(){5(W.P("1v")!=-1){5(!4.1o){O(4.d,"2A",F(4,"1w"));4.1o=k;h}}m{5(!4.d.1P||!4.z.1P){1O(F(4,"1w"),2B);h}}4.1f=4.d.H;4.X=4.d.w;4.D=4.z.H;4.A=4.z.w;4.g.6.H=4.z.H+\'G\';4.g.6.w=4.z.w+\'G\';4.1N();4.1L();O(u.9,"U",4.1m);O(4.g,"U",F(4,"U"));5(4.b&&4.b["1M"]==k){O(4.g,"1n",F(4,"1n"));O(4.g,"1r",F(4,"1r"));4.t=4.D/2;4.s=4.A/2;4.1k()}};',62,176,'||||this|if|style|luckyZoom_ua|var|document|function|settings|bigImageCont|bigImage|||smallImageCont|return||tag|true|pup|else|event|msie|luckyZoom|false|prototype|positionY|positionX|window|parseInt|height|||smallImage|smallImageSizeY|opera|popupSizeY|smallImageSizeX|popupSizeX|luckyZoom_createMethodReference|px|width|gecko|smallX|smallY|listener|obj|scrollTop|luckyZoom_addEventListener|indexOf|cancelBubble|header|LuckyZoom_zooms|_el|mousemove|body||bigImageSizeY|documentElement|visibility||clientX|hiderect|appendChild|createElement|clientY|left|recalculating|ar1||checkcoords|scrollLeft|top|tagName|visible|bigImageSizeX|cursor|preventDefault|on|luckyView_ia|showrect|while|checkcoords_ref|mousedown|safariOnLoadStarted|object|display|mouseup|DIV|offsetLeft|stopPropagation|safari|initZoom|pageXOffset|luckyZoom_removeEventListener|perX|pageYOffset|block|perY|smallImg|src|bigimgsrc|hidden|id|dcl|position|move|initPopup|drag_mode|initBigContainer|setTimeout|complete|BODY|dc|0px|bigImageContId|bigImageId|firstChild|offsetParent|smallImageId|smallImageContId|offsetTop||className|none|methodName|arguments|HTML|for|args|Array|getElementById|addEventListener|new|mozilla|navigator|userAgent|toLowerCase|attachEvent|removeEventListener|baseuri|push|stopZoom|popupSizey|apply|detachEvent|length|default|oncontextmenu|frameBorder|luckyZoomHeader|innerHTML|opacity|Alpha|progid|Microsoft|location|dclh|load|100|relative|IMG|href|overflow|filter|DXImageTransform|onselectstart|MozUserSelect|unselectable|absolute|luckyZoomPup|IFRAME|removeChild|bigImage_always_visible'.split('|'),0,{}))

	
/* Slick Specs */	
/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;	
	
	
function add_wish_dims(){
  price_and_dims = document.getElementById('namedims').options[document.getElementById('namedims').selectedIndex].value;
  price_and_dims2 = price_and_dims.split('@');
  price = price_and_dims2[0];
  dims = price_and_dims2[1];
  document.getElementById('wishprice').value = price;
  document.getElementById('wishdims').value = dims;  
}
		
function check_for_priceanddims(f){
  if (f.wishprice.value == 'na' || f.wishdims.value == 'na')
  {
  	alert("Please choose a size using the dropdown menu.");
  	return false;
  }
}

function add_wish_dims_sg(num){
  price_and_dims = document.getElementById('namedims'+num).options[document.getElementById('namedims'+num).selectedIndex].value;
  price_and_dims2 = price_and_dims.split('@');
  wish_price_sg = price_and_dims2[0];
  wish_dims_sg = price_and_dims2[1];
  document.getElementById('wishprice'+num).value = wish_price_sg;
  document.getElementById('wishdims'+num).value = wish_dims_sg;
}

function close_wishpoint(){
	document.getElementById('wishpointer').style.visibility='hidden';
	setCookie('wishpoint', 0, now);
}

function askQuestion() {
		var contact_email = $F('contact_email');
		var another_email = $F('another_email');
		var comments = $F('comments');
		var product_name = $F('product_name');
		var product_url = $F('product_url');
		
		var newswrite_true = 'no';
		
		if(contact_email != another_email){
			alert("Please re-enter correct email address.");
			return;
		}		
	  if(!check_email(contact_email)){
			alert("Your email address is invalid. Please enter again.");
			return;
		}
	  if (document.getElementById('askcheckbox').checked == true){
	  	newswrite_true = 'yes';
	  }
	  
    var url = 'pr_askq_ty.php';
    var pars = 'contact_email=' + contact_email + '&comments=' + comments + '&product_name=' + product_name + '&product_url=' + product_url + '&newswrite_true=' + newswrite_true;
    var myAjax = new Ajax.Updater({success: 'desc_q'},url,
      {
        method:'post',
        parameters: pars, 
        onSuccess: pageTracker._trackPageview("praskedq-thankyou.html"),
        onFailure: reportError
      });
}


function wish_add(newemail, newscheckbox) {
		var pid = $F('pid');
		var wishstain = $F('wishstain');
		var wishhardware = $F('wishhardware');
		var wishwood = $F('wishwood');
		var wishprice = $F('wishprice');
		var wishdims = $F('wishdims');
		var newemailwrite = '';
		var quotezip = '';
	  var newscheckboxwrite = 'no';
	  if (newemail == 'yes'){
	  	newemailwrite = document.getElementById('newemail').value;
	  	quotezip = document.getElementById('newzip').value;	  
	  	if(!check_email(newemailwrite)){
				alert("Your email address is invalid. Please enter again.");
				return;
			}			
			 quotezip=quotezip.toUpperCase();		
			 if (quotezip.match(/(^\d{5}$)|(^\d{5}-\d{4}$)/)) {
				}else if (quotezip.match(/^[A-Z][0-9][A-Z][0-9][A-Z][0-9]$/)) {
				}else if (quotezip.match(/^[A-Z][0-9][A-Z].[0-9][A-Z][0-9]$/)) {
				}else {
				alert('Your zip code is not valid. Please enter it again.');
				return;
				}
	  }
	  if (newscheckbox == 'yes' && document.getElementById('wishnewscheckbox').checked == true){
	  	newscheckboxwrite = 'yes';
	  }
    var url = 'ajax_quote_update.php';
    var pars = 'pid=' + pid + '&wishstain=' + wishstain + '&wishhardware=' + wishhardware + '&wishwood=' + wishwood + '&wishprice=' + wishprice + '&wishdims=' + wishdims + '&newemail=' + newemailwrite + '&quotezip=' + quotezip + '&newscheckbox=' + newscheckboxwrite;
    var myAjax = new Ajax.Updater({success: 'wishdisplay'},url,
      {
        method:'post',
        parameters: pars, 
        onSuccess: pageTracker._trackPageview("prshqcreated-thankyou.html"),
        onFailure: reportError
      });  
  
	document.getElementById('infobox2').style.display = 'block';
	document.getElementById('wishlist_form').style.display = 'none';
	trackit('wshl', 'pradded');
	setTimeout("show_qp_wtime2()", 400);
	wish_quote_update_topleft();
}

function update_quote_qty(wishid, prwishid, qtyfield, prwishstain, prwishhware) {
		var pid = prwishid;
		var wishid = wishid;
		var qty = $F('quote_qty'+qtyfield);
		var wishstain = prwishstain;
		var whware = prwishhware;
		
    var url = 'ajax_quote_update_qty.php';
    var pars = 'pid=' + pid + '&wishid=' + wishid + '&qty=' + qty + '&wishstain=' + wishstain + '&whware=' + whware;
    var myAjax = new Ajax.Updater({success: 'quote_qty_suc'},url,
      {
        method:'post',
        parameters: pars, 
        onFailure: reportError
      });
	setTimeout("show_qp_wtime()", 100 );
}

function show_qp_wtime (){
	show_quote_popup('no', 'yes');
}

function show_qp_wtime2 (){
	show_quote_popup('no', 'no');
}

function show_quote_popup(addorno, slickdo) {
		var pid = '';
		var wishstain = '';
		var wishhardware = '';
		var wishwood = '';
		var wishprice = '';
		var wishdims = '';
		var addordont = addorno;
		var slickornot = slickdo;
		
		if(addordont == 'yes'){
			pid = $F('pid');
			wishstain = $F('wishstain');
			wishhardware = $F('wishhardware');
			wishwood = $F('wishwood');
			wishprice = $F('wishprice');
			wishdims = $F('wishdims');
		}		
		
    var url = 'ajax_quote_show_popup.php';
    var pars = 'pid=' + pid + '&wishstain=' + wishstain + '&wishhardware=' + wishhardware + '&wishwood=' + wishwood + '&wishprice=' + wishprice + '&wishdims=' + wishdims + '&addordont=' + addordont;
    var myAjax = new Ajax.Updater({success: 'quotedisplay'},url,
      {
        method:'post',
        parameters: pars, 
        onFailure: reportError
      });
  if (slickornot == 'yes'){
  	show_slick_quote_popup();
  }else if (slickornot == 'no'){
  	arrayPageSize = getPageSize();
		marginThisLeft2 = (arrayPageSize[0] - 576) / 2;
		document.getElementById('quote_popup').style.marginLeft = marginThisLeft2;
		document.getElementById('quote_popup').style.marginTop = 20 + document.body.scrollTop;
		document.getElementById('quote_popup').style.visibility='visible';
		document.getElementById('quote_popup').style.visibility = 'visible';	
		document.getElementById('overlay_quote_popup').style.width = 0 +"px";
		document.getElementById('overlay_quote_popup').style.height = 0 +"px";	
		document.getElementById('overlay_quote_popup').style.visibility='visible';	
	}
	wish_quote_update_topleft();
}

function wish_quote_remove_pr(prwishid, prwishprice) {
		var prwishid = prwishid;
		var prwishprice = prwishprice;		
		
    var url = 'ajax_quote_remove_product.php';
    var pars = 'prwishid=' + prwishid + '&prwishprice=' + prwishprice;
    var myAjax = new Ajax.Updater({success: 'quotedisplay'},url,
      {
        method:'post',
        parameters: pars, 
        onFailure: reportError
      });  
  wish_quote_update_topleft()    
}

function submit_wsh_quote() {
	var notes = $F('wsh_quote_notes');	
	var totalprods = $F('wshq_total_prods');
  var url = 'ajax_quote_shipp_submit.php';
  var pars = 'notes=' + notes + '&totalprods=' + totalprods;
  var myAjax = new Ajax.Updater({success: 'tmphid'},url,
    {
      method:'post',
      parameters: pars, 
      onSuccess: pageTracker._trackPageview("prshqsubmitted-thankyou.html"),
      onFailure: reportError
    });  
    
   arrayPageSize = getPageSize();
		marginThisLeft2 = (arrayPageSize[0] - 576) / 2;
		document.getElementById('quote_popup_ty').style.marginLeft = marginThisLeft2;
		document.getElementById('quote_popup_ty').style.marginTop = 20 + document.body.scrollTop;
		document.getElementById('quote_popup').style.visibility='hidden';
		document.getElementById('quote_popup_ty').style.visibility='visible';
		document.getElementById('quote_popup_ty').style.visibility = 'visible';	
		document.getElementById('overlay_quote_popup_ty').style.width = 0 +"px";
		document.getElementById('overlay_quote_popup_ty').style.height = 0 +"px";	
		trackit('wshl', 'quote_submitted');
}

function reportError(request){}

function show_slick_quote_popup(){
	arrayPageSize = getPageSize();
	marginThisLeft2 = (arrayPageSize[0] - 576) / 2;
	document.getElementById('quote_popup').style.marginLeft = marginThisLeft2;
	document.getElementById('quote_popup').style.marginTop = 20 + document.body.scrollTop;
	document.getElementById('quote_popup').style.visibility='visible';
	document.getElementById('overlay_quote_popup').style.visibility='visible';
	document.getElementById('overlay_quote_popup').style.width = arrayPageSize[0] +"px";
	document.getElementById('overlay_quote_popup').style.height = arrayPageSize[1] +"px";
	opacity('overlay_quote_popup', 0, 70, 1000);	
	trackit('wshl', 'quote_popup');
}

function wish_quote_update_topleft() {
    var url = 'ajax_quote_update_topleft.php';
    var pars = '';
    var myAjax = new Ajax.Updater({success: 'wishdisplay'},url,
      {
        method:'post',
        parameters: pars, 
        onFailure: reportError
      });  
}

function wish_add_sg(theelid, newemail, newscheckbox) {
	if (document.getElementById('wishprice' + theelid).value == 'null' || document.getElementById('wishdims' + theelid).value == ''){
		show_size_popup(theelid);
		return;
	}
		var pid = $F('pid' + theelid);
		var wishstain = $F('wishstain' + theelid);
		var wishhardware = $F('wishhardware' + theelid);
		var wishwood = $F('wishwood' + theelid);
		var wishprice = $F('wishprice' + theelid);
		var wishdims = $F('wishdims' + theelid);
		var newemailwrite = '';
	  var newscheckboxwrite = 'no';
	  if (newemail == 'yes'){
	  	newemailwrite = document.getElementById('newemail').value;	  
	  }
	  if (newscheckbox == 'yes' && document.getElementById('wishnewscheckbox').checked == true){
	  	newscheckboxwrite = 'yes';
	  }	  
    var url = 'ajax_wish_update.php';
    var pars = 'pid=' + pid + '&wishstain=' + wishstain + '&wishhardware=' + wishhardware + '&wishwood=' + wishwood + '&wishprice=' + wishprice + '&wishdims=' + wishdims + '&newemail=' + newemailwrite + '&newscheckbox=' + newscheckboxwrite;
    var myAjax = new Ajax.Updater({success: 'wishdisplay'},url,
      {
        method:'post',
        parameters: pars, 
        onFailure: reportError
      });  
  
	document.getElementById('infobox2').style.display = 'block';	
	hideDHTML('wishlist_form');
	hideDHTML('wishlist_form_size');
	fadeout_wishpointer_div();	  
}
function show_slick_wishlist_sg(theelid){
	if (readCookie('wishloggedin')){
		wish_add_sg(theelid, '', '');
		return;
	}
	if (document.getElementById('wishprice' + theelid).value == 'null' || document.getElementById('wishdims' + theelid).value == ''){
		show_size_popup(theelid);
		return;
	}
	arrayPageSize = getPageSize();
	marginThisLeft2 = (arrayPageSize[0] - 576) / 2;
	document.getElementById('wishlist_form').style.marginLeft = marginThisLeft2;
	document.getElementById('wishlist_form').style.marginTop = 20 + document.body.scrollTop;
	document.getElementById('wishlist_form').style.visibility='visible';
	document.getElementById('overlay_wishlist_form').style.visibility='visible';
	document.getElementById('overlay_wishlist_form').style.width = arrayPageSize[0] +"px";
	document.getElementById('overlay_wishlist_form').style.height = arrayPageSize[1] +"px";
	opacity('overlay_wishlist_form', 0, 70, 1000);	
	document.getElementById("wishlist_form_url").href= "javascript: wish_add_sg("+ theelid +", 'yes', 'yes')";
}

function show_size_popup(theelid){
	document.getElementById("wishlist_form_size_inner").innerHTML = size_html[theelid];
	arrayPageSize = getPageSize();
	marginThisLeft2 = (arrayPageSize[0] - 576) / 2;
	document.getElementById('wishlist_form_size').style.marginLeft = marginThisLeft2;
	document.getElementById('wishlist_form_size').style.marginTop = 20 + document.body.scrollTop;
	document.getElementById('wishlist_form_size').style.visibility='visible';
	document.getElementById('overlay_wishlist_form_size').style.visibility='visible';
	document.getElementById('overlay_wishlist_form_size').style.width = arrayPageSize[0] +"px";
	document.getElementById('overlay_wishlist_form_size').style.height = arrayPageSize[1] +"px";
	opacity('overlay_wishlist_form_size', 0, 70, 1000);	
	if (readCookie('wishloggedin')){
		document.getElementById("wishlist_form_size_url").href= "javascript: wish_add_sg("+ theelid +", '', '')";
	}else {
		document.getElementById("wishlist_form_size_url").href= "javascript: show_slick_wishlist_sg("+ theelid +")";
	}
}

function ant_inquiry() {
		var antemail = $F('antemail');
		var antcomments = $F('antcomments');
		var antpage = $F('antpage');
    var url = 'ajax_ant_inquiry.php';
    
    if(!check_email(antemail)){
			alert("Your email address is invalid. Please enter again.");
			return;
		}
    var pars = 'antemail=' + antemail + '&antcomments=' + antcomments + '&antpage=' + antpage;
    var myAjax = new Ajax.Updater({success: 'rb'},url,
      {
        method:'post',
        parameters: pars, 
        onSuccess: pageTracker._trackPageview("prantinq-thankyou.html"),
        onFailure: reportError
      });
}


function more_photos_req() {
		var mpid = $F('mpid');
		var mpname = $F('mpname');
		var mpemail1 = $F('mpemail1');
		var mpemail2 = $F('mpemail2');
    var url = 'ajax_ant_morep_req.php';
    
    if(!check_email(mpemail1)){
			alert("Your email address is invalid. Please enter again.");
			return;
		}
		
		if(mpemail2 != mpemail1){
			alert("Please re-enter correct email address.");
			return;
		}
		var mpnews = 'no';
	  if (document.getElementById('mpnewscheckbox').checked == true){
	  	mpnews = 'yes';
	  }	
	  
    var pars = 'mpemail=' + mpemail1 + '&mpname=' + mpname + '&mpid=' + mpid + '&mpnews=' + mpnews;
    var myAjax = new Ajax.Updater({success: 'morephotos'},url,
      {
        method:'post',
        parameters: pars, 
        onSuccess: pageTracker._trackPageview("prantmorep-thankyou.html"),
        onFailure: reportError
      });
}

function more_photos_req2() {
		var mpid = $F('mpid');
		var mpname = $F('mpname');
		var mpemail1 = $F('mpemail1');
		var mpemail2 = $F('mpemail2');
    var url = 'ajax_ant_morep_req2.php';
    
    if(!check_email(mpemail1)){
			alert("Your email address is invalid. Please enter again.");
			return;
		}
		
		if(mpemail2 != mpemail1){
			alert("Please re-enter correct email address.");
			return;
		}
		var mpnews = 'no';
	  if (document.getElementById('mpnewscheckbox').checked == true){
	  	mpnews = 'yes';
	  }	
	  
    var pars = 'mpemail=' + mpemail1 + '&mpname=' + mpname + '&mpid=' + mpid + '&mpnews=' + mpnews;
    var myAjax = new Ajax.Updater({success: 'morephotos'},url,
      {
        method:'post',
        parameters: pars, 
        onSuccess: pageTracker._trackPageview("prantmorep-thankyou.html"),
        onFailure: reportError
      });
}

function ant_req_p() {
		var antreqemail = $F('antreqemail');
		var antreqemail2 = $F('antreqemail2');
		var antreqprc = $F('antreqprc');
		var antreqcomments = $F('antreqcomments');
		
    var url = 'ajax_ant_req_p.php';
    
    if(!check_email(antreqemail)){
			alert("Your email address is invalid. Please enter again.");
			return;
		}
		
		if(antreqemail2 != antreqemail){
			alert("Please re-enter correct email address.");
			return;
		}
		var reqpnews = 'no';
	  if (document.getElementById('antreqnewscheckbox').checked == true){
	  	reqpnews = 'yes';
	  }	
	  
    var pars = 'antreqemail=' + antreqemail + '&antreqprc=' + antreqprc + '&antreqcomments=' + antreqcomments + '&reqpnews=' + reqpnews;
    var myAjax = new Ajax.Updater({success: 'r_reqp'},url,
      {
        method:'post',
        parameters: pars, 
        onFailure: reportError
      });
}