var MAX_ALLOWED=3;
var clickedData=new Array(false,false,false,false);
function itemsClicked(){var i=0;for(var j=0;j<clickedData.length;j++)i+=clickedData[j]?1:0;return(i);}
function itemClicked(_v)
{
  var ALLOW_THIS=true;
  var x=itemsClicked();
  if (x>=MAX_ALLOWED && !clickedData[_v])
  {
    ALLOW_THIS=false;
	alert('You may only vote for 3 brides.');

  }
  else
  {
    clickedData[_v]=clickedData[_v]?false:true;
	eval("document.brides.r"+_v+".clicked=false;");
  }
  return (ALLOW_THIS); /* kill the event handler */
  
}



function uncheck_own() 
{
		document.getElementById('own_quantity').value = "";
		document.getElementById('check_own_quantity').innerHTML = "";
}

function check_if_other() 
{
		var state = document.getElementById('suburb').value;
		show_other(state)	
}

function copy_delivery_info() 
{
	//var el = document.getElementById('same_info');
	//if (el.checked == true)
		//{
		var full_name = document.getElementById('contact_full_name').value;
		var email_address = document.getElementById('contact_email_address').value;
		var phone_number = document.getElementById('contact_phone_number').value;
		var cell_number = document.getElementById('contact_cell_number').value;

		document.getElementById('full_name').value = full_name;
		document.getElementById('email_address').value = email_address;
		document.getElementById('phone_number').value = phone_number;
		document.getElementById('cell_number').value = cell_number;	
	//	}
//	if (el.checked == false)
//		{
	//	document.getElementById('full_name').value = "";
	//	document.getElementById('email_address').value = "";
	//	document.getElementById('phone_number').value = "";
	//	document.getElementById('cell_number').value = "";	
	//	}
}


function clickChecked(id) 
{
	var el = document.getElementById(id);
	if (el.checked == false) el.checked = true;
	return;	  
}



function jumpto(x){

if (document.form1.jumpmenu.value != "null") {
	document.location.href = x
	}
}


function confirmDelete (id)
{
	var is_confirmed = confirm("Are you sure you want to delete your selection: " + id + " ?");
    if (is_confirmed) {
		return true;
	}
    else {
        window.focus();
		return false;
	}
}

function confirmSend (id)
{
	var is_confirmed = confirm("Are you sure you want to send to: " + id + " ?");
    if (is_confirmed) {
		return true;
	}
    else {
        window.focus();
		return false;
	}
}

function orderChange (id)
{
	var change_to = prompt("What do you want to change order number to:", "jj");
	this.location = "www.yahoo.com";
}



function checkUncheckAll(theElement) 
{
     var theForm = theElement.form, z = 0;
	 for(z=0; z<theForm.length;z++)
	 {
		  if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall')
		  {
		  theForm[z].checked = theElement.checked;
		  }
     }
}

function jumper(x)
	{
	document.location.href = x
	}

function load(url, h, w) {
var load = window.open(url ,'','scrollbars=no,menubar=no, height='+h+' , width='+w+' ,resizable=yes,toolbar=no,location=no,status=no');
}

function loadgallery(url, h, w) {
var load = window.open(url ,'','scrollbars=yes,menubar=no, height='+h+' , width='+w+' ,resizable=yes,toolbar=no,location=no,status=no');
}




function left(field,cntfield,maxlimit) 
{
if (field.value.length > maxlimit)
field.value = field.value.substring(0, maxlimit);
else
cntfield.value = maxlimit - field.value.length;
}




function imposeMaxLength(Object, MaxLen)
{
  return (Object.value.length <= MaxLen);
}



function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}





// AJAX FUNCTIONS



