var xmlHttp 
function GetXmlHttpObject(){ 
	var objXMLHttp=null 
	if (window.XMLHttpRequest){ 
	objXMLHttp=new XMLHttpRequest() 
	}else if (window.ActiveXObject){ 
	objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") 
	} // End ElseIf.
	return objXMLHttp 
	} 

function mainprodplus(T,cqty)
{
	v=parseInt(T.value);
 	if (isNaN(v))
 		v=0;
	T.value=v 
 	v++;
	if (v>cqty)
	{
		v=cqty;
	}
	T.value=v;
}

function mainprodminus(T,cqty)
{
	v=parseInt(T.value);
	
	if (isNaN(v))
		v=0;
	v--;
	
	if (v<1)
	{
		v=0;
	}
	T.value=v;
}

function normalplus(cT)
{
	v=parseInt(cT.value);
 	if (isNaN(v))
 		v=0;
	cT.value=v 
 	v++;


	cT.value=v;
}

function normalminus(cT)
{
	v=parseInt(cT.value);
	
	if (isNaN(v))
		v=0;
	v--;
	
	if (v<2)
	{
		v=1;
	}
	cT.value=v;
}


 function statessProgressBarext()
{
	document.getElementById("AjxCartQty").innerHTML = "<img src='images/loading.gif' border='0' >";	

}

function viewCartTbl(uId,RtCtrQty,RtStckCode,cartWork,selcProdId,delAttribIds){

 // stateProgressBarext();
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.
//addreduce
	var url= js_http_path +"ajx_right_cart.php?uId="+uId + "&RtCtrQty=" + RtCtrQty + "&RtStckCode=" + RtStckCode + "&cartWork=" + cartWork  + "&selcProdId=" + selcProdId + "&delAttribIds=" + delAttribIds  
	//alert(url);
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var viewresptxt = xmlHttp.responseText
			//alert(viewresptxt);
			var viewresptxt_arr = viewresptxt.split('::');
			document.getElementById("AjxCartQty").innerHTML = viewresptxt_arr[0];
		} 
	};
	xmlHttp.send(null); 
//	alert('Product added to cart');

}

function addtocartQty(prodId,hidvalids,uids,printId){
//alert(hidvalids);
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.
	var param = "prodId=" + prodId + "&hidvalids=" + hidvalids 
	var url=js_http_path +"ajx_add_cart.php?prodId=" + prodId + "&hidvalids=" + hidvalids 


	xmlHttp.open("POST", js_http_path +"ajx_add_cart.php", true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", param.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var resptxt = xmlHttp.responseText
			var resptxt_arr = resptxt.split('::');

			document.getElementById("ajaxPriceTable").innerHTML = resptxt_arr[0];
		//	document.getElementById("ajaxProdNotMsg").innerHTML = resptxt_arr[1];

		} 
	};
	xmlHttp.send(param);
viewCartTbl(uids);
}

// Related product End 
function addtoRelatedProdcartQty(relprodId,hidvalRelids,uids,Relcat_prodId,RelselcStyleId,RelselcProdId,RelselcColorId){
//alert(hidvalids);
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.
	var param2 = "relprodId=" + relprodId + "&hidvalRelids=" + hidvalRelids + "&uids=" + uids + "&Relcat_prodId=" + Relcat_prodId + "&RelselcStyleId=" + RelselcStyleId + "&RelselcProdId=" + RelselcProdId + "&RelselcColorId=" + RelselcColorId
	//var url="ajx_add_cart.php?prodId=" + prodId + "&hidvalids=" + hidvalids 

	xmlHttp.open("POST", js_http_path +"ajx_relate_product_cart.php", true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", param2.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			
			var resptxt_relat = xmlHttp.responseText
			var resptxt_arr_relat = resptxt_relat.split('::');
		
			document.getElementById("ajaxRelateProductTable").innerHTML = resptxt_arr_relat[0];
	//		document.getElementById("ajaxProdNotMsg").innerHTML = resptxt_arr_relat[1];

		} 
	};
	xmlHttp.send(param2);
viewCartTbl(uids);
	
}

function addtoAlsoProdcartQty(alsoprodId,hidvalAlsoids,uids,cat_prodId,selcStyleId,selcProdId,selcColorId){

	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.
	var param1 = "alsoprodId=" + alsoprodId + "&hidvalAlsoids=" + hidvalAlsoids + "&uids=" + uids + "&cat_prodId=" + cat_prodId + "&selcStyleId=" + selcStyleId + "&selcProdId=" + selcProdId + "&selcColorId=" + selcColorId
	//var url="ajx_add_cart.php?prodId=" + prodId + "&hidvalids=" + hidvalids 

	xmlHttp.open("POST", js_http_path +"ajx_alsoproduct_cart.php", true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", param1.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			
			var resptxt_also = xmlHttp.responseText
			var resptxt_arr_Alos = resptxt_also.split('::');
	
			document.getElementById("ajaxAlsoProductTable").innerHTML = resptxt_arr_Alos[0];
	//		document.getElementById("ajaxProdNotMsg").innerHTML = resptxt_arr_Alos[1];
		} 
	};
	xmlHttp.send(param1);
viewCartTbl(uids);
	
}

function addPromoCartQty(alsoprodId,hidvalAlsoids,uids,promoGetId,selcStyleId,selcProdId,selcColorId){

	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.
	var param2 = "alsoprodId=" + alsoprodId + "&hidvalAlsoids=" + hidvalAlsoids + "&uids=" + uids + "&promoGetId=" + promoGetId + "&selcStyleId=" + selcStyleId + "&selcProdId=" + selcProdId + "&selcColorId=" + selcColorId
	//var url="ajx_add_cart.php?prodId=" + prodId + "&hidvalids=" + hidvalids 

	xmlHttp.open("POST", js_http_path +"ajx-promo-offer.php", true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", param2.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			
			var resptxt_promo = xmlHttp.responseText
			var resptxt_arr_promo = resptxt_promo.split('::');
	
			document.getElementById("ajaxPromoTable").innerHTML = resptxt_arr_promo[0];
	//		document.getElementById("ajaxProdNotMsg").innerHTML = resptxt_arr_Alos[1];


		} 
	};
	xmlHttp.send(param2);

	
}

