function openSearch(val)
{
	if (val=="Advance")
	{
		window.opener.location.href="ClientAdvancedSearch.asp";
		window.close();
	}
	if (val=="Catalog")
	{
		window.opener.location.href="ClientAdvancedSearch.asp";
		window.close();
	}
}
function showSelect()
{
	document.forms[0].action="EflyerSearchProduct.asp?from=EflyerProductListing";
	document.forms[0].method="post";
	document.forms[0].submit();
}
function loginChk(ProductImage,ProductId,ProductCode,ProductType)
{
	var filename = "ClientAddLogo.asp?logosearchtype=C^^^^productimage="+ProductImage.split("/")[ProductImage.split("/").length-1]+"^^^^productid="+ProductId+"^^^^productcode="+ProductCode+"^^^^producttype="+ProductType;
	document.forms[0].method="post";
	document.forms[0].target="";
	window.opener.location.href="clientlogin.asp?Filename="+filename;
	window.close();
}


function viewMoreLogos(ProductImage,ProductId,ProductCode,ProductType)
{
	var filename = "ClientProductDetails.asp?productimage="+ProductImage.split("/")[ProductImage.split("/").length-1]+"^^^^productid="+ProductId+"^^^^productcode="+ProductCode+"^^^^producttype="+ProductType;
	document.forms[0].method="post";
	document.forms[0].target="";
	window.opener.location.href="clientlogin.asp?Filename="+filename;
	window.close();
}
function loginUser()
{
	window.opener.location.href="clientlogin.asp";
	window.close();
}
function browseSite(url)
{
	document.location.href = url;
	childwindow.close(); // Closing the product details window for the main window. Here 'childwindow' is the name of the child window
}
function quoteChk()
{
	event.keyCode=quoteDisallow(event.keyCode)	
}
function quoteDisallow(keyPressed)
{
	if (keyPressed==39 || keyPressed==34 || keyPressed==13)
	{
		keyPressed = 0
	}
	else
	{		
	}
	return keyPressed	
}
function RegisterGuestWL(val,productId,LogoSearchType,logoId,prodType,prodImg,productCode,productOffer,imageSourceId)
{
	if (val == "guest")
	{
		if (prodType=="0" || prodType == "withoutlogo")
		{
			logoId = "";
			imageSourceId = "";
		}
		var prodDet = "||"+productId+"^^"+productCode+"^^"+logoId+"^^"+imageSourceId;
		document.forms[0].method="post";
		document.forms[0].target="";
		var strDetails="ClientShortList.asp?Filename=GuestSave+"+prodDet+"";
		window.opener.location.href="clientlogin.asp?Filename="+strDetails;
		window.close();
	}
	/*else
	{
		document.frmProductDetails.method="post";
		document.location.href="ClientProductDetails.asp?addsc=Y&logoid="+logoId+"&logoSearchType="+Logosearchtype+"&listvalues="+variantName+"|"+productColor+"&productId="+productId+"&productname="+ProductName+"&productimage="+prodImg+"&productcode="+productCode+"&producttype="+prodType+"&productoffer="+productOffer+"Filename="+strDetails+"&mode="+mode;
	}*/
}
function prodDetShortList(productId,productImage,productCode,productType,logoSearchType,logoId,productOffer,logoimage,imagesourceid,rowCount)
{
	if (productType=="withoutlogo")
	{
		logoId = "";
		imagesourceid = "";
	}
	if (rowCount == 0 )
	
	{
		mode="createnew";
		chSListWin=window.open("CreateShortList.asp?productid="+productId+"&productimage="+productImage+"&productcode="+productCode+"&producttype="+productType+"&productoffer="+productOffer+"&logosearchtype="+logoSearchType+"&logoid="+logoId+"&mode="+mode+"&imagesourceid="+imagesourceid, "win2", "width=400, height=300, top=100,left=300, resizable=yes, scrollbars=yes")
		chSListWin.focus();
	}
	else
	{
		var mode = "addproduct";
		document.forms[0].target = "_parent";
		document.forms[0].method="post";
		document.forms[0].action =  "ClientProductDetails.asp?shortlistid="+document.frmProductDetails.selectshortlist.value+"&productid="+productId+"&productimage="+productImage+"&productcode="+productCode+"&producttype="+productType+"&productoffer="+productOffer+"&logosearchtype="+logoSearchType+"&logoid="+logoId+"&logoimage="+logoimage+"&imagesourceid="+imagesourceid+"&mode="+mode;
		document.forms[0].submit();
	}
}		
function ChkTextSearch(loginid,FolderNo)
{
	var strSearchTxt = document.frmProductSearch.txtSearchTxt.value;
	while(''+strSearchTxt.charAt(0)==' ')
		strSearchTxt=strSearchTxt.substring(1,strSearchTxt.length);
	document.frmProductSearch.txtSearchTxt.value=strSearchTxt;
	if (strSearchTxt == "")
	{
		alert("Please enter Search Criteria");
		document.frmProductSearch.txtSearchTxt.focus();
		return false;
	}
	var strCriteria;
	strCriteria=document.frmProductSearch.txtSearchTxt.value;
	if (strCriteria=="%")
	{
		strCriteria=""
	}
	document.frmProductSearch.action="ClientProductListing.asp?strSearch=text&loginid="+ loginid +"&FolderNo="+FolderNo+"&strPageno=0&strCriteria="+strCriteria;
	return true;
}