function add2cart(id)
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("item_" + id).innerHTML = '<table width="129" height="30" border="0" cellpadding="0" cellspacing="0" class="greytxt11"><tr><td><div align="center">Adding...</div></td></tr></table><table width="102" height="15" border="0" cellpadding="0" cellspacing="0" class="thumb_border greytxt11 loginlink" onmouseover="this.className=\'thumb_border_highlight loginlink\'" onmouseout="this.className=\'thumb_border loginlink\'"><tr><td height="18" bgcolor="#FFFFFF"><div align="center" class="greytxt10"><a href="javascript:add2cart("'+id+'")"><img src="images/add_to_cart_button.gif" /></a></div></td></tr></table><input type="hidden" name="itemid_"'+id+'" id="itemid_"'+id+'" value="'+id+'" />';
				
        }
	    
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

				document.getElementById("item_" + id).innerHTML = response;	
				refreshcart();
				refreshcart_top();
        }
      }
	  
	  
	  
	  var itemid = document.getElementById("itemid_" + id).value;
  	  var size = document.getElementById("size_" + id).value;
	  var colour = document.getElementById("colour_" + id).value;
	  var quantity = document.getElementById("quantity_" + id).value;
	  var allow = document.getElementById("allow_" + id).value;
	  var page = document.getElementById("page").value;


	  var ref = id;

	  	  
    xmlHttp.open("GET","actions/ajax_actions.php?action=add2cart&ref="+ref+"&allow="+allow+"&quantity="+quantity+"&itemid="+itemid+"&size="+size+"&colour="+colour+"&page="+page+"",true);
    xmlHttp.send(null);
}	




function add2cart_store(id)
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("item_" + id).innerHTML = '<table width="129" height="30" border="0" cellpadding="0" cellspacing="0" class="greytxt11"><tr><td><div align="center">Adding...</div></td></tr></table><table width="102" height="15" border="0" cellpadding="0" cellspacing="0" class="thumb_border greytxt11 loginlink" onmouseover="this.className=\'thumb_border_highlight loginlink\'" onmouseout="this.className=\'thumb_border loginlink\'"><tr><td height="18" bgcolor="#FFFFFF"><div align="center" class="greytxt10"><a href="javascript:add2cart("'+id+'")"><img src="images/add_to_cart_button.gif" /></a></div></td></tr></table><input type="hidden" name="itemid_"'+id+'" id="itemid_"'+id+'" value="'+id+'" />';
				
        }
	    
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

				document.getElementById("item_" + id).innerHTML = response;	
				refreshcart();
				refreshcart_top();
        }
      }
	  
	  
	  
	  var itemid = document.getElementById("itemid_" + id).value;
  	  var size = document.getElementById("size_" + id).value;
	  var colour = document.getElementById("colour_" + id).value;
	  var quantity = document.getElementById("quantity_" + id).value;
	  var allow = document.getElementById("allow_" + id).value;
	  var page = document.getElementById("page").value;


	  var ref = id;

	  	  
    xmlHttp.open("GET","actions/ajax_actions.php?action=add2cart_store&ref="+ref+"&allow="+allow+"&quantity="+quantity+"&itemid="+itemid+"&size="+size+"&colour="+colour+"&page="+page+"",true);
    xmlHttp.send(null);
  }	







function add2cart_home(id, ts_id)
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("item_" + id).innerHTML = '<table width="102" height="20" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td height="18" bgcolor="#FFFFFF"><div align="center" class="greytxt10">Adding..</div></td></tr></table>';
				
        }
	    
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

				document.getElementById("item_" + id).innerHTML = response;	
				refreshcart();
				refreshcart_top();
        }
      }
	  
	  

	  	  
    xmlHttp.open("GET","actions/ajax_actions.php?action=add2cart_home&itemid="+id+"&ts_id="+ts_id+"",true);
    xmlHttp.send(null);
  }	



function removefromcart_home(id, ts_id)
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("item_" + id).innerHTML = '<table width="102" height="20" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td height="18" bgcolor="#FFFFFF"><div align="center" class="greytxt10">Removing..</div></td></tr></table>';
				
        }
	    
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

				document.getElementById("item_" + id).innerHTML = response;	
				refreshcart();
				refreshcart_top();
        }
      }
	  
	  
	  
	  	  
    xmlHttp.open("GET","actions/ajax_actions.php?action=removefromcart_home&itemid="+id+"&ts_id="+ts_id+"",true);
    xmlHttp.send(null);
  }	




function addgift_voucher()
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("gift_voucher").innerHTML = '<table width="129" height="30" border="0" cellpadding="0" cellspacing="0" class="greytxt11"><tr><td><div align="center">Adding...</div></td></tr></table><table width="102" height="15" border="0" cellpadding="0" cellspacing="0" class="thumb_border greytxt11 loginlink" onmouseover="this.className=\'thumb_border_highlight loginlink\'" onmouseout="this.className=\'thumb_border loginlink\'"><tr><td height="18" bgcolor="#FFFFFF"><div align="center" class="greytxt10"><a href="javascript:add2cart("'+id+'")"><img src="images/add_to_cart_button.gif" /></a></div></td></tr></table><input type="hidden" name="itemid_"'+id+'" id="itemid_"'+id+'" value="'+id+'" />';
				
        }
	    
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

				document.getElementById("gift_voucher").innerHTML = response;	
				refreshcart();
				refreshcart_top();
        }
      }
	  
	  
	  
	  var amount = document.getElementById("voucher_amount").value;
	  var page = document.getElementById("page").value;


	  	  
    xmlHttp.open("GET","actions/ajax_actions.php?action=addgift_voucher&page="+page+"&amount="+amount+"",true);
    xmlHttp.send(null);
  }	