function subscriber_null()
{
	frm=document.newsLatter;
	if(frm.NewsEmail.value=='')
	{
		alert('Please Enter Email Address');
		frm.NewsEmail.focus();
		return false;
	}
	if(frm.NewsEmail.value!="")
	{
		var str = frm.NewsEmail.value;
		var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
		var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
		if (!reg1.test(str) && reg2.test(str)){ // if syntax is valid
		   //return true;
		}else{
		alert ("Please Enter Proper Email Address");
		frm.NewsEmail.focus();
		return false;
		}
	}

	return true;

}

function chk_BsktEmail_Null()
{
	frm=document.frmbsktCrt;
	if(frm.basketEmailAdrr.value=='')
	{
		alert('Please Enter Email Address');
		frm.basketEmailAdrr.focus();
		return false;
	}
	if(frm.basketEmailAdrr.value!="")
	{
		var str = frm.basketEmailAdrr.value;
		var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
		var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
		if (!reg1.test(str) && reg2.test(str)){ // if syntax is valid
		   //return true;
		}else{
		alert ("Please Enter Proper Email Address");
		frm.basketEmailAdrr.focus();
		return false;
		}
	}

	return true;

}

function chkloginfrm()
{
var frm=document.login;

if(frm.fuser.value=="")
{
	alert('Please enter Email');
	frm.fuser.focus();
	return false;
}
if(frm.fuser.value!="")
{
	var str = frm.fuser.value;
	var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
	var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
	if (!reg1.test(str) && reg2.test(str)){ // if syntax is valid
	   //return true;
	}else{
	alert ("Please Enter Proper Email Address");
	frm.fuser.focus();
	return false;
	}
}
if(frm.fpass.value=='')
{
	alert('Please Enter Password');
	frm.fpass.focus();
	return false;
}
return true;
}

function chkforgotfrm()
{
frm=document.forgot;

if(frm.forgotEmail.value=="")
{
	alert('Please enter Email');
	frm.forgotEmail.focus();
	return false;
}
if(frm.forgotEmail.value!="")
{
	var str = frm.forgotEmail.value;
	var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
	var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
	if (!reg1.test(str) && reg2.test(str)){ // if syntax is valid
	   //return true;
	}else{
	alert ("Please Enter Proper Email Address");
	frm.forgotEmail.focus();
	return false;
	}
}

return true;
}