function getOffersDetail(loginid,folderno,productid,productname)
{
	window.opener.location.href="ClientProdDetOffer.asp?loginid="+loginid+"&folderno="+folderno+"&productid="+productid;	
	window.close();
}

function getOffers(loginid,folderno,productid,productname)
{
	window.opener.location.href="ViewOfferDisc.asp?loginid="+loginid+"&folderno="+folderno+"&productid="+productid;	
	window.close();
}

function changeImage(producttype,folderno,variantdetails,prodid,prodcode,prodimage,variantname,apppathusers,apppathusers1)
{

}

function setProductColour(producttype,folderno,productid,productimage,productcode,productcolor,apppathusers,apppathusers1)
{		
	var productimage=productimage.substring(productimage.lastIndexOf("/") + 1)
	parent.frmProductDetails.txtProdCode.value = productcode;
	parent.frmProductDetails.hidProdColor.value = productcolor.replace("=+=","\"").replace("=","'");
	if (producttype=="0")
	{
		parent.document.imgProdImg.src = apppathusers+"images/products/"+productimage;
	}
	else if (producttype=="withoutlogo")
	{
		if (productimage.split("_").length=="1")
		{
			parent.document.imgProdImg.src = apppathusers+"images/products/"+productimage;
		}
		else
			parent.document.imgProdImg.src = apppathusers+"images/products/"+productimage.split("_")[1];
	}
	else
	{
		if (productimage.split("_").length=="1")
		{
			parent.document.imgProdImg.src = apppathusers+"images/users/"+folderno+"/"+productid+"_"+productimage;
		}
		else
			parent.document.imgProdImg.src = apppathusers+"images/users/"+folderno+"/"+productimage;
	}
}

function changeLogo(producttype,folderno,logoid,variantdet,prodname,prodid,srcimage,listvalues,logoimage,apppathusers,apppathusers1)
{
	document.frmProductDetails.guestlogoid.value = logoid;
	document.frmProductDetails.imgLogoImage.src = apppathusers+"/images/logos/guest/"+logoimage;
	var prodsrcimage=logoid+"_"+srcimage.split('//')[1].split('/')[srcimage.split('//')[1].split('/').length-1].split("_")[1];
	var splitvar = variantdet.split(";")
	prodimages = "";
	for (var i=0;i<splitvar[2].split(",").length;i++)
	{
		prodimages = prodimages+logoid+"_"+((splitvar[2].split(",")[i]).split("_")[1]);
		if (i<splitvar[2].split(",").length-1)
		{
			prodimages = prodimages +",";
		}
	}
	iFraProdColor.location.href="ClientProductColours.asp?defaultlogoimage="+logoimage+"&listvalues="+listvalues+"&producttype="+producttype+"&variantname="+unescape(splitvar[1])+"&folderno="+folderno+"&productcolours="+prodimages+"|"+unescape(splitvar[4])+"&productname="+prodname+"&productid="+prodid+"&productcode="+splitvar[3];	
	if (producttype=="0")
	{
		document.imgProdImg.src = apppathusers+"/images/products/"+prodsrcimage;
	}
	else
		document.imgProdImg.src = apppathusers+"/images/users/"+folderno+"/"+prodsrcimage;
}