function addgift_voucher_store()
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("gift_voucher").innerHTML = '<table width="129" height="30" border="0" cellpadding="0" cellspacing="0" class="greytxt11"><tr><td><div align="center">Adding...</div></td></tr></table><table width="102" height="15" border="0" cellpadding="0" cellspacing="0" class="thumb_border greytxt11 loginlink" onmouseover="this.className=\'thumb_border_highlight loginlink\'" onmouseout="this.className=\'thumb_border loginlink\'"><tr><td height="18" bgcolor="#FFFFFF"><div align="center" class="greytxt10"><a href="javascript:add2cart("'+id+'")"><img src="images/add_to_cart_button.gif" /></a></div></td></tr></table><input type="hidden" name="itemid_"'+id+'" id="itemid_"'+id+'" value="'+id+'" />';
				
        }
	    
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

				document.getElementById("gift_voucher").innerHTML = response;	
				refreshcart();
				refreshcart_top();
        }
      }
	  
	  
	  
	  var voucher_id = document.getElementById("voucher_id").value;


	  	  
    xmlHttp.open("GET","actions/ajax_actions.php?action=addgift_voucher_store&voucherid="+voucher_id+"",true);
    xmlHttp.send(null);
  }	





function removefromcart(id)
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("item_" + id).innerHTML = '<table width="129" height="30" border="0" cellpadding="0" cellspacing="0" class="greytxt11"><tr><td><div align="center">Removing... </div></td></tr></table><table width="102" height="15" border="0" cellpadding="0" cellspacing="0" class="thumb_border greytxt11 loginlink" onmouseover="this.className=\'thumb_border_highlight loginlink\'" onmouseout="this.className=\'thumb_border loginlink\'"><tr><td height="18" bgcolor="#FFFFFF"><div align="center" class="greytxt10"><a href="javascript:removefromcart("'+id+'")"><img src="images/remove_product_button.gif" /></a></div></td></tr></table><input type="hidden" name="itemid_"'+id+'" id="itemid_"'+id+'" value="'+id+'" />';
				
        }
	    
		
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

				document.getElementById("item_" + id).innerHTML = response;	
				refreshcart();
				refreshcart_top();
		
        }
      }
	  
	  
	  
	  var itemid = document.getElementById("itemid_" + id).value;
	  var ref = id;
  	  var page = document.getElementById("page").value;
	  var allow = document.getElementById("allow_" + id).value;



	  	  
    xmlHttp.open("GET","actions/ajax_actions.php?action=removefromcart&ref="+ref+"&allow="+allow+"&itemid="+itemid+"&page="+page+"",true);
    xmlHttp.send(null);

}	



function removefromcart_store(id, prodid)
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("item_" + id).innerHTML = '<table width="129" height="30" border="0" cellpadding="0" cellspacing="0" class="greytxt11"><tr><td><div align="center">Removing... </div></td></tr></table><table width="102" height="15" border="0" cellpadding="0" cellspacing="0" class="thumb_border greytxt11 loginlink" onmouseover="this.className=\'thumb_border_highlight loginlink\'" onmouseout="this.className=\'thumb_border loginlink\'"><tr><td height="18" bgcolor="#FFFFFF"><div align="center" class="greytxt10"><a href="javascript:removefromcart("'+id+'")"><img src="images/remove_product_button.gif" /></a></div></td></tr></table><input type="hidden" name="itemid_"'+id+'" id="itemid_"'+id+'" value="'+id+'" />';
				
        }
	    
		
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

				document.getElementById("item_" + id).innerHTML = response;	
				refreshcart();
				refreshcart_top();
		
        }
      }
	  
	  
	  
	  var itemid = document.getElementById("itemid_" + prodid).value;
	  var ref = id;
  	  var page = document.getElementById("page").value;
	  var allow = document.getElementById("allow_" + prodid).value;



	  	  
    xmlHttp.open("GET","actions/ajax_actions.php?action=removefromcart_store&ref="+ref+"&allow="+allow+"&itemid="+itemid+"&page="+page+"",true);
    xmlHttp.send(null);

  }	