function check_registernull()
{
	frm = document.registerForm;

	var iChars = ",";

	valPostcode=/^[a-z][a-z]?\d[a-z0-9]?[ -]*\d[ ]*[a-z]{2}$/ig;
	valPhone=/^\(?[\d -]*\)?[\d -]+$/ig;
	valEmail=/^[a-z0-9][\w-_\.]*[a-z0-9]@[a-z0-9][\w-_\.]*\.[a-z]{2,4}$/ig;
	

	if(frm.email.value=="")
	{
		alert('Please enter Email');
		frm.email.focus();
		return false;
	}
	if(frm.email.value!="")
	{
		var str = frm.email.value;
		var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
		var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
		if (!reg1.test(str) && reg2.test(str)){ // if syntax is valid
		   //return true;
		}else{
		alert ("Please Enter Proper Email Address");
		frm.email.focus();
		return false;
		}
	}
	if(frm.reEmail.value=="")
	{
		alert('Please Re-type your Email Address');
		frm.reEmail.focus();
		return false;
	}
	if(frm.reEmail.value!="")
	{
		var str = frm.reEmail.value;
		var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
		var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
		if (!reg1.test(str) && reg2.test(str)){ // if syntax is valid
		   //return true;
		}else{
		alert ("Re-type your Email Address not correctly");
		frm.reEmail.focus();
		return false;
		}
	}
	if(frm.email.value!=frm.reEmail.value)
	{
		alert('Re-type your Email not correctly');
		frm.email.focus();
		return false;
	}	
	for (var q = 0; q < frm.email.value.length; q++) {
		if (iChars.indexOf(frm.email.value.charAt(q)) != -1) {
			alert ("The box has special characters like: , \nThese are not allowed.\n");
			frm.email.focus();
			return false;
		}
	}	

	if(frm.fpass.value=="")
	{
		alert('Please enter Password');
		frm.fpass.focus();
		return false;
	}
	for (var i = 0; i < frm.fpass.value.length; i++) {
		if (iChars.indexOf(frm.fpass.value.charAt(i)) != -1) {
			alert ("The box has special characters like: , \nThese are not allowed.\n");
			frm.fpass.focus();
			return false;
		}
	}
	

	var control = frm.fpass;
    var myString= control.value; 
	var invalid = " "; // Invalid character is a space
	var minLength = 6; // Minimum length
	var maxLength = 10; // Minimum length
	var ValidateSpChar = /[a-zA-Z0-9]/g;
	var specialString = myString.replace(ValidateSpChar, "");
	
  /* if(specialString < 1)
   {
	   alert("Passwords must include at least 1 special characters");
	   control.value="";
	   control.focus();
	   return false;
   }
*/
	// check for minimum length
	if (frm.fpass.value.length < minLength) {
		alert('Your password must be at least ' + minLength + ' characters long.');
			frm.fpass.focus();
		return false;
	}
	// check for maximum length
	if (frm.fpass.value.length > maxLength) {
		alert('Your password must be below ' + maxLength + ' characters.');
			frm.fpass.focus();
		return false;
	}


	// check for spaces
	if (frm.fpass.value.indexOf(invalid) > -1) {
		alert("Sorry, spaces are not allowed.");
		frm.fpass.focus();
		return false;
	}
	
	if(frm.RefPass.value=="")
	{
		alert('Please Re-type your Password');
		frm.RefPass.focus();
		return false;
	}
	if(frm.fpass.value!=frm.RefPass.value)
	{
		alert('Re-type your Password not correctly');
		frm.fpass.focus();
		return false;
	}	

	if(frm.fName.value=="")
	{
		alert('Please enter your First Name');
		frm.fName.focus();
		return false;
	}
	for (var j = 0; j < frm.fName.value.length; j++) {
		if (iChars.indexOf(frm.fName.value.charAt(j)) != -1) {
			alert ("The box has special characters like: , \nThese are not allowed.\n");
			frm.fName.focus();
			return false;
		}
	}

	if(frm.lName.value=="")
	{
		alert('Please enter your Last Name');
		frm.lName.focus();
		return false;
	}	

	for (var m = 0; m < frm.lName.value.length; m++) {
		if (iChars.indexOf(frm.lName.value.charAt(m)) != -1) {
			alert ("The box has special characters like: , \nThese are not allowed.\n");
			frm.lName.focus();
			return false;
		}
	}	

	if(frm.phoneNum.value=="")
	{
		alert('Please enter your Land line phone number');
		frm.phoneNum.focus();
		return false;
	}
	for (var p = 0; p < frm.phoneNum.value.length; p++) {
		if (iChars.indexOf(frm.phoneNum.value.charAt(p)) != -1) {
			alert ("The box has special characters like: , \nThese are not allowed.\n");
			frm.phoneNum.focus();
			return false;
		}
	}	
	
	for (var v = 0; v < frm.mobileNum.value.length; v++) {
		if (iChars.indexOf(frm.mobileNum.value.charAt(v)) != -1) {
			alert ("The box has special characters like: , \nThese are not allowed.\n");
			frm.mobileNum.focus();
			return false;
		}
	}	
	if(frm.addr1.value=="")
	{
		alert('Please enter your Address Line');
		frm.addr1.focus();
		return false;
	}	
	for (var z = 0; z < frm.addr1.value.length; z++) {
		if (iChars.indexOf(frm.addr1.value.charAt(z)) != -1) {
			alert("The box has special characters like: , \nThese are not allowed.\n");
			frm.addr1.focus();
			return false;
		}
	}		

	for (var r = 0; r < frm.addr2.value.length; r++) {
		if (iChars.indexOf(frm.addr2.value.charAt(r)) != -1) {
			alert("The box has special characters like: , \nThese are not allowed.\n");
			frm.addr2.focus();
			return false;
		}
	}	

	if(frm.twnCity.value=="")
	{
		alert('Please enter your Town / City');
		frm.twnCity.focus();
		return false;
	}	

	for (var x = 0; x < frm.twnCity.value.length; x++) {
		if (iChars.indexOf(frm.twnCity.value.charAt(x)) != -1) {
			alert("The box has special characters like: , \nThese are not allowed.\n");
			frm.twnCity.focus();
			return false;
		}
	}	

	if(frm.state.value=="")
	{
		alert('Please enter your County');
		frm.state.focus();
		return false;
	}	

	for (var s = 0; s < frm.state.value.length; s++) {
		if (iChars.indexOf(frm.state.value.charAt(s)) != -1) {
			alert("The box has special characters like: , \nThese are not allowed.\n");
			frm.state.focus();
			return false;
		}
	}		

	if(frm.zipCode.value=="")
	{
		alert('Please enter your Post code');
		frm.zipCode.focus();
		return false;
	}	
	for (var y = 0; y < frm.zipCode.value.length; y++) {
		if (iChars.indexOf(frm.zipCode.value.charAt(y)) != -1) {
			alert("The box has special characters like: , \nThese are not allowed.\n");
			frm.zipCode.focus();
			return false;
		}
	}	

	if(frm.termscond.checked == false)
	{
		alert('You must agree our Terms and Condition');
		frm.termscond.focus();
		return false;
	}	

	return true;

}


function check_editAccNull()
{
	frm = document.myaccountForm;
	
	if(frm.Mname.value=="")
	{
		alert('Please enter your full name');
		frm.Mname.focus();
		return false;
	}
	if(frm.phone.value=="")
	{
		alert('Please enter your phone number');
		frm.phone.focus();
		return false;
	}
	if(frm.email.value=="")
	{
		alert('Please enter Email');
		frm.email.focus();
		return false;
	}
	if(frm.email.value!="")
	{
		var str = frm.email.value;
		var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
		var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
		if (!reg1.test(str) && reg2.test(str)){ // if syntax is valid
		   //return true;
		}else{
		alert ("Please Enter Proper Email Address");
		frm.email.focus();
		return false;
		}
	}

	if(frm.pass.value=="")
	{
		alert('Please enter Password');
		frm.pass.focus();
		return false;
	}
	return true;
}
function showhideAlsoProd(viewId,selcdesc) {
	
	if (viewId =='1') { 
		selcdesc.style.display = ''; 	
	}else if(viewId =='2') {
		selcdesc.style.display = ''; 	
	}else { 
		selcdesc.style.display = 'none'; 	
	}
}
function showhideReltProd(viewId,selcdesc) {
	
	if (viewId =='1') { 
		selcdesc.style.display = ''; 	
	}else if(viewId =='2') {
		selcdesc.style.display = ''; 	
	}else { 
		selcdesc.style.display = 'none'; 	
	}
}
function showhideTopProd(viewId,selcdesc) {
	
	if (viewId =='1') { 
		selcdesc.style.display = ''; 	
	}else{ 
		selcdesc.style.display = 'none'; 	
	}
}