function getProductDetails(producttype,loginid,folderno,productid,productname,productimage,productcode,variantname,listvalues,logosearchtype,logoid,productoffer,imagesourceid,logoimage)
{
	if (productid!="")
	{
		if(productoffer !="" && productoffer.charAt(0)==',')
		{
			productoffer=productoffer.substr(1);
		}
		if (logoimage==null)
		{
			logoimage="";
		}
		window.open("ClientProductDetails.asp?productoffer="+escape(productoffer)+"&logoid="+logoid+"&logosearchtype="+logosearchtype+"&listvalues="+escape(listvalues)+"&producttype="+producttype+"&variantname="+escape(variantname)+"&loginid="+loginid+"&folderno="+folderno+"&productid="+productid+"&logoimage="+logoimage+"&productname="+escape(productname)+"&imagesourceid="+imagesourceid+"&productimage="+productimage+"&productcode="+escape(productcode),"getProductDetails","top=0,left=0,width=800,height=600,resizable=yes,scrollbars=yes");
	}	
}

function pickProductDetails(producttype,loginid,folderno,productid,productimage,productcode,logosearchtype,logoid,productoffer,imagesourceid,logoimage)
{ 
	if (productid!="")
	{
		if(productoffer !="" && productoffer.charAt(0)==',')
		{
			productoffer=productoffer.substr(1);
		}
		if (logoimage==null)
		{
			logoimage="";
		}
		window.open("ClientProductDetails.asp?productoffer="+productoffer+"&logoid="+logoid+"&logosearchtype="+logosearchtype+"&producttype="+producttype+"&loginid="+loginid+"&folderno="+folderno+"&productid="+productid+"&logoimage="+logoimage+"&imagesourceid="+imagesourceid+"&productimage="+productimage+"&productcode="+productcode,"getProductDetails","top=0,left=0,width=800,height=600 ,resizable=yes,scrollbars=yes");
	}	
}

function saveImage(productimage)
{
	var arrFileSplitValues = productimage.split('//')[1].split('/');
	var strFileName = "";
	for (var intCtr1=0;intCtr1<arrFileSplitValues.length;intCtr1++)
	{
		if (arrFileSplitValues[intCtr1]=="images")
		{
			for (var intCtr2=intCtr1;intCtr2<arrFileSplitValues.length;intCtr2++)
			{
				strFileName = strFileName + arrFileSplitValues[intCtr2];
				if (parseInt(intCtr2)<parseInt(arrFileSplitValues.length-1))
				{

					strFileName = strFileName + "/"

				}
			}
			break;
		}
	}

	//document.location.href="ClientSaveImage.asp?FileName="+strFileName;
	document.location.href="download.asp?FileName="+strFileName;
}

function getLogo(logosearchtype,producttype,loginid,folderno,productid,productname,productimage,productcode,variantname,productoffer,productColor)
{
	document.frmProductDetails.hidLogoSearchType.value = logosearchtype;
	document.frmProductDetails.target="_self";
	document.frmProductDetails.method="post";
	document.frmProductDetails.action="ClientSetProductLogo.asp?productColor="+productColor+"&productoffer="+productoffer+"&logosearchtype="+logosearchtype+"&producttype="+producttype+"&loginid="+loginid+"&folderno="+folderno+"&productid="+productid+"&productname="+productname+"&productimage="+productimage+"&productcode="+productcode+"&variantname="+variantname;
	document.frmProductDetails.submit();
}