function refreshcart()
{
  var xmlHttp2;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp2=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp2=new ActiveXObject("Msxml2.XMLHTTP");

	  }
    catch (e)
      {
      try
        {
        xmlHttp2=new ActiveXObject("Microsoft.XMLHTTP");

		}
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
	

   
   
   
    xmlHttp2.onreadystatechange=function()
      {
     
	  if(xmlHttp2.readyState==1)
        {
		document.getElementById("cart").innerHTML = '<table width="126" border="0" align="left" cellpadding="0" cellspacing="0" class="whitetxt10 whitelink"><tr><td>&nbsp;</td><td class="whitetxt11"><strong>Refreshing..</strong></td></tr><tr><td>&nbsp;</td><td class="whitetxt11">&nbsp;</td></tr><tr><td height="3"><img src="images/spacer.gif" width="1" height="1" /></td><td height="3"><img src="images/spacer.gif" width="1" height="1" /></td></tr><tr><td>&nbsp;</td><td class="blacklink">&nbsp;</td></tr><tr><td width="12">&nbsp;</td><td width="130" class="blacklink">&nbsp;</td></tr></table>';
        }
	    
	  if(xmlHttp2.readyState==4)
        {
				var response = xmlHttp2.responseText;

				document.getElementById("cart").innerHTML = response;				
			
        }
      }
	  
    xmlHttp2.open("GET","actions/ajax_actions.php?action=refreshcart",true);
    xmlHttp2.send(null);
  }	