function viewSponcerCat(catsponcer)
{
	if (catsponcer == "4")
	{
		document.getElementById('tblview_text').style.display="";
		document.getElementById('upldimg4').style.display="none";
	}
	else if (catsponcer == "5")
	{
		document.getElementById('upldimg4').style.display="";
		document.getElementById('tblview_text').style.display="none";
	}
	else if (catsponcer == "22")
	{
		document.getElementById('upldimg4').style.display="";
		document.getElementById('tblview_text').style.display="none";
	}else{
		document.getElementById('upldimg4').style.display="none";
		document.getElementById('tblview_text').style.display="none";
	}
	
}
function locDropDown(selcDrop,selcLocId,selcColId,catIds,selcProdId){
//alert(selcColId);
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.

	var url=js_http_path +"ajx_person_drop.php?selcDrop="+selcDrop + "&selcLocId=" + selcLocId + "&selcColId=" + selcColId  + "&catIds=" + catIds   + "&selcProdId=" + selcProdId 
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var respdrop = xmlHttp.responseText
			
			if(catIds =='1'){
				
				document.getElementById("personDrop1").innerHTML = respdrop;
			}
			if(catIds =='2'){
				document.getElementById("personDrop2").innerHTML = respdrop;
			}
			if(catIds =='3'){

				document.getElementById("personDrop3").innerHTML = respdrop;
				
			}if(catIds =='4'){
		
				document.getElementById("personDrop4").innerHTML = respdrop;
			
			}if(catIds =='5'){
			
				document.getElementById("personDrop5").innerHTML = respdrop;
			}
			if(catIds =='6'){
			
				document.getElementById("personDrop6").innerHTML = respdrop;
			}
			if(catIds =='7'){
				document.getElementById("personDrop7").innerHTML = respdrop;
			}
			if(catIds =='8'){
			
				document.getElementById("personDrop8").innerHTML = respdrop;
			}
			if(catIds =='9'){
			
				document.getElementById("personDrop9").innerHTML = respdrop;
			}
			if(catIds =='10'){
			
				document.getElementById("personDrop10").innerHTML = respdrop;
			}
			if(catIds =='15'){
			
				document.getElementById("personDrop15").innerHTML = respdrop;
			}
			if(catIds =='16'){
			
				document.getElementById("personDrop16").innerHTML = respdrop;
			}
			} 
	};
	xmlHttp.send(null); 

}



// Main List //
function getcartaddelem(findelem, hiddenelem){
	
	var hiddenval = '';
	element_len = document.form1.elements.length;
	for (i=0; i<element_len; i++){
		this_element = document.form1.elements[i]; 
		if (this_element.type == 'text'  && this_element.name.match(findelem)){
			var stockcodearr = this_element.name.split('_');
			if(hiddenval == '')
				hiddenval = this_element.value+'#'+stockcodearr[2]+'#'+stockcodearr[3]+'#'+stockcodearr[4];
			else
				hiddenval = hiddenval + '@' + this_element.value+'#'+stockcodearr[2]+'#'+stockcodearr[3]+'#'+stockcodearr[4];
		}
	}
	//alert(hiddenval);
	hiddenelem.value = hiddenval;
}

// Also list start//

function getcartAlsoaddelem(findelem, hiddenelemAlso){
	
	var hiddenval_A = '';
	var element_lenalso = document.form2.elements.length;

	for (m=0; m<element_lenalso; m++){
		var this_element_also = document.form2.elements[m]; 

		if (this_element_also.type == 'text' && this_element_also.value > 0 && this_element_also.name.match(findelem)){
			var stockcodearr_a = this_element_also.name.split('_');
			if(hiddenval_A == '')
				hiddenval_A = this_element_also.value+'#'+stockcodearr_a[2]+'#'+stockcodearr_a[3]+'#'+stockcodearr_a[4];
			else
				hiddenval_A = hiddenval_A + '@' + this_element_also.value+'#'+stockcodearr_a[2]+'#'+stockcodearr_a[3]+'#'+stockcodearr_a[4];
		}
	}
	//alert(hiddenval);
	hiddenelemAlso.value = hiddenval_A;
}

// Relate list start//
// Also list start//

function getcartFreeAddelem(findelem, hiddenelemAlso){
	
	var hiddenval_A = '';
	var element_lenalso = document.form2.elements.length;

	for (m=0; m<element_lenalso; m++){
		var this_element_also = document.form2.elements[m]; 

		if (this_element_also.type == 'text' && this_element_also.name.match(findelem)){
			var stockcodearr_a = this_element_also.name.split('_');
			if(hiddenval_A == '')
				hiddenval_A = this_element_also.value+'#'+stockcodearr_a[2]+'#'+stockcodearr_a[3]+'#'+stockcodearr_a[4];
			else
				hiddenval_A = hiddenval_A + '@' + this_element_also.value+'#'+stockcodearr_a[2]+'#'+stockcodearr_a[3]+'#'+stockcodearr_a[4];
		}
	}
	//alert(hiddenval);
	hiddenelemAlso.value = hiddenval_A;
}

// Relate list start//
function getcartReladdelem(findelem, hiddenelemRel){
	
	var hiddenval_R = '';
	var element_lenRel = document.form3.elements.length;

	for (r=0; r<element_lenRel; r++){
		var this_element_Rel = document.form3.elements[r]; 

		if (this_element_Rel.type == 'text' && this_element_Rel.value > 0 && this_element_Rel.name.match(findelem)){
			var stockcodearr_R = this_element_Rel.name.split('_');
			if(hiddenval_R == '')
				hiddenval_R = this_element_Rel.value+'#'+stockcodearr_R[2]+'#'+stockcodearr_R[3]+'#'+stockcodearr_R[4];
			else
				hiddenval_R = hiddenval_R + '@' + this_element_Rel.value+'#'+stockcodearr_R[2]+'#'+stockcodearr_R[3]+'#'+stockcodearr_R[4];
		}
	}
	//alert(hiddenval);
	hiddenelemRel.value = hiddenval_R;
}