function CloseWindow(val,loginid,folderno,ProductId,Logosearchtype,logoid,prodtype,prodimg,productcode,imagesourceid,productoffer,logoimage)
{
	if (prodtype=="withoutlogo" || prodtype=="0")
	{
			imagesourceid=null;
			logoid=null;
	}
	if (val=="N")
	{
		document.frmProductDetails.ShopCart.value=ProductId+"||"+productcode+"||"+Logosearchtype+"||"+logoid+"||"+imagesourceid;
		document.forms[0].method="post";
		document.forms[0].target="";
		window.opener.location.href="clientlogin.asp?CartDet="+document.frmProductDetails.ShopCart.value+"&Filename=AddToShoppingCart.asp?";
		window.close();
	}
	else
	{
		document.frmProductDetails.ShopCart.value=ProductId+"||"+productcode+"||"+Logosearchtype+"||"+logoid+"||"+imagesourceid;
		document.frmProductDetails.method="post";
		document.forms[0].target="_parent";
		if (prodtype=="withoutlogo" || prodtype=="0")
		{
			document.frmProductDetails.action="ClientProductDetails.asp?addsc=Y&logoWithout=Y&logoid=&logoimage="+logoimage+"&logosearchtype="+Logosearchtype+"folderno="+folderno+"&loginid="+loginid+"&productid="+ProductId+"&productimage="+prodimg+"&productcode="+productcode+"&producttype="+prodtype+"&imagesourceid=&productoffer="+productoffer+"&CartVal="+document.frmProductDetails.ShopCart.value;
		}
		else
		{
			document.frmProductDetails.action="ClientProductDetails.asp?addsc=Y&logoWithout=N&logoid="+logoid+"&logoimage="+logoimage+"&logosearchtype="+Logosearchtype+"&folderno="+folderno+"&loginid="+loginid+"&productid="+ProductId+"&productimage="+prodimg+"&productcode="+productcode+"&producttype="+prodtype+"&imagesourceid="+imagesourceid+"&productoffer="+productoffer+"&CartVal="+document.frmProductDetails.ShopCart.value;
		}
		document.frmProductDetails.submit();
	}
}

function openwinPrdDet(productId,LogoSearchType,LogoId,productType,productImage,productCode,productOffer,logoImage,imagesourceid)
{
	
	chSListWin=window.open("CreateShortList.asp?productid="+productId+"&LogoSearchType="+LogoSearchType+"&LogoId="+LogoId+"&producttype="+productType+"&productimage="+productImage+"&productcode="+productCode+"&productoffer="+productOffer+"&imagesourceid="+imagesourceid+"&logoImage="+logoImage, "win2", "width=400, height=300, top=100,left=490, resizable=yes, scrollbars=yes")
	chSListWin.focus();
}

function changeLogoImage(logodetails,productid,loginid,productimage,productcode,producttype,apppathusers,apppathusers1)
{
	if (logodetails.split("|")[0]!="NS")
	{
		var logoid = logodetails.split("|")[0];
		var logoimage = logodetails.split("|")[1];
		//document.imgLogoImage.src = apppathusers1+"images\logos\0\\"+logoimage+"";
		var productimage=document.imgProdImg.src.split("//")[1].split("/")[document.imgProdImg.src.split("//")[1].split("/").length-1];
		if (productimage.split("_").length==2)
		{
			productimage = productimage.split("_")[1]
		}
		document.frmProductDetails.hidLogoId.value=logoid;
		document.frmProductDetails.hidLogoSearchType.value='R';
		document.frmProductDetails.hidImageSourceId.value='0';
		document.location.href="ClientProductDetails.asp?productimage="+productimage+"&productid="+productid+"&productcode="+productcode+"&producttype="+producttype+"&logosearchtype=R&logoid="+logoid+"&imagesourceid=0&logoimage="+logoimage;
	}
}

function changeYourLogoImage(logodetails,productid,folderno,productimage,productcode,producttype,apppathusers,apppathusers1)
{
	if (document.frmProductDetails.yourlogoid.value.split("|")[0]!="NS")
	{
		var logoid = logodetails.split("|")[0];
		var logoimage = logodetails.split("|")[1];
		document.imgLogoImage.src = apppathusers+"images\logos\\"+folderno+"\\"+logoimage;
		var productimage = productimage;
		if (productimage=="change")
		{
			productimage=document.imgProdImg.src.split("//")[1].split("/")[document.imgProdImg.src.split("//")[1].split("/").length-1];
			if (productimage.split("_").length==2)
			{
				productimage = productimage.split("_")[1]
			}
		}
		document.frmProductDetails.hidLogoId.value=logoid;
		document.frmProductDetails.hidLogoSearchType.value='C';
		document.frmProductDetails.hidImageSourceId.value=folderno;
		document.location.href="ClientProductDetails.asp?productimage="+productimage+"&productid="+productid+"&productcode="+productcode+"&producttype="+producttype+"&logosearchtype=C&logoid="+logoid+"&imagesourceid="+folderno+"&logoimage="+logoimage;
	}	
}