function add2registry(id)
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("item_" + id).innerHTML = '<table width="150" height="30" border="0" cellpadding="0" cellspacing="0" class="greytxt11"><tr><td><div align="center">Adding...</div></td></tr></table><table width="102" height="15" border="0" cellpadding="0" cellspacing="0" class="thumb_border greytxt11 loginlink" onmouseover="this.className=\'thumb_border_highlight loginlink\'" onmouseout="this.className=\'thumb_border loginlink\'"><tr><td height="18" bgcolor="#FFFFFF"><div align="center" class="greytxt10"><a href="javascript:add2registry("'+id+'")"><img src="images/add_to_registry_button.gif" /></a></div></td></tr></table><input type="hidden" name="itemid_"'+id+'" id="itemid_"'+id+'" value="'+id+'" />';
				
        }
	    
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

				document.getElementById("item_" + id).innerHTML = response;	
        }
      }
	  
	  
	  
	  var itemid = document.getElementById("itemid_" + id).value;
	  var size = document.getElementById("size_" + id).value;
	  var colour = document.getElementById("colour_" + id).value;
	  var quantity = document.getElementById("quantity_" + id).value;
	  var allow = document.getElementById("allow_" + id).value;
	  var page = document.getElementById("page").value;


	  var ref = id;

	  	  
    xmlHttp.open("GET","actions/ajax_actions.php?action=add2registry&ref="+ref+"&allow="+allow+"&quantity="+quantity+"&itemid="+itemid+"&size="+size+"&colour="+colour+"&page="+page+"",true);
    xmlHttp.send(null);
  }	
  
  
  function removefromregistry(id)
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("item_" + id).innerHTML = '<table width="150" height="30" border="0" cellpadding="0" cellspacing="0" class="greytxt11"><tr><td><div align="center">Removing... </div></td></tr></table><table width="102" height="15" border="0" cellpadding="0" cellspacing="0" class="thumb_border greytxt11 loginlink" onmouseover="this.className=\'thumb_border_highlight loginlink\'" onmouseout="this.className=\'thumb_border loginlink\'"><tr><td height="18" bgcolor="#FFFFFF"><div align="center" class="greytxt10"><a href="javascript:removefromregistry("'+id+'")"><img src="images/remove_product_button.gif" /></a></div></td></tr></table><input type="hidden" name="itemid_"'+id+'" id="itemid_"'+id+'" value="'+id+'" />';
				
        }
	    
		
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

				document.getElementById("item_" + id).innerHTML = response;	
		
        }
      }
	  
	  
	  
	  var itemid = document.getElementById("itemid_" + id).value;
	  var ref = id;
  	  var page = document.getElementById("page").value;
	  var allow = document.getElementById("allow_" + id).value;



	  	  
    xmlHttp.open("GET","actions/ajax_actions.php?action=removefromregistry&ref="+ref+"&allow="+allow+"&itemid="+itemid+"&page="+page+"",true);
    xmlHttp.send(null);

  }	
  
    function editremovefromregistry(id)
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("item_" + id).innerHTML = '<table width="150" height="30" border="0" cellpadding="0" cellspacing="0" class="greytxt11"><tr><td><div align="center">Removing... </div></td></tr></table><table width="102" height="15" border="0" cellpadding="0" cellspacing="0" class="thumb_border greytxt11 loginlink" onmouseover="this.className=\'thumb_border_highlight loginlink\'" onmouseout="this.className=\'thumb_border loginlink\'"><tr><td height="18" bgcolor="#FFFFFF"><div align="center" class="greytxt10"><a href="javascript:removefromregistry("'+id+'")"><img src="images/remove_product_button.gif" /></a></div></td></tr></table><input type="hidden" name="itemid_"'+id+'" id="itemid_"'+id+'" value="'+id+'" />';
				
        }
	    
		
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

				document.getElementById("item_" + id).innerHTML = response;	
		
        }
      }
	  
	  
	  
	  var itemid = document.getElementById("itemid_" + id).value;
	  var ref = id;
  	  var page = document.getElementById("page").value;
	  var allow = document.getElementById("allow_" + id).value;



	  	  
    xmlHttp.open("GET","actions/ajax_actions.php?action=editremovefromregistry&ref="+ref+"&allow="+allow+"&itemid="+itemid+"&page="+page+"",true);
    xmlHttp.send(null);

  }	
  
    

   function changeqtyinregistry(id)
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("item_" + id).innerHTML = '<table width="150" height="30" border="0" cellpadding="0" cellspacing="0" class="greytxt11"><tr><td><div align="center">Updating quantity... </div></td></tr></table><table width="102" height="15" border="0" cellpadding="0" cellspacing="0" class="thumb_border greytxt11 loginlink" onmouseover="this.className=\'thumb_border_highlight loginlink\'" onmouseout="this.className=\'thumb_border loginlink\'"><tr><td height="18" bgcolor="#FFFFFF"><div align="center" class="greytxt10"><a href="javascript:removefromregistry("'+id+'")"><img src="images/remove_product_button.gif" /></a></div></td></tr></table><input type="hidden" name="itemid_"'+id+'" id="itemid_"'+id+'" value="'+id+'" />';
				
        }
	    
		
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

				document.getElementById("item_" + id).innerHTML = response;	
		
        }
      }
	  
	  
	  
	  var itemid = document.getElementById("itemid_" + id).value;
	  var ref = id;
  	  var page = document.getElementById("page").value;
	  var allow = document.getElementById("allow_" + id).value;
	  var qty = document.getElementById("quantity_" + id).value;
	  var size = document.getElementById("size_" + id).value;
	  var colour = document.getElementById("colour_" + id).value;



	  	  
    xmlHttp.open("GET","actions/ajax_actions.php?action=changeqtyinregistry&ref="+ref+"&allow="+allow+"&qty="+qty+"&itemid="+itemid+"&size="+size+"&colour="+colour+"&page="+page+"",true);
    xmlHttp.send(null);

  }	
  
	
	
function IsNumeric(strString)	
   {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
	  return blnResult;
   }
	  
	
	
function checkMail(email)
{
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(email)) { return 1 } 
	else { return 0}
}

	

function add2book()
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	 		
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

					
						document.getElementById("booklist").innerHTML = response;	
						document.getElementById("name").value = "";
						document.getElementById("cell").value = "";
						document.getElementById("email_address").value = "";
						document.getElementById("numerror").innerHTML = "";	

						
						
        }
      }
	  
	  
	  
	  var name = document.getElementById("name").value;
	  var cell = document.getElementById("cell").value;
	  var email = document.getElementById("email_address").value;
	  var errortxt = "";
	  var cell_error = 0;
	  var email_error = 0;
	  var fill_in_error = 0;
	  var numresult = IsNumeric(cell); 
	
	  	 
if(document.getElementById("cell").value == "," || document.getElementById("cell").value.length != 10  || numresult == false)
	{  
	cell_error = 1;
	}
	