function validate_signup(frm) {
	var emailAddress = frm.Email.value;
	var errorString = '';
	if (emailAddress == '' || emailAddress.indexOf('@') == -1) {
		errorString = 'Please enter your email address';
	}

    

	var isError = false;
    if (errorString.length > 0)
        isError = true;

    if (isError)
        alert(errorString);
	return !isError;
}

// Cat Page List //
function getCatAddelem(findelem, hiddenelem){
	
	var hiddenval_cat = '';
	var element_len_cat = document.formcat1.elements.length;
	for (i=0; i<element_len_cat; i++){
		this_element_cat = document.formcat1.elements[i]; 
		if (this_element_cat.type == 'text' && this_element_cat.value > 0 && this_element_cat.name.match(findelem)){
			var stockcode_catarr = this_element_cat.name.split('_');
			if(hiddenval_cat == '')
				hiddenval_cat = this_element_cat.value+'#'+stockcode_catarr[2]+'#'+stockcode_catarr[3]+'#'+stockcode_catarr[4];
			else
				hiddenval_cat = hiddenval_cat + '@' + this_element_cat.value+'#'+stockcode_catarr[2]+'#'+stockcode_catarr[3]+'#'+stockcode_catarr[4];
		}
	}
	//alert(hiddenval);
	hiddenelem.value = hiddenval_cat;
}
function showhidePersoncat(clickid) {
//	alert(clickid);
	if (clickid =='1') { 
		document.getElementById('personAjxCats').style.display="";
	}else { 
		document.getElementById('personAjxCats').style.display="none";
	}
}


function viewprintLargeNum(printId,prodcutId,frmPage){

	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.

	var url=js_http_path +"ajx_personlis_lrgNum.php?printId="+printId + "&prodcutId=" + prodcutId + "&frmPage=" + frmPage  
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var name_resptxt = xmlHttp.responseText
			var name_resptxt_arr = name_resptxt.split('::');
			document.getElementById("LargeNumPersonal").innerHTML = name_resptxt_arr[0];
		} 
	};
	xmlHttp.send(null); 
}

function ViewGoalkeeperGlove(printId,prodcutId,frmPage){

	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.

	var url=js_http_path +"ajx_GoalkeeperGlove.php?printId="+printId + "&prodcutId=" + prodcutId + "&frmPage=" + frmPage  
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var name_Keeptxt = xmlHttp.responseText
			var name_respKeeptxt_arr = name_Keeptxt.split('::');
			document.getElementById("GoalkeepGlvAjxId").innerHTML = name_respKeeptxt_arr[0];
		} 
	};
	xmlHttp.send(null); 
}


function viewprintSmallnum(printId,prodcutId,frmPage){

	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.

	var url=js_http_path +"ajx_personlis_SmallNum.php?printId="+printId + "&prodcutId=" + prodcutId + "&frmPage=" + frmPage 
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var small_resptxt = xmlHttp.responseText
			var small_resptxt_arr = small_resptxt.split('::');
			document.getElementById("SmallNumPersonal").innerHTML = small_resptxt_arr[0];
		} 
	};
	xmlHttp.send(null); 
}

function viewprintSponsor(printId,prodcutId,selcStyleCat,frmPage){
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.
	
	var url=js_http_path +"ajx_sponcer_name.php?printId="+printId + "&prodcutId=" + prodcutId + "&selcStyleCat=" + selcStyleCat + "&frmPage=" + frmPage 
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var nameresptxt = xmlHttp.responseText
			var nameresptxt_arr = nameresptxt.split('::');
			document.getElementById("SponsorPersonalization").innerHTML = nameresptxt_arr[0];
		} 
	};
	xmlHttp.send(null); 

	if(selcStyleCat){
		
		viewInnerSponcer(selcStyleCat,prodcutId);
	}

}

function viewprintClubBadge(printId,prodcutId,selcStyleCat,frmPage){
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.

	var url=js_http_path +"ajx_club_badge.php?printId="+printId + "&prodcutId=" + prodcutId + "&frmPage=" + frmPage 
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var clbBdgresptxt = xmlHttp.responseText
			var clbBdgresptxt_arr = clbBdgresptxt.split('::');
			document.getElementById("clubBdgPersonalization").innerHTML = clbBdgresptxt_arr[0];
		} 
	};
	xmlHttp.send(null); 
	if(selcStyleCat){
		viewInnerClubBadge(selcStyleCat,prodcutId);
	}
}



function viewprintFAbadge(printId,prodcutId,frmPage){
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.

	var url=js_http_path +"ajx_FA_badge.php?printId="+printId + "&prodcutId=" + prodcutId + "&frmPage=" + frmPage 
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var FABdgresptxt = xmlHttp.responseText
			var FABdgresptxt_arr = FABdgresptxt.split('::');
			document.getElementById("FABdgPersonalization").innerHTML = FABdgresptxt_arr[0];
		} 
	};
	xmlHttp.send(null); 
}


function viewprintClubName(printId,prodcutId,frmPage){
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.

	var url=js_http_path +"ajx_clubName.php?printId="+printId + "&prodcutId=" + prodcutId  + "&frmPage=" + frmPage 
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var clubNameresptxt = xmlHttp.responseText
			var clubNameresptxt_arr = clubNameresptxt.split('::');
			document.getElementById("ClubNamePersonalization").innerHTML = clubNameresptxt_arr[0];
		} 
	};
	xmlHttp.send(null); 
}

function viewprintPlayerName(printId,prodcutId,frmPage){
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.

	var url=js_http_path +"ajx_playerName.php?printId="+printId + "&prodcutId=" + prodcutId   + "&frmPage=" + frmPage 
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var playerNameresptxt = xmlHttp.responseText
			document.getElementById("PlayerNamePersonalization").innerHTML =playerNameresptxt;
		} 
	};
	xmlHttp.send(null); 
}