function manageLogos(productoffer,producttype,productid,productimage,productcode)
{
	window.opener.location.href="ClientAddLogo.asp?logosearchtype=C&productoffer="+productoffer+"&producttype="+producttype+"&productid="+productid+"&productimage="+productimage+"&productcode="+productcode;
	window.close();
}

function addProduts(prodNo,countTempProd,countUserProd,strProdId)
{
		
	var strmsgCheck = true;
	
	strProdId  = strProdId.split(":");

	chkflag = 0
	var cnt = 0
	
	for (i=0;i<strProdId.length-1;i++)
	{
		
	
		if(eval("document.frmProductSearch.chkProd"+strProdId[i]+".checked") == true)
		{
			if(eval("document.frmProductSearch.chkProd"+strProdId[i]+".value") == "24_1" || eval("document.frmProductSearch.chkProd"+strProdId[i]+".value") == "24_2" || eval("document.frmProductSearch.chkProd"+strProdId[i]+".value") == "24_3")
			{
				cnt= cnt + 1
			}
			
		}
		if (cnt == 1)
		{
			chkflag = 1;
		}
		if (cnt > 1)
		{
			alert("Please select only one product which have product code 2000");
			return
		}	
			
	}
	//return
	for (i=0;i<strProdId.length-1;i++)
	{
		if(eval("document.frmProductSearch.chkProd"+strProdId[i]+".checked") == true)
			chkflag = 1;
	}
	if(chkflag == 0)
	{
		alert("Please select a product to add to the E-Flyer!");
		return;
	}

	if (countUserProd == "")
	{
		countUserProd=0;
	}
	//1st time if condition
	var CurrCount = 0;
	for(i=0;i<strProdId.length-1;i++)
	{
		if(eval("document.frmProductSearch.chkProd"+strProdId[i]+".checked"))
			CurrCount = CurrCount + 1;
	}
	
	if ((parseInt(countUserProd) + parseInt(CurrCount)) > parseInt(countTempProd))
	{
		alert("The Template you have selected allows only "+countTempProd+" products to be added for the E-Flyer! ");
			var unDisabled,unDisabled1;
			var unCheck,unCheck1;
			for (i=0;i<strProdId.length-1;i++)
			{
				if(i==0)
				{
					unDisabled = eval("document.frmProductSearch.chkProd"+strProdId[i]+"");
					if (unDisabled.disabled == false)
					{
						unCheck = eval("document.frmProductSearch.chkProd"+strProdId[i]+"");
						unCheck.checked = false;
					}
				}
				else
				{
					if (typeof(strProdId[i]) != "undefined" && strProdId[i] != "")
					{
						unDisabled1 = eval("document.frmProductSearch.chkProd"+strProdId[i]+"");
						if (unDisabled1.disabled == false)
						{
							unCheck1 = eval("document.frmProductSearch.chkProd"+strProdId[i]+"");
							unCheck1.checked = false;
						}
					}
				}
			}
		
		return;
	}

	var msg=false;
	if (countUserProd < 1)
	{
			msg = false;
			for (i=0;i<strProdId.length-1;i++)
			{
				if(i==0)
				{
					if (eval("document.frmProductSearch.chkProd"+strProdId[i]+".checked") == true)
					{
						document.frmProductSearch.selectedProducts.value = document.frmProductSearch.selectedProducts.value + eval("document.frmProductSearch.chkProd"+strProdId[i]+".value") + "^^"
						alert("The product has been added to the E-Flyer");
						countUserProd=parseInt(countUserProd)+1;
						msg = true;
					}
					prodNo=parseInt(prodNo)+1;
				}//if
				else
				{
					if (parseInt(countUserProd) <= parseInt(countTempProd))
					{
						if (strProdId[i] != "")
						{
							if (eval("document.frmProductSearch.chkProd"+strProdId[i]+".checked") == true)
							{
								document.frmProductSearch.selectedProducts.value = document.frmProductSearch.selectedProducts.value + eval("document.frmProductSearch.chkProd"+strProdId[i]+".value") + "^^"
								countUserProd = parseInt(countUserProd) + 1
							}
						}
					}
				}//else
			}//for
			
			if (msg == false)
				alert("The product has been added to the E-Flyer");
			document.frmProductSearch.method="post";
			document.frmProductSearch.action = document.frmProductSearch.eflyerschstring.value;
			document.frmProductSearch.submit();
	}
	else
	{
		var1 = document.frmProductSearch.selectedProducts.value.split("^^");
		var2 = prodNo;
		var str = false;
		
for (j=0;j<strProdId.length-1;j++)
{
	if(j==0)
	{
		for (var i=0; i < var1.length; i++) 
		{
			if (strProdId[j] ==  var1[i]) 
			{
				str=true;
				break;
			} 
			if (str == false)
			{
				if (parseInt(countUserProd) < parseInt(countTempProd))
				{
					if (eval("document.frmProductSearch.chkProd"+strProdId[j]+".checked") == true)
					{
						document.frmProductSearch.selectedProducts.value = document.frmProductSearch.selectedProducts.value + eval("document.frmProductSearch.chkProd"+strProdId[i]+".value") + "^^"
						countUserProd=parseInt(countUserProd)+1;
						alert("The product has been added to the E-flyer");
						msg = true;
						break;
					}
				}  
			}
		}
		prodNo = parseInt(prodNo) + 1;
	}//if
	else
	{
		str=false;
		var1 = document.frmProductSearch.selectedProducts.value.split("^^");
		
		for (var i=0; i < var1.length; i++) 
		{
			if (strProdId[j] ==  var1[i]) 
			{
				str=true
				break;
			} 

			if (str == false)
			{
					if (parseInt(countUserProd) >= countTempProd)
					{
						if (strmsgCheck == true)
						{
							//alert("The Template you have selected allows only "+countTempProd+" products to be added for the E-Flyer!");
						}
						strmsgCheck=false;
					}
					else
					{
						if (strProdId[j] != "")
						{
							if (eval("document.frmProductSearch.chkProd"+strProdId[j]+".checked") == true)
							{
								//alert(document.frmProductSearch.selectedProducts.value + " := " + document.frmProductSearch.selectedProducts.value + " + " + eval("document.frmProductSearch.chkProd"+strProdId[j]+".value") + "^^");
								document.frmProductSearch.selectedProducts.value = document.frmProductSearch.selectedProducts.value + eval("document.frmProductSearch.chkProd"+strProdId[j]+".value") + "^^"
								countUserProd=parseInt(countUserProd)+1;
								break;
							}
						}  
					}
				}

		}//for inner
	}//else
}//for outer	

		if (msg == false)
			alert("The product has been added to the E-Flyer");

		document.frmProductSearch.method="post";
		document.frmProductSearch.action = document.frmProductSearch.eflyerschstring.value;
		document.frmProductSearch.submit();
	}
} 