if(checkMail(email) == 0)
	{  
	email_error = 1;
	}

if(document.getElementById("cell").value.length == 0 && document.getElementById("email_address").value.length == 0) { fill_in_error = 1 }


if(fill_in_error == 1)
{
document.getElementById("numerror").innerHTML = "<strong>You have not entered a cell number or an email address.<br /><br />";		
}
else
{
	if(cell_error == 1 && document.getElementById("cell").value.length != 0)
	{
	var randomnumber = Math.floor ( Math.random ( ) * 999999 + 1000000 );
	errortxt += "<strong>Please enter a 10 digit South African cell number.</strong> Example: 082"+randomnumber+"<br /><br />";
	}
	if(email_error == 1 && document.getElementById("email_address").value.length != 0)
	{
	errortxt += "<strong>The email address you specified was invalid.<br /><br />";
	}
	document.getElementById("numerror").innerHTML = errortxt;		

}
	
if(fill_in_error == 0 && (cell_error == 0 || email_error == 0))
{					
	if(cell_error == 1) { cell = ""; }
	if(email_error == 1) { email = ""; }
	xmlHttp.open("GET","actions/ajax_actions.php?action=add2book&name="+name+"&cell="+cell+"&email_address="+email+"",true);
    xmlHttp.send(null);
}
	
  }	

function removefrombook(id)
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {    
		
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

					
				document.getElementById("booklist").innerHTML = response;				
						
        }
      }
	  
    xmlHttp.open("GET","actions/ajax_actions.php?action=removefrombook&id="+id+"",true);
    xmlHttp.send(null);

  }	






function send_sms(type)
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("sms_type").innerHTML = '<br /><table width="366" border="0" cellpadding="0" cellspacing="0" class="admingrey11 blacklink"><tr><td align="center" valign="middle"><img src="images/loading.gif" border = "0" /> Loading...</td></tr></table>';
				
        }
	    
		
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

					
				document.getElementById("sms_type").innerHTML = response;				
						
        }
      }
	  
    xmlHttp.open("GET","actions/ajax_actions.php?action=sms&type="+type+"",true);
    xmlHttp.send(null);

  }	






function left(field,cntfield,maxlimit) 
{
if (field.value.length > maxlimit)
field.value = field.value.substring(0, maxlimit);
else
cntfield.value = maxlimit - field.value.length;
}




function imposeMaxLength(Object, MaxLen)
{
  return (Object.value.length <= MaxLen);
}

function choosetba()
{
  document.getElementById("date_day").value = "Day";
  document.getElementById("date_month").value = "Month";
  document.getElementById("date_year").value = "Year";
}

function choosedate()
{
  document.getElementById("tba").checked = false;
}




function payment_type(type)
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("payment_type").innerHTML = '<br /><table width="366" border="0" cellpadding="0" cellspacing="0" class="admingrey11 blacklink"><tr><td align="center" valign="middle"><img src="images/loading.gif" border = "0" /> Loading...</td></tr></table>';
				
        }
	    
		
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

					
				document.getElementById("payment_type").innerHTML = response;				
						
        }
      }
	  
    xmlHttp.open("GET","actions/ajax_actions.php?action=payment_type&type="+type+"",true);
    xmlHttp.send(null);
  }	



function contactForm()
  {
  var xmlHttp;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("contact_form").innerHTML = '<table width="509" border="0" cellpadding="0" cellspacing="0" class="admingrey11 blacklink"><tr><td align="center" valign="middle"><img src="images/loading.gif" border = "0" /> Loading...</td></tr></table>';				
        }
	    
	  if(xmlHttp.readyState==4)
        {
		var response = xmlHttp.responseText;
		document.getElementById("contact_form").innerHTML = response;
        }
      }

    xmlHttp.open("GET","actions/ajax_actions.php?action=contact_form",true);
    xmlHttp.send(null);
  }	
  
 function closediv(divid)
  {
  document.getElementById(divid).innerHTML = "";
  }	
  
  
 
 




function schach_step1(choice)
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("schach_content").innerHTML = '<br /><table width="529" align="center" border="0" cellpadding="0" cellspacing="0" class="admingrey11 blacklink"><tr><td align="center" valign="middle"><img src="images/loading.gif" border = "0" /> Loading...</td></tr></table>';
				
        }
	    
		
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

				document.getElementById("schach_content").innerHTML = response;	
        }
      }
	  
	  
	  
	  var ch = choice;

    xmlHttp.open("GET","actions/ajax_actions.php?action=schach_step1&choice="+ch+"",true);
    xmlHttp.send(null);

}	
	
	