function viewprintInitials(printId,prodcutId,frmPage){
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.

	var url=js_http_path +"ajx_Initials.php?printId="+printId + "&prodcutId=" + prodcutId   + "&frmPage=" + frmPage 
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var initial_resptxt = xmlHttp.responseText
			var initialresptxt_arr = initial_resptxt.split('::');
			document.getElementById("InitialPersonalization").innerHTML = initialresptxt_arr[0];
		} 
	};
	xmlHttp.send(null); 
}

function viewprintEmproidTxt(printId,prodcutId,frmPage){
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.

	var url=js_http_path +"ajx_EmproidTxt.php?printId="+printId + "&prodcutId=" + prodcutId   + "&frmPage=" + frmPage
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var EmproidTxt_resptxt = xmlHttp.responseText
			var EmproidTxtresptxt_arr = EmproidTxt_resptxt.split('::');
			document.getElementById("EmproidTxtPrint").innerHTML = EmproidTxtresptxt_arr[0];
		} 
	};
	xmlHttp.send(null); 
}

function viewEmproidNames(printId,prodcutId,frmPage){
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.

	var url=js_http_path +"ajx_EmproidNames.php?printId="+printId + "&prodcutId=" + prodcutId  + "&frmPage=" + frmPage
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var EmproidNames_resptxt = xmlHttp.responseText

			document.getElementById("AjxEmproidNames").innerHTML = EmproidNames_resptxt;
		} 
	};
	xmlHttp.send(null); 
}


function viewprintEngraving(printId,prodcutId,frmPage){
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.

	var url=js_http_path +"ajx_Engraving.php?printId="+printId + "&prodcutId=" + prodcutId + "&frmPage=" + frmPage
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var Engravingresptxt = xmlHttp.responseText
			var Engravingresptxt_arr = Engravingresptxt.split('::');
			document.getElementById("PlayerNameEngraving").innerHTML = Engravingresptxt_arr[0];
		} 
	};
	xmlHttp.send(null); 
}


function viewUploadOpt(printId,prodcutId,selcStyleCat,frmPage){
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.

	var url=js_http_path +"ajx_UploadOpt.php?printId="+printId + "&prodcutId=" + prodcutId + "&frmPage=" + frmPage
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var uploadOptresptxt = xmlHttp.responseText
			document.getElementById("newUploadOpt").innerHTML = uploadOptresptxt;
		} 
	};
	xmlHttp.send(null); 
	if(selcStyleCat){
		viewInnerUploadOpt(selcStyleCat,prodcutId);
	}

}

function viewInnerUploadOpt(attribvId,prodcutId){
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.
	var url=js_http_path +"ajx_InnerUploadOpt.php?attribvId="+attribvId  + "&prodcutId=" + prodcutId 
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var innerUploadOptResptxt = xmlHttp.responseText
			document.getElementById("innerUploadOptn").innerHTML = innerUploadOptResptxt;
		} 
	};
	xmlHttp.send(null); 
}

function ViewTrophyCentre(printId,prodcutId,selcStyleCat,frmPage){
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.

	var url=js_http_path +"ajx_TrophyCentre.php?printId="+printId + "&prodcutId=" + prodcutId + "&frmPage=" + frmPage
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var TrophyCentreResptxt = xmlHttp.responseText
			document.getElementById("newTrophyCentre").innerHTML = TrophyCentreResptxt;
		} 
	};
	xmlHttp.send(null); 
	if(selcStyleCat){
		viewInnerTrophyCentre(selcStyleCat,prodcutId);
	}
}

function viewInnerTrophyCentre(attribvId,prodcutId){
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.
	var url=js_http_path +"ajx_InnerTrophy.php?attribvId="+attribvId  + "&prodcutId=" + prodcutId 
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var innerTrophyResptxt = xmlHttp.responseText
			document.getElementById("ajxIdinnerTrophy").innerHTML = innerTrophyResptxt;
		} 
	};
	xmlHttp.send(null); 
}


function ViewPitchTrophy(printId,prodcutId,selcStyleCat,frmPage){
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.

	var url=js_http_path +"ajx_PitchTrophy.php?printId="+printId + "&prodcutId=" + prodcutId + "&frmPage=" + frmPage
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var PitchTrophyResptxt = xmlHttp.responseText
			document.getElementById("newPitchTrophy").innerHTML = PitchTrophyResptxt;
		} 
	};
	xmlHttp.send(null); 
	if(selcStyleCat){
		viewInnerPitchTrophy(selcStyleCat,prodcutId);
	}
}

function viewInnerPitchTrophy(attribvId,prodcutId){
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.
	var url=js_http_path +"ajx_innerPitchTrophy.php?attribvId="+attribvId  + "&prodcutId=" + prodcutId 
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var innerPitchTrophyResptxt = xmlHttp.responseText
			document.getElementById("ajxIdPitchTrophy").innerHTML = innerPitchTrophyResptxt;
		} 
	};
	xmlHttp.send(null); 
}


function ViewShirtAllTrophy(printId,prodcutId,selcStyleCat,frmPage){
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.

	var url=js_http_path +"ajx_shirtAllTrophy.php?printId="+printId + "&prodcutId=" + prodcutId + "&frmPage=" + frmPage
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var shirtAllTrophyResptxt = xmlHttp.responseText
			document.getElementById("newAllShirtTrophy").innerHTML = shirtAllTrophyResptxt;
		} 
	};
	xmlHttp.send(null); 
}

function showhideOptions(clickImgId){
//	alert(clickImgId);
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.
if (clickImgId ==1) { 
		document.getElementById('catHideShow').style.display="";
	}else { 
		document.getElementById('catHideShow').style.display="none";
	}
	var url=js_http_path +"expandAjx.php?clickImgId="+clickImgId 
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var innerExpandTxt = xmlHttp.responseText
			document.getElementById("showHideOpt").innerHTML = innerExpandTxt;
		} 
	};


	xmlHttp.send(null); 
}
/*function showhideOptions(clickImg) {
//	alert(clickid);
	if (clickImg =='1') { 
		document.getElementById('catHide1').style.display="";
	}else { 
		document.getElementById('catHide1').style.display="none";
	}
}
*/
function viewInnerSponcer(attribvId,prodcutId){
	
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.
/*if (attribvId) { 
		document.getElementById('logo_hide_1').style.display="";
	}else { 
		document.getElementById('logo_hide_1').style.display="none";
	}*/
	var url=js_http_path +"ajx_InnerSponcer.php?attribvId="+attribvId + "&prodcutId=" + prodcutId 
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var innerSponcerResptxt = xmlHttp.responseText
			//alert(innerSponcerResptxt);
			var innerSpResptxt_arr = innerSponcerResptxt.split('::');
			document.getElementById("innerSponcer").innerHTML = innerSpResptxt_arr[0];
		} 
	};
	xmlHttp.send(null); 
}

function viewInnerClubBadge(attribvId,prodcutId){
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.
	var url=js_http_path +"ajx_InnerClubBadge.php?attribvId="+attribvId  + "&prodcutId=" + prodcutId 
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var innerClubBadgeResptxt = xmlHttp.responseText
			//alert(innerSponcerResptxt);
			var innerCBResptxt_arr = innerClubBadgeResptxt.split('::');
			document.getElementById("innerClubBadge").innerHTML = innerCBResptxt_arr[0];
		} 
	};
	xmlHttp.send(null); 
}


function viewPreviewTotPersonal(attribValId,prodcutId,attribId,ifYesNo){

	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.

	if(attribValId =='catType9_inn'){
		for (var i=0; i < document.form_perEmp.catType9.length; i++)
		   {
		   if (document.form_perEmp.catType9[i].checked)
			  {
			  attribValId = document.form_perEmp.catType9[i].value;
			  }
		   }
	}

	

	var url=js_http_path +"ajx_previewTot.php?attribValId="+ attribValId + "&prodcutId=" + prodcutId + "&attribId=" + attribId  + "&ifYesNo=" + ifYesNo 
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var previewTotResptxt = xmlHttp.responseText
			
			if(attribId =='1'){
				document.getElementById("ajxPreviewTot1").innerHTML = previewTotResptxt;
			}
			if(attribId =='2'){
				document.getElementById("ajxPreviewTot2").innerHTML = previewTotResptxt;
			}
			if(attribId =='3'){
				document.getElementById("ajxPreviewTot3").innerHTML = previewTotResptxt;
			}
			if(attribId =='4'){
				document.getElementById("ajxPreviewTot4").innerHTML = previewTotResptxt;
			}
			if(attribId =='5'){
				document.getElementById("ajxPreviewTot5").innerHTML = previewTotResptxt;
			}
			if(attribId =='6'){
				document.getElementById("ajxPreviewTot6").innerHTML = previewTotResptxt;
			}
			if(attribId =='7'){
				document.getElementById("ajxPreviewTot7").innerHTML = previewTotResptxt;
			}
			if(attribId =='8'){
				document.getElementById("ajxPreviewTot8").innerHTML = previewTotResptxt;
			}
			if(attribId =='9'){
				document.getElementById("ajxPreviewTot9").innerHTML = previewTotResptxt;
			}
			if(attribId =='10'){
				document.getElementById("ajxPreviewTot10").innerHTML = previewTotResptxt;
			}
			if(attribId =='11'){
				document.getElementById("ajxPreviewTot11").innerHTML = previewTotResptxt;
			}
			if(attribId =='12'){
				document.getElementById("ajxPreviewTot12").innerHTML = previewTotResptxt;
			}

			if(attribId =='13'){
				document.getElementById("ajxPreviewTot13").innerHTML = previewTotResptxt;
			}

			if(attribId =='14'){
				document.getElementById("ajxPreviewTot14").innerHTML = previewTotResptxt;
			}
			if(attribId =='15'){
				document.getElementById("ajxPreviewTot15").innerHTML = previewTotResptxt;
			}
			if(attribId =='16'){
				document.getElementById("ajxPreviewTot16").innerHTML = previewTotResptxt;
			}
		} 
	};
	xmlHttp.send(null); 
}
function windowopen(URL,widthwin,heightwin){
	 var screenH = screen.height;
	 var screenW = screen.width;
	 var fromLeft = parseInt((screenW-widthwin)/2);
	 var fromTop = parseInt((screenH-heightwin)/2);
	var newwin=window.open(URL,'invitation_guest_email','width='+widthwin+',height='+heightwin+',toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes,top='+fromTop+',left='+fromLeft)
	if(window.focus) newwin.focus();
}


function confirmSubmit(submitId,frmProdId,fromPage) {
//alert(frmProdId);
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.
	var url=js_http_path +"popup_design_opt.php?submitId="+submitId  + "&frmProdId=" + frmProdId  + "&fromPage=" + fromPage 
	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			window.location.reload()
		} 
	};
	xmlHttp.send(null); 
}

function showhideCustColorOpt(viewColId) {
	if(viewColId =='14') { 
		document.getElementById('custcolId').style.display="";
	}else{ 
		document.getElementById('custcolId').style.display="none";
	}
}
function showhideBkCustColorOpt(viewColId) {
	if(viewColId =='14') { 
		document.getElementById('custBkcolId').style.display="";
	}else{ 
		document.getElementById('custBkcolId').style.display="none";
	}
}
function showhideOutlnColorOpt(viewColId) {
	if(viewColId =='14') { 
		document.getElementById('custOutcolId').style.display="";
	}else{ 
		document.getElementById('custOutcolId').style.display="none";
	}
}