/*
function SaveEflyer(countTempProd,countUserProd,TemplateID,adminflag)
{
	if (parseInt(countUserProd) == 0)
	{
		alert("The Template you have selected needs you to select atleast 1 product for the E-Flyer! \n If you have already selected a product then please click on the Add to Mailer Button");		
		return;
	}
	document.frmProductSearch.method="post";
	if (adminflag == 1)
		document.frmProductSearch.action="../EflyerTemplates/" + TemplateID + "/Preview.asp";
	else
		document.frmProductSearch.action="EflyerTemplates/" + TemplateID + "/Preview.asp";
	document.frmProductSearch.submit();
}
*/
function SaveEflyer(countTempProd,countUserProd)
{

	if (parseInt(countUserProd) == 0)
	{
		alert("The Template you have selected needs you to select atleast 1 product for the Eflyer! \n If you have already selected a product then please click on the Add to Mailer Button");		
		return;
	}

	document.frmProductSearch.method="post";
	document.frmProductSearch.action="EflyerPreview.asp";
	document.frmProductSearch.submit();
}



function pickProductDetailsEflyer(producttype,loginid,folderno,productid,productimage,productcode,logosearchtype,logoid,productoffer,imagesourceid,logoimage)
{
	
	if (productid!="")
	{
		if(productoffer !="" && productoffer.charAt(0)==',')
		{
			productoffer=productoffer.substr(1);
		}
		if (logoimage==null)
		{
			logoimage="";
		}
		window.open("../../../ClientProductDetails.asp?productoffer="+productoffer+"&logoid="+logoid+"&logosearchtype="
		+logosearchtype+"&producttype="+producttype+"&loginid="+loginid+"&folderno="+folderno+"&productid="+
			productid+"&logoimage="+logoimage+"&imagesourceid="+imagesourceid+"&productimage="+productimage+
			"&productcode="+productcode+"&virtsamples=jsp","getProductDetails","top=0,left=0,width=800,height=650,resizable=yes,scrollbars=yes");
	}	
}


