﻿var sku_mouseover = "";
var wndPopup = null;

function PopupZoom(sku, strProdCode) {
	wndPopup = window.open('/e/ptxwebstore_product/product_zoom.asp?sku=' + sku + '&prod_code=' + strProdCode, 'Popup', 'scrollbars=no,width=426,height=460,resizable=yes')
    wndPopup.moveTo(0, 0);
    wndPopup.focus();
}

function doTellFriendWindow(sku) {
	var urlStr;
	urlStr=window.location.href;
	while (urlStr.indexOf("&")>0) {
		urlStr=urlStr.replace(/&/,", ");
	}

	if (window.location.href.indexOf("ptxwebstore_TellFriendFrame.asp")<0) {
		window.location.replace('/e/ptxwebstore_TellFriendFrame.asp?check=0&url=' + urlStr+'?sku='+sku);
	}
}

function AskQuestionWindow(sku)
{
	window.open('/e/ptxwebstore_order_mgnt/siteletternew.asp?sendfrom=2&sku='+sku, 'PrintWin','toolbar=no,scrollbars=yes,resizable=yes,height=400,width=640');
}

function MemberpopWin(sku) {
	window.open("/e/ptxwebstore_product/product_comment.asp?sku="+sku, "_blank", "toolbar=no,scrollbars=yes,resizable=yes,height=400,width=640");
}  

function ShowColorImage(att_name,att_id,suk,typ,intRec)
{
	var hidd=document.all(suk);
	var text=document.getElementById("t"+suk);
	var img=document.getElementsByTagName("img"); 
	var i;
	
	if (text!=null)
	{
		text.innerText=att_name;
	}
	if(hidd!=null)
	{
		hidd.value=att_id;
	}
	
	for(i=0;i<img.length;i++){
		if(img[i].id.toString().indexOf("img"+typ+intRec+"_")!=-1)
		{
			if(img[i].id.toString()=="img"+typ+intRec+"_"+att_id)
			{
				img[i].style.padding="1px";
				img[i].style.border="1px solid #333";
			}
			else
			{
				img[i].style.border="0px";
			}
		}
	}
}

function ShowWhatIsHot(divname)
{
	var objdiv=document.getElementsByTagName("div");
	
	for(i=0;i<objdiv.length;i++){
		if(objdiv[i].id.toString().indexOf("Hot")!=-1 && objdiv[i].id.toString().indexOf("_")!=-1)
		{
			if(objdiv[i].id.toString()==divname)
			{
				objdiv[i].style.display="block";
			}
			else
			{
				objdiv[i].style.display="none";
			}
		}
	}
}

function ShowAdditionalImage(strName,imgSrc)
{
	var obj=document.getElementsByName(strName); 
	for(var i=0;i<obj.length;i++)
	{
		if(obj[i].style.display!='none') 
			obj[i].src=imgSrc;
	}
}

function ChangeLanguage(lang,url)
{
	document.cookie = "uLanguage="+lang;
	window.location.href=url;
}

function LoginSystem()
{
	frmLogin.action="/e/ptxwebstore_member/buyer_login.asp?Validate=1";
	frmLogin.submit();
}

function IframeAutoHeight(obj)
{
	if(obj.contentWindow.document.body.scrollHeight>0)
		obj.style.height=obj.contentWindow.document.body.scrollHeight;
	else
		setTimeout("IframeAutoHeight()",200);
}