

function ajaxFunction(id,url) {
	var xmlHttp;
		try { 
			xmlHttp = new XMLHttpRequest();
		}
		catch (e) {
			try { 
				xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch (e) {
					try { 
						xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
					}catch (e) {
						alert("Your browser does not support AJAX!");
						return false;
					}
				}
			}
		xmlHttp.open("GET", url, true);
		xmlHttp.onreadystatechange = function() {
			if(xmlHttp.readyState==4) {
				var rad=document.getElementById(id); 
				rad.innerHTML = xmlHttp.responseText;
				rad.style.display="block";
			}else{
				var rad=document.getElementById(id); 
				rad.innerHTML = ' ';
			}
		}
		xmlHttp.send(null);
	}
function copy_billing_information(){
	var form=document.updateAccount;
	if(document.getElementById('billing_information').checked){
		form.shipping_user_first_name.value=form.billing_user_first_name.value;
		form.shipping_user_last_name.value=form.billing_user_last_name.value;
		form.shipping_user_address.value=form.billing_user_address.value;
		form.shipping_user_city.value=form.billing_user_city.value;
		form.shipping_user_state.value=form.billing_user_state.value;
		form.shipping_user_zip.value=form.billing_user_zip.value;
		form.shipping_user_country.value=form.billing_user_country.value;
		form.shipping_user_phone.value=form.billing_user_phone.value;
		form.shipping_user_fax.value=form.billing_user_fax.value;
	}
	else{
		form.shipping_user_first_name.value="";
		form.shipping_user_last_name.value="";
		form.shipping_user_address.value="";
		form.shipping_user_city.value="";
		form.shipping_user_state.value="";
		form.shipping_user_zip.value="";
		form.shipping_user_country.value="";
		form.shipping_user_phone.value="";
		form.shipping_user_fax.value="";
	}
	
}
function popsize(url)
{
	//var url="images/sizechart.jpg";
	var url="sizepopup.php";
	newwindow=window.open(url,'name','height=600,width=600,left=350,top=225,resizable=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}
function popupcolor()
{
	var url="popUpColor.php";
	newwindow=window.open(url,'name','height=400,width=530,left=394,top=200,resizable=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}
function popupcolorsubmit(code)
{
	window.opener.document.getElementById('line1_color').value=code;
	window.close();
}
function popupcolor1()
{
	var url="popUpColor1.php";
	newwindow=window.open(url,'name','height=400,width=530,left=394,top=200,resizable=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}
function popupcolorsubmit1(code)
{
	window.opener.document.getElementById('line2_color').value=code;
	window.close();
}
function popupcolor2()
{
	var url="popUpColor2.php";
	newwindow=window.open(url,'name','height=400,width=530,left=394,top=200,resizable=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}
function popupcolorsubmit2(code)
{
	window.opener.document.getElementById('line3_color').value=code;
	window.close();
}
function popnewsletter(url)
{
	
	var email=document.getElementById('email').value;
	var url="newsLetter.php?email="+email;
	newwindow=window.open(url,'name','height=200,width=410,left=294,top=375,resizable=no');
	if (window.focus) {newwindow.focus()}
}
function popupclose(){
	window.opener.location.href="addcategory.php";
self.close();
}
function switchDiv(divId) {
	divSection = document.getElementById(divId);
		if(divSection.style.display=="none")divSection.style.display = "";
		else divSection.style.display = "none";
}
function popUp(URL) {
window.open(URL,'Add Tag','toolbar=no,scrollbars=0,location=no,status=no,fullscreen=0,statusbar=no,menubar=no,resizable=0,left = 300,top = 300, width=370,height=180');
}
  function trimspaces(str)
		{
			while((str.indexOf(' ',0) == 0) && (str.length > 1))
			{
				str = str.substring(1, str.length);
			}
			while((str.lastIndexOf(' ') == (str.length - 1) && (str.length > 1)))
			{
				str = str.substring(0,(str.length - 1));
			}
			if((str.indexOf(' ',0) == 0) && (str.length == 1)) str = '';
			return str;
		}
		  
	function validate_emboidery(){
	//alert("hello");
	var line1= document.emboidery.line1_text.value;
	var line2= document.emboidery.line2_text.value;
	var line3= document.emboidery.line3_text.value;
	
	if(line1==''){
		if(line2!='' || line3!=''){
		alert("Please enter the text in line1 first");
		return false;
		}
	}
		
							
	}
	function validate_form(Obj)
		{
				
				var color_count=0;
				
				for ( i = 0; i < Obj.elements.length; i++) {
						formElem = Obj.elements[i];
							//alert(formElem.name);
							if(formElem.name=='password' && formElem.value!='' )
							{
								var password1=formElem.value;
							}
							
							if(formElem.name=='confirm_password' && formElem.value!='' )
							{
								var password2=formElem.value;	
								if(password1!=password2)
								{
									alert("Please Enter same Password in Confirm Password Field as in Password Field.");
									formElem.focus();
									return false;
								}
							}
							
							if(formElem.name=='new_password' && formElem.value!='' )
							{
								var password1=formElem.value;
							}
							
							if(formElem.name=='confirm_password' && formElem.value!='' )
							{
								var password2=formElem.value;	
								if(password1!=password2)
								{
									alert("Please Enter same Password in Confirm Password Field as in Password Field.");
									formElem.focus();
									return false;
								}
							}
							
							if(formElem.name=='pdf_file' && formElem.value!='' )
							{
								var pdf_file2=formElem.value;
							if(pdf_file2.lastIndexOf(".pdf")==-1) {
  								 alert("Please upload only .pdf extention file");
 								  return false;
							}
							}
							
						
							
						switch (formElem.type) {
								case 'text':
								case 'password':
								case 'select-one':
								case 'textarea':
								case 'select-multiple':
								case 'checkbox':
								case 'radio':
								case 'file':
										
										split_title=formElem.title.split("::");
										
										if(split_title[0]=='mandatory112' ){
											if(formElem.checked==true)
											{
													color_count=color_count+1;
											}
										}
										if(split_title[0]=='mandatory111' && trimspaces(formElem.value)=='' ){
											if(color_count==0)
											{
													alert(split_title[1]);
													formElem.focus();
													return false;
											}
										}
										else if(split_title[0]=='mandatory111' && trimspaces(formElem.value)!='' ){
											if(color_count>0)
											{
													alert(split_title[1]);
													formElem.focus();
													return false;
											}
										}
										
										
										if(split_title[0]=='Fill' && trimspaces(formElem.value)==''){
										alert(split_title[1]);
										formElem.focus();
										return false;
										}
										if(split_title[0]=='Fill2' && trimspaces(formElem.value)==''){
										alert(split_title[1]);
										formElem.focus();
										return false;
										}
										if(split_title[0]=='Fill2'  && isNaN(formElem.value)){
										alert('Please enter numeric value');
										formElem.focus();
										return false;
										}
										if(split_title[0]=='Fill2'  && parseInt(formElem.value)<=0){
										alert('Please enter positive value grater than zero');
										formElem.focus();
										return false;
										}
										
										
										
										if(split_title[0]=='Fill250'  && trimspaces(formElem.value)==''){
											alert(split_title[1]);
											formElem.focus();
											return false;
											}
										if(split_title[0]=='Fill250'  && formElem.value.length>250){
											alert('Your biodata length is max 250 charecter allowed.');
											formElem.focus();
											return false;
											}
											
											
										if(split_title[0]=='Quantity' && trimspaces(formElem.value)==''){
										alert(split_title[1]);
										formElem.focus();
										return false;
										}
										if(split_title[0]=='Quantity'  && isNaN(formElem.value)){
										alert('Please enter numeric value');
										formElem.focus();
										return false;
										}
										if(split_title[0]=='Quantity'  && parseInt(formElem.value)<0){
										alert('Please enter positive value grater than zero');
										formElem.focus();
										return false;
										}	
										if(split_title[0]=='FillPhone' ){
											if(trimspaces(formElem.value)=='')
											{
												alert(split_title[1]);
												formElem.focus();
												return false;
											}
											if (/^[0-9\-]{6,20}$/.test(formElem.value) ){
												}else{
													alert('Please enter valid phone number.');
													formElem.focus();
													return false;
											}
										}
											
										if(split_title[0]=='Fill3' && trimspaces(formElem.value)==''){
										alert(split_title[1]);
										formElem.focus();
										return false;
										}
										if(split_title[0]=='Fill3' ){
											if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(formElem.value)){
												}else{
													alert('Invalid E-mail Address! Please re-enter.');
													formElem.focus();
													return false;
											}
										}
										if(split_title[0]=='Fill4' && trimspaces(formElem.value)==''){
										alert(split_title[1]);
										formElem.focus();
										return false;
										}
										if(split_title[0]=='Fill4' ){
											if(formElem.value !='')
												{
													var strLength = formElem.value.length;
													var spaceindex = formElem.value.lastIndexOf(' ');
													if(strLength < 6)
													{
														alert("Please enter "+formElem.name+" atleast 6 characters.");
														formElem.focus();
														return false;
													}
													if(spaceindex!='-1')
													{
														alert("Please remove space from "+formElem.name+".");
														formElem.focus();
														return false;
													}
												}
										}
										if(split_title[0]=='Fill14' ){
											var type=document.getElementById('product_type').value;
											if(type!='accessories')
											{
												if(split_title[0]=='Fill14' && trimspaces(formElem.value)==''){
												alert(split_title[1]);
												formElem.focus();
												return false;	
												}
											}
										}
										
										if(split_title[0]=='Fill5' && trimspaces(formElem.value)==''){
										alert(split_title[1]);
										formElem.focus();
										return false;
										}
										if(split_title[0]=='Fill5' && !isNaN(formElem.value)){
										alert("Please enter only letter");
										formElem.focus();
										return false;
										}
										if(split_title[0]=='Fill6' && trimspaces(formElem.value)==''){
										alert(split_title[1]);
										formElem.focus();
										return false;
										}
										if(split_title[0]=='Fill6'  && isNaN(formElem.value)){
										alert('Please enter numeric value');
										formElem.focus();
										return false;
										}
										if(split_title[0]=='Fill6'  && parseInt(formElem.value)<0){
										alert('Please enter positive value');
										formElem.focus();
										return false;
										}
										if(split_title[0]=='FillC' && trimspaces(formElem.value)=='')
										{

											alert(split_title[1]);
											formElem.focus();
											return false;
										}
									/*	if(split_title[0]=='FillEm' && trimspaces(formElem.value)!='')
										{

											alert(split_title[1]);
											formElem.focus();
											return false;
										}*/
										
										if(split_title[0]=='FillImageM')
										{
											if(trimspaces(formElem.value)=='')
											{
												alert(split_title[1]);
												formElem.focus();
												return false;
											}
										}
										if(split_title[0]=='FillImageM')
										{
											
											if(trimspaces(formElem.value)!='')
											{
												if (/(.jpg|.jpeg|.gif|.png|.JPG|.JPEG|.GIF|.PNG)$/.test(formElem.value)){
												}else
												{
													alert("Please select valid format[.jpg|.jpeg|.gif|.png].");
													formElem.focus();
													return false;
												}
											}
										}
										if(split_title[0]=='Fill20')
										{
											if(formElem.checked == false)
											{
											alert(split_title[1]);
											formElem.focus();
											return false;
											}
										}
										
										if(split_title[0]=='Fill222' && trimspaces(formElem.value)==''){
										alert(split_title[1]);
										formElem.focus();
										return false;
										}
										if(split_title[0]=='Fill222' ){
										if(formElem.value !='')
												{
													var strLength = formElem.value.length;
													//var spaceindex = formElem.value.lastIndexOf(' ');
													if(strLength < 7)
													{
														alert("Please enter identity code of 7 characters.");
														formElem.focus();
														return false;
													}
													var myRegxp1 = /^[a-zA-Z]+$/;
													var myRegxp2 = /^[0-9]+$/;
													if(myRegxp1.test(formElem.value)==false && myRegxp2.test(formElem.value)==false)
													{
													}
													else
													{ 
														alert("Please enter alphabets and numeric both.");
														formElem.focus();
														return false;
													}

												}
										}
										
								break;
								}
						}//end of for loop
						
						return true;
		}
		
		function CheckAll(obj)
{
	var count = obj.elements.length;
	for (i=0; i < count; i++) 
	{
		if(obj.elements[i].type == 'checkbox')
			obj.elements[i].checked = obj.chkall.checked;
	}
}

function deleterecord(id,obj,group_name){
	var count = obj.elements.length;
	var flag=false;
	var msg = "";
	for (i=0; i < count; i++) 
	{
		if(obj.elements[i].type == 'checkbox')
		{
			if(obj.elements[i].value==id){
			obj.elements[i].checked =1;
			flag=true;
			}
		}
	}
	if(flag==true)
	{
		if(window.confirm("Are you sure to delete this record?\n"+msg))
		{
			obj.action.value='delete';
			obj.submit();
		}
	else
		{
			var count = obj.elements.length;
			for (i=0; i < count; i++) 
			{
					if(obj.elements[i].value==id)
						{
							obj.elements[i].checked =0;
							flag=false;
						}
			}
		}
	}
	}


function deletegrouprecord(id,obj,solution){
	var count = obj.elements.length;
	var flag=false;
	var msg = "";
	for (i=0; i < count; i++) 
	{
		if(obj.elements[i].type == 'checkbox')
		{
			if(obj.elements[i].value==id){
			obj.elements[i].checked =1;
			flag=true;
			}
		}
	}
	if(flag==true)
	{
		if(window.confirm("Are you sure to delete this record?\n"+msg))
		{
			obj.action.value='delete';
			obj.solution.value=solution;
			obj.submit();
		}
	else
		{
			var count = obj.elements.length;
			for (i=0; i < count; i++) 
			{
					if(obj.elements[i].value==id)
						{
							obj.elements[i].checked =0;
							flag=false;
						}
			}
		}
	}
	}
	
function doAction(action,obj,msgtype)
{
	var count = obj.elements.length;
	var flag=false;
	var msg = "";
	if(msgtype !='')
	{
		msg = msgtype;	
	}
	for (i=0; i < count; i++) 
	{
		if(obj.elements[i].type == 'checkbox')
		{
			if(obj.elements[i].checked == 1)
			flag=true;
		}
	}
	if(flag==true)
	{
		if(window.confirm("Are you sure to delete selected item(s)?"))
		{
			obj.action.value=action;
			obj.solution.value=msgtype;
			obj.submit();
		}
		else
		{
			var count = obj.elements.length;
			for (i=0; i < count; i++) 
			{
							obj.elements[i].checked =0;
							flag=false;
			}
			return false;
		}
	}
	else
	{
		alert("Please select at least one Record to perform the action.");
		return false;
	}
}

var r={
   'notnumbers':/[^\d\-]/g
}
function valid(o,w){
  o.value = o.value.replace(r[w],'');
}
var r1={
   'notnumbers':/[^\d\w\-]/g
}
function valid1(o,w){
  o.value = o.value.replace(r1[w],'');
}
function delete_record(id,msgtype)
{
	var count = document.adminForm.elements.length;
	var flag=false;
	var msg = "";
	//alert(msgtype);
	if(msgtype !='')
	{
		msg = msgtype;
	}
	for (i=0; i < count; i++) 
	{
		if(document.adminForm.elements[i].type == 'checkbox')
		{
			if(document.adminForm.elements[i].title==id){
			document.adminForm.elements[i].checked =1;
			flag=true;
			}
		}
	}
	if(flag==true)
	{
		if(window.confirm("Are you sure to delete "+msg))
		{
			document.adminForm.action.value='delete';
			document.adminForm.submit();
		}
	else
		{
			var count = document.adminForm.elements.length;
			for (i=0; i < count; i++) 
			{
					if(document.adminForm.elements[i].value==id)
						{
							document.adminForm.elements[i].checked =0;
							flag=false;
						}
			}
		}
	}
	
}

var n;
var p;
var p1;
function ValidatePhone(){
p=p1.value
if(p.length==3){
	pp=p;
	d5=p.indexOf('-')
	if(d5==-1){
		pp=pp+"-";
	}
	document.add_member.telephone.value="";
	document.add_member.telephone.value=pp;
}
if(p.length>3){
	d2=p.indexOf('-')
	if (d2==-1){
		l30=p.length;
		p30=p.substring(0,4);
		p30=p30+"-"
		p31=p.substring(4,l30);
		pp=p30+p31;
		document.add_member.telephone.value="";
		document.add_member.telephone.value=pp;
	}
	}
if(p.length>5){
	p11=p.substring(1,d2);
	if(p11.length>3){
	p12=p11;
	l12=p12.length;
	l15=p.length
	p13=p11.substring(0,3);
	p14=p11.substring(3,l12);
	p15=p.substring(d2+1,l15);
	document.add_member.telephone.value="";
	pp=p13+"-"+p14+p15;
	document.add_member.telephone.value=pp;
	}
	l16=p.length;
	p16=p.substring(d2+1,l16);
	l17=p16.length;
	if(l17>3&&p16.indexOf('-')==-1){
		p17=p.substring(d2+1,d2+4);
		p18=p.substring(d2+4,l16);
		p19=p.substring(0,d2+1);
	pp=p19+p17+"-"+p18;
	document.add_member.telephone.value="";
	document.add_member.telephone.value=pp;
	}
}
setTimeout(ValidatePhone,100)
}
function getIt(m){
n=m.name;
p1=m
ValidatePhone()
}
function testphone(obj1){
p=obj1.value
p=p.replace("-","")
p=p.replace("-","")
p=p.replace("-","")
//alert(isNaN(p))
if (isNaN(p)==true){
alert("Check phone");
return false;
}
}

var n11;
var p11;
var p111;

function ValidatePhone1(){
p11=p111.value
if(p11.length==3){
	pp11=p11;
	d511=p11.indexOf('-')
	if(d511==-1){
		pp11=pp11+"-";
	}
	document.add_member.fax.value="";
	document.add_member.fax.value=pp11;
}
if(p11.length>3){
	d211=p11.indexOf('-')
	if (d211==-1){
		l3011=p11.length;
		p3011=p11.substring(0,4);
		p3011=p3011+"-"
		p3111=p11.substring(4,l3011);
		pp11=p3011+p3111;
		document.add_member.fax.value="";
		document.add_member.fax.value=pp11;
	}
	}
if(p11.length>5){
	p1111=p11.substring(1,d211);
	if(p1111.length>3){
	p1211=p1111;
	l1211=p1211.length;
	l1511=p11.length
	p1311=p1111.substring(0,3);
	p1411=p1111.substring(3,l1211);
	p1511=p.substring(d211+1,l1511);
	document.add_member.fax.value="";
	pp11=p1311+"-"+p1411+p1511;
	document.add_member.fax.value=pp11;
	}
	l1611=p11.length;
	p1611=p11.substring(d211+1,l1611);
	l1711=p1611.length;
	if(l1711>3&&p1611.indexOf('-')==-1){
		p1711=p11.substring(d211+1,d211+4);
		p1811=p11.substring(d211+4,l1611);
		p1911=p11.substring(0,d211+1);
	pp11=p1911+p1711+"-"+p1811;
	document.add_member.fax.value="";
	document.add_member.fax.value=pp11;
	}
}
setTimeout(ValidatePhone1,100)
}
function getIt1(m11){
n11=m11.name;
p111=m11
ValidatePhone1()
}
function update_quantity(total_price_id,abri,row_id,qty,product_id,session)
{
		if(isNaN(qty) || qty<=0)
		{
				alert("Please enter integer quantity");
				//document.getElementById('quantity_'+row_id).value=qty;
		}
		else 
		{
				strSubmit='action=update';
				strSubmit=strSubmit+'&product_id='+product_id;
				strSubmit=strSubmit+'&order_id='+row_id;	
				strSubmit=strSubmit+'&quantity='+qty;
				strSubmit=strSubmit+'&sid='+session;
				loadXML(total_price_id,abri,row_id,strSubmit);	
				
		}
		
}
function update_price(total_size_id,size,product_id)
{
		
				strSubmit='action=sizeupdate';
				strSubmit=strSubmit+'&product_id='+product_id;
				strSubmit=strSubmit+'&size='+size;
				abri='';
				row_id='';
				loadXMLNEW(total_size_id,abri,row_id,strSubmit);	
}




function loadXMLNEW(total_price_id,abri,row_id,url){
		ActiveObject = false;
			  if(window.XMLHttpRequest) {
				try {
				  ActiveObject = new XMLHttpRequest();
					} catch(e) {
				  ActiveObject = false;
					}
			  }
			  else if(window.ActiveXObject)
			  {
					try {
					  ActiveObject = new ActiveXObject("Msxml2.XMLHTTP");
					} catch(e) {
					try {
					  ActiveObject = new ActiveXObject("Microsoft.XMLHTTP");
					} catch(e) {
					  //ActiveObject = false;
					}
					 }
			  }
			  if (!ActiveObject)
    			alert("Your browser does not support AJAX!");
			  if(ActiveObject) {
				ActiveObject.onreadystatechange = processReqajaxNEW;
				
				ActiveObject.open("POST", "ajax.php", true);
				ActiveObject.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
				ActiveObject.send(url);
			  }
		}
		
function loadXMLNEW_qty(url){
		ActiveObject = false;
			  if(window.XMLHttpRequest) {
				try {
				  ActiveObject = new XMLHttpRequest();
					} catch(e) {
				  ActiveObject = false;
					}
			  }
			  else if(window.ActiveXObject)
			  {
					try {
					  ActiveObject = new ActiveXObject("Msxml2.XMLHTTP");
					} catch(e) {
					try {
					  ActiveObject = new ActiveXObject("Microsoft.XMLHTTP");
					} catch(e) {
					  //ActiveObject = false;
					}
					 }
			  }
			  if (!ActiveObject)
    			alert("Your browser does not support AJAX!");
			  if(ActiveObject) {
				ActiveObject.onreadystatechange = processReqajaxNEW_qty;
				
				ActiveObject.open("POST", "ajax_qty.php", true);
				ActiveObject.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
				ActiveObject.send(url);
			  }
		}
		
		function loadXMLNEW_print_qty(url){
		
		ActiveObject = false;
			  if(window.XMLHttpRequest) {
				try {
				  ActiveObject = new XMLHttpRequest();
					} catch(e) {
				  ActiveObject = false;
					}
			  }
			  else if(window.ActiveXObject)
			  {
					try {
					  ActiveObject = new ActiveXObject("Msxml2.XMLHTTP");
					} catch(e) {
					try {
					  ActiveObject = new ActiveXObject("Microsoft.XMLHTTP");
					} catch(e) {
					  //ActiveObject = false;
					}
					 }
			  }
			  if (!ActiveObject)
    			alert("Your browser does not support AJAX!");
			  if(ActiveObject) {
				ActiveObject.onreadystatechange = processReqajaxNEW_qty;
				
				ActiveObject.open("POST", "ajax_print_qty.php", true);
				ActiveObject.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
				ActiveObject.send(url);
			  }
		}
		
		function processReqajaxNEW_qty()
		{
			 if (ActiveObject.readyState == 4 && ActiveObject.status == 200 && ActiveObject.responseText != null)
				{
					var data = ActiveObject.responseText;
					//alert(data);
					var splitdata=data.split("@##@");
					if(splitdata[0]=='no')
					{
						document.getElementById('quantity_ddl').style.display="none";
						document.getElementById('add-to-cart_yes').style.display="none";
						document.getElementById('add-to-cart_no').style.display="";
					}
					else if(splitdata[0]=='yes')
					{
						document.getElementById('quantity_ddl').style.display="";
						document.getElementById('add-to-cart_yes').style.display="";
						document.getElementById('add-to-cart_no').style.display="none";
						
						var show_html	=	"Select Quantity: <select name='quantity'>";
						for(var v=1;v<=splitdata[1];v++)
						{
							show_html	+=	"<option value='"+v+"'>"+v+"</option>";
						}
						show_html	+=	"</select>";
						//alert(show_html);
						document.getElementById('quantity_ddl').innerHTML=show_html;
					}
					if(splitdata[2]=='price')
							{
								var sizeprice="Your Price:<span class='rs'> $ "+splitdata[3]+"</span>";
									document.getElementById('sizeprice').innerHTML=sizeprice;
							}
				}else{			
					
				}
		}

			function processReqajaxNEW()
		{
			 if (ActiveObject.readyState == 4 && ActiveObject.status == 200 && ActiveObject.responseText != null)
				{
					var data = ActiveObject.responseText;
					//alert(data);
					var splitdata=data.split("@##@");
					if(splitdata[0]!='drop')
					var sizeprice="Your Price:<span class='rs'> $ "+splitdata[1]+"</span>";
					document.getElementById('sizeprice').innerHTML=sizeprice;
					
				}else{			
					
				}
		}
		
		
function loadXML(total_price_id,abri,row_id,url){
		ActiveObject = false;
			  if(window.XMLHttpRequest) {
				try {
				  ActiveObject = new XMLHttpRequest();
					} catch(e) {
				  ActiveObject = false;
					}
			  }
			  else if(window.ActiveXObject)
			  {
					try {
					  ActiveObject = new ActiveXObject("Msxml2.XMLHTTP");
					} catch(e) {
					try {
					  ActiveObject = new ActiveXObject("Microsoft.XMLHTTP");
					} catch(e) {
					  //ActiveObject = false;
					}
					 }
			  }
			  if (!ActiveObject)
    			alert("Your browser does not support AJAX!");
			  if(ActiveObject) {
				ActiveObject.onreadystatechange = processReqajax;
				
				ActiveObject.open("POST", "ajax.php", true);
				ActiveObject.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
				ActiveObject.send(url);
			  }
		}
			function processReqajax()
		{
			 if (ActiveObject.readyState == 4 && ActiveObject.status == 200 && ActiveObject.responseText != null)
				{
					var data = ActiveObject.responseText;
					//alert(data);
					var splitdata=data.split("@##@");
					//alert(splitdata[0]);
					if(splitdata[0]=='outofstack')
					{
						alert("Selected quantity is greater than available stock.");
						//alert(splitdata[1]);
						//alert(splitdata[2]);
						
						document.getElementById('quantity_'+splitdata[1]).focus();
						document.getElementById('quantity_'+splitdata[1]).select();
						
					}
					else
					{
						if(splitdata[0]!='drop')
						document.getElementById('price_'+splitdata[0]).innerHTML=splitdata[1];
						
						document.getElementById('shipping_price').innerHTML=splitdata[2];
						document.getElementById('tax_price').innerHTML=splitdata[3];
						document.getElementById('total_price').innerHTML=splitdata[4];
					}
				}else{			
					
				}
		}
function testphone1(obj2){
p11=obj2.value
p11=p11.replace("-","")
p11=p11.replace("-","")
p11=p11.replace("-","")
//alert(isNaN(p))
if (isNaN(p11)==true){
alert("Check phone");
return false;
}
}