function closewindowemail(Producttype,ProductId,Productimage,productcode)
	{
		//window.opener.location.href="ClientEmailPage.asp?productId="+ProductId+"&productimage="+Productimage+"&Producttype="+Producttype+"&productcode="+productcode;
		document.Product.method="post";
		document.Product.FinalTableHid.value = printbody;
		document.Product.action="EmailPage.asp?productId="+ProductId+"&productimage="+Productimage+"&Producttype="+Producttype;
		document.Product.target="_self"
		document.Product.submit();
	}

	function closewindowprint(Producttype,ProductId,Productimage)
	{
		//window.open("ClientProductDetailsprint.asp?productId="+ProductId+"&productimage="+Productimage+"&Producttype="+Producttype ,"getProductDetailsnew","top=10,left=10,width=610,height=400,resizable=yes,scrollbars=yes");
		document.Product.method="post";
		document.Product.target = "_blank";
		document.Product.FinalTableHid.value = printbody;
		document.Product.action="ClientProductDetailsprint.asp?productId="+ProductId+"&productimage="+Productimage+"&Producttype="+Producttype;
		document.Product.submit();

	}
	function pickProductDetails3d(producttype,loginid,folderno,productid,productimage,productcode,logosearchtype,logoid,productoffer,imagesourceid,logoimage)
{
//	alert(productid);
	if (productid!="")
	{
		if(productoffer !="" && productoffer.charAt(0)==',')
		{
			productoffer=productoffer.substr(1);
		}
		if (logoimage==null)
		{
			logoimage="";
		}
		// window.location.href="ClientProductDetails.asp?productoffer="+productoffer+"&logoid="+logoid+"&logosearchtype="+logosearchtype+"&producttype="+producttype+"&loginid="+loginid+"&folderno="+folderno+"&productid="+productid+"&logoimage="+logoimage+"&imagesourceid="+imagesourceid+"&productimage="+productimage+"&productcode="+productcode;
		window.open("ClientProductDetails.asp?productoffer="+productoffer+"&logoid="+logoid+"&logosearchtype="+logosearchtype+"&producttype="+producttype+"&loginid="+loginid+"&folderno="+folderno+"&productid="+productid+"&logoimage="+logoimage+"&imagesourceid="+imagesourceid+"&productimage="+productimage+"&productcode="+productcode,"getProductDetails","top=0,left=0,width=700,height=600,resizable=yes,scrollbars=yes");
		window.close()
	}	
}
function advsrch()
{
document.forms[0].method="post";
		document.forms[0].target="";
		window.opener.location.href="ClientAdvancedSearch.asp";
		window.close();
}
function ordersample(chk,pid)
{
if (chk=="guest")
{
		document.forms[0].method="post";
		document.forms[0].target="";
		window.opener.location.href="Clientlogin.asp?Filename=ClientOrderPrintCatalog.asp?productid="+pid;
		window.close();
}
else
	{	document.forms[0].method="post";
		document.forms[0].target="";
		window.opener.location.href="ClientOrderPrintCatalog.asp?productid="+pid;
		window.close();
	}
}

function showSelect()
{
	document.forms[0].action="EflyerSearchProduct.asp?from=EflyerPreview";
	document.forms[0].method="post";
	document.forms[0].submit();
}