function check_own_quantity(price)
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("check_own_quantity").innerHTML = 'Calculating..';
				
        }
	    
		
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

				document.getElementById("check_own_quantity").innerHTML = response;	
        }
      }
	  
	  
	  
	  var pr = price;
	  var amount = document.getElementById("own_quantity").value;


    xmlHttp.open("GET","actions/ajax_actions.php?action=check_own_quantity&price="+pr+"&amount="+amount+"",true);
    xmlHttp.send(null);

}	
	
	
	

function show_other(state)
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1 && state == "Other")
        {
		document.getElementById("other_content").innerHTML = 'Loading..';
        }
	    
		
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

				document.getElementById("other_content").innerHTML = response;	
        }
      }
	  

    xmlHttp.open("GET","actions/ajax_actions.php?action=show_other&state="+state+"",true);
    xmlHttp.send(null);

}	
	

function buy_credits_eft()
  {
  var xmlHttp;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
        }
	    
	  if(xmlHttp.readyState==4)
        {
		var response = xmlHttp.responseText;
		document.getElementById("cred").innerHTML = response;
        }
      }
	
	
	var amount = document.getElementById("p4").value;

    xmlHttp.open("GET","actions/ajax_actions.php?action=buy_credits_eft&amount="+amount+"",true);
    xmlHttp.send(null);
  }	
  
  
  
  
  
  
  
  
  // Pesach Functions
  function add2pesachcart(id)
{
	alert('PRODUCT ADDED TO CART, \n\nPlease note: Each order is delivered to 1 destination. \n\nShould you wish to order various hampers for delivery to mutliple destinations please finish this order first. Thereafter, you will be returned to this page where you can start a new order with a second delivery address.\n\nAlso note: Delivery to the same address will only be charged once.');
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("item_" + id).innerHTML = '<table width="129" height="30" border="0" cellpadding="0" cellspacing="0" class="greytxt11"><tr><td><div align="center">Adding...</div></td></tr></table><table width="102" height="15" border="0" cellpadding="0" cellspacing="0" class="thumb_border greytxt11 loginlink" onmouseover="this.className=\'thumb_border_highlight loginlink\'" onmouseout="this.className=\'thumb_border loginlink\'"><tr><td height="18" bgcolor="#FFFFFF"><div align="center" class="greytxt10"><a href="javascript:add2cart("'+id+'")"><img src="images/add_to_cart_button.gif" /></a></div></td></tr></table><input type="hidden" name="itemid_"'+id+'" id="itemid_"'+id+'" value="'+id+'" />';
				
        }
	    
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

				document.getElementById("item_" + id).innerHTML = response;	
				refreshpesachcart();
        }
      }
	  
	  
	  
	  var itemid = document.getElementById("itemid_" + id).value;
	  var quantity = document.getElementById("quantity_" + id).value;


	  var ref = id;

	  	  
    xmlHttp.open("GET","actions/ajax_actions.php?action=add2pesachcart&ref="+ref+"&quantity="+quantity+"&itemid="+itemid+"",true);
    xmlHttp.send(null);
  }	
  
  
  
  function removefrompesachcart(id)
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("item_" + id).innerHTML = '<table width="129" height="30" border="0" cellpadding="0" cellspacing="0" class="greytxt11"><tr><td><div align="center">Removing... </div></td></tr></table><table width="102" height="15" border="0" cellpadding="0" cellspacing="0" class="thumb_border greytxt11 loginlink" onmouseover="this.className=\'thumb_border_highlight loginlink\'" onmouseout="this.className=\'thumb_border loginlink\'"><tr><td height="18" bgcolor="#FFFFFF"><div align="center" class="greytxt10"><a href="javascript:removefromcart("'+id+'")"><img src="images/remove_product_button.gif" /></a></div></td></tr></table><input type="hidden" name="itemid_"'+id+'" id="itemid_"'+id+'" value="'+id+'" />';
				
        }
	    
		
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

				document.getElementById("item_" + id).innerHTML = response;	
				refreshpesachcart();
		
        }
      }
	  
	  
	  
	  var itemid = document.getElementById("itemid_" + id).value;
	  var ref = id;



	  	  
    xmlHttp.open("GET","actions/ajax_actions.php?action=removefropesachmcart&ref="+ref+"&itemid="+itemid+"",true);
    xmlHttp.send(null);

  }	