function viewlogo2back(viewBack) {
	if(viewBack =='1') { 
		document.getElementById('sponsBackcolId').style.display="";
	}else{ 
		document.getElementById('sponsBackcolId').style.display="none";
	}
}

function viewlogo2out(viewOut) {
	if(viewOut =='1') { 
		document.getElementById('sponsOutcolId').style.display="";
	}else{ 
		document.getElementById('sponsOutcolId').style.display="none";
	}
}
function switchpage(select) {
  var index;

  for(index=0; index<select.options.length; index++)
    if(select.options[index].selected)
      {
        if(select.options[index].value!="")
          window.location.href="detailconfirm.php?CntyCd="+select.options[index].value;
        break;
      }
}

function showReqClbImgTropySrt(viewImgVal) {
	if(viewImgVal =='1') { 
		document.getElementById('showClbBdgImg').style.display="";
	}else{ 
		document.getElementById('showClbBdgImg').style.display="none";
	}
}

function SponshowReqTropySrt(viewImgValSpn) {
	if(viewImgValSpn =='1') { 
		document.getElementById('showSponLogoImg').style.display="";
	}else{ 
		document.getElementById('showSponLogoImg').style.display="none";
	}
}

function show_confirm(confrMsg,changeMsgTxt)
{
	var r=confirm(confrMsg);
	if (r==true){
	}else{
		document.getElementById(changeMsgTxt).value="0";
	}
}
function chk_maxqty_ord(maxStock,changeMsgTxt)
{	
	var crntQty =document.getElementById(changeMsgTxt).value;
	crntQty  =parseInt(crntQty);
	maxStock =parseInt(maxStock);

	if(crntQty > maxStock){
		var newAlrtMsg= "Unfortunately there is only " + maxStock + " item remaining, please adjust your quantity";
		document.getElementById(changeMsgTxt).value=maxStock;
		alert(newAlrtMsg);
	}
}

function main_list_confirm(confrMsg,changePageLink)
{
	var r=confirm(confrMsg);
	if(r==true){
		window.location=changePageLink;
	}else{
	}
}


function applyPromotional(uId,promoCodeVal,SubTotal,frmPage,exprsDelver){

	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.

	var url= js_http_path +"ajx_Apply_Promo.php?uId="+uId + "&promoCode=" + promoCodeVal + "&frmPage=" + frmPage + "&Chk_newSubTotal=" + SubTotal + "&exprsDelver=" + exprsDelver

	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var PromoRespTxt = xmlHttp.responseText
			var PromoRespTxtArr = PromoRespTxt.split('::');
			var PromoRespTxtArr2 =PromoRespTxtArr[0];
			var PromoRespSussMsg =PromoRespTxtArr[2];

			if(PromoRespTxtArr[1] =="login"){
				window.location=js_http_path +"member_login.php?err=login";
				return false;
			}


	if(frmPage =="detailCnfrPg"){
		if(PromoRespSussMsg =='0'){
			if(PromoRespTxtArr[0] !=""){
				alert(PromoRespTxtArr2);
			}
		}
	}else{
			if(PromoRespTxtArr[0] !=""){
				alert(PromoRespTxtArr2);
			}
	}
		var locationObj = window.location;
		var redirctPromoLink = PromoRespTxtArr[1];
			if(redirctPromoLink !=""){
				window.location=js_http_path +redirctPromoLink;
				return false;

			}
//alert(frmPage);
			if(frmPage =="rtBskt"){
				viewCartTbl(uId);
			}else if(frmPage =="detailCnfrPg"){
				if(PromoRespTxtArr[0] ==""){
					window.location=js_http_path + "detailconfirm.php";
				}
			}else{
				window.location=js_http_path + "cart_list.php";
			}
	
		} 
	};
	xmlHttp.send(null); 
//	alert('Product added to cart');
}


function checkOutOrd(chkrefNum,curPath,mID,promoCode,exprsDelver,Chk_newSubTotal){
	
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.

  if(mID =='0'){
	  window.location.href = "{{http_path}}member_login.php?frmcrt=1";
  }else{
	  if(mID ==''){
		 window.location.href ="{{http_path}}member_login.php?frmcrt=1";
	  }else{
		 window.location.href ="{{http_path}}move_cart_list.php?gotoCheck=confr&checkRef=" + chkrefNum + "&promoCode=" + promoCode + "&exprsDelver=" + exprsDelver + "&Chk_newSubTotal=" + Chk_newSubTotal + "&frmRld=ysRd";
	  }
  }
}

function viewWebContent(seoURL,srtLP,srtHP,srtBrnd,selcDrop,page){
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.
//addreduce
	var url= js_http_path +"ajx_webcontent.php?seoURL="+seoURL +"&srtLP="+srtLP +"&srtHP="+srtHP +"&srtBrnd="+srtBrnd +"&selcDrop="+selcDrop +"&page="+page

	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var viewWebCnttxt = xmlHttp.responseText
			document.getElementById("AjxWebCont").innerHTML = viewWebCnttxt;
		} 
	};
	xmlHttp.send(null); 
}


function viewSearchList(SearchKey,srtLP,srtHP,srtBrnd,selcDrop,page){
	var xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null){ 
		alert ("Browser does not support HTTP Request") 
		return 
	} // End If.
//addreduce
	var url= js_http_path +"ajx_searchList.php?searchString="+SearchKey +"&srtLP="+srtLP +"&srtHP="+srtHP +"&srtBrnd="+srtBrnd +"&selcDrop="+selcDrop +"&page="+page

	xmlHttp.open("GET",url,true) 
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4) { 
			var viewWebCnttxt = xmlHttp.responseText
			document.getElementById("AjxSearchCont").innerHTML = viewWebCnttxt;
		} 
	};
	xmlHttp.send(null); 
}