function refreshpesachcart()
{
  var xmlHttp2;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp2=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp2=new ActiveXObject("Msxml2.XMLHTTP");

	  }
    catch (e)
      {
      try
        {
        xmlHttp2=new ActiveXObject("Microsoft.XMLHTTP");

		}
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
	

   
   
   
    xmlHttp2.onreadystatechange=function()
      {
     
	  if(xmlHttp2.readyState==1)
        {
		document.getElementById("pesachcart").innerHTML = '<table width="189" height="25" border="0" align="right" cellpadding="0" cellspacing="0" class="greytxt10 loginlink"><tr><td width="163" class="greytxt11"><div align="right">Refreshing..</div></td></tr><tr><td class="greytxt11"><div align="right"></div></td></tr></table>';
				
        }
	    
	  if(xmlHttp2.readyState==4)
        {
				var response = xmlHttp2.responseText;

				document.getElementById("pesachcart").innerHTML = response;				
			
        }
      }
	  
    xmlHttp2.open("GET","actions/ajax_actions.php?action=refreshpesachcart",true);
    xmlHttp2.send(null);
  }	




function delivery_type(type)
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("delivery_type").innerHTML = '<br /><table width="529" border="0" cellpadding="0" cellspacing="0" class="admingrey11 blacklink"><tr><td align="center" valign="middle"><img src="images/loading.gif" border = "0" /> Loading...</td></tr></table>';
				
        }
	    
		
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

					
				document.getElementById("delivery_type").innerHTML = response;				
						
        }
      }
	  
    xmlHttp.open("GET","actions/ajax_actions.php?action=delivery_type&type="+type+"",true);
    xmlHttp.send(null);
  }	
  
  
  


function refreshcart_top()
{
  var xmlHttp2;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp2=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp2=new ActiveXObject("Msxml2.XMLHTTP");

	  }
    catch (e)
      {
      try
        {
        xmlHttp2=new ActiveXObject("Microsoft.XMLHTTP");

		}
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
	

   
   
   
    xmlHttp2.onreadystatechange=function()
      {
     
	  if(xmlHttp2.readyState==1)
        {
		document.getElementById("cart_top").innerHTML = '<table width="285" border="0" align="center" cellpadding="0" cellspacing="0" class="pinktxt10 pinklink"><tr><td height="4"><img src="images/spacer.gif" width="1" height="1" /></td><td><img src="images/spacer.gif" width="1" height="1" /></td></tr><tr><td width="156"><strong>Refreshing..</strong></td><td width="120">&nbsp;</td></tr></table>';
				
        }
	    
	  if(xmlHttp2.readyState==4)
        {
				var response = xmlHttp2.responseText;

				document.getElementById("cart_top").innerHTML = response;				
			
        }
      }
	  
    xmlHttp2.open("GET","actions/ajax_actions.php?action=refreshcart_top",true);
    xmlHttp2.send(null);
  }	

  
  
  
  

function change_price(id)
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("price_" + id).innerHTML = 'Refreshing..';
				
        }
	    
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

				document.getElementById("price_" + id).innerHTML = response;	
        }
      }
	  
	  
	  
	  var itemid = document.getElementById("itemid_" + id).value;
  	  var size = document.getElementById("size_" + id).value;
	  var ref = id;

	  	  
    xmlHttp.open("GET","actions/ajax_actions.php?action=change_price&itemid="+itemid+"&size="+size+"",true);
    xmlHttp.send(null);
  }	
  
  

function selling_price(id)
{
  var xmlHttp;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    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.onreadystatechange=function()
      {
     
	  if(xmlHttp.readyState==1)
        {
		document.getElementById("selling_price_" + id).innerHTML = 'Refreshing..';
				
        }
	    
	  if(xmlHttp.readyState==4)
        {
				var response = xmlHttp.responseText;

				document.getElementById("selling_price_" + id).innerHTML = response;	
        }
      }
	  
	  
	  
	  var cost = document.getElementById("cost_price_" + id).value;
  	  var markup = document.getElementById("cost_price_" + id + "markup").value;

	  	  
    xmlHttp.open("GET","actions/ajax_actions.php?action=selling_price&cost="+cost+"&markup="+markup+"",true);
    xmlHttp.send(null);
  }	
  




