function agreeTerms(){
 
 if( document.billingForm.terms.value=='' ){
   document.billingForm.terms.value='agree';
 }else{
  document.billingForm.terms.value='';
 }
 
}


function selectPostage(){
 document.billingForm.submit();
}


function checkBilling(){



  if(billingForm.fname.value==''){ 
    alert('Please enter name') 
	billingForm.fname.focus(); 	
	return false; 
   }

  if(billingForm.surname.value==''){ 
    alert('Please enter surname') 
	billingForm.surname.focus(); 	
	return false;
   }
  
   if(billingForm.CustomerEMail.value==''){
    alert('Please enter email')  	
	billingForm.CustomerEMail.focus();
	return false;
   }

   if(billingForm.ContactNumber.value==''){
    alert('Please enter telephone number')  	
	billingForm.ContactNumber.focus();
	return false;
   }


   if(billingForm.Baddress1.value==''){
    alert('Please enter billing address')  	
	billingForm.Baddress1.focus();
	return false;
   }


   if(billingForm.city.value==''){
    alert('Please enter city')  	
	billingForm.city.focus();
	return false;
   }
 //BillingPostCode

   if(billingForm.BillingCountry.value=='' || billingForm.BillingCountry.value=='0'){
    alert('Please select country')  	
	billingForm.BillingCountry.focus();
	return false;
   }
   
  
   if(billingForm.terms.value=='' || billingForm.terms.value=='0'){
    alert('You have to agree to Terms & Conditions to proceed')  	
	billingForm.terms.focus();
	return false;
   }   
   

}



function checkDelivery(){

  if(billingForm.DeliveryFName.value==''){ 
    alert('Please enter Delivery Name') 
	billingForm.DeliveryFName.focus(); 	
	return false;
   }

  if(billingForm.DeliverySurname.value==''){ 
    alert('Please enter Delivery Surname') 
	billingForm.DeliverySurname.focus(); 	
	return false;
   }
  
   if(billingForm.DeliveryEMail.value==''){
    alert('Please enter Delivery Email')  	
	billingForm.DeliveryEMail.focus();
	return false;
   }

   if(billingForm.DeliveryNumber.value==''){
    alert('Please enter Delivery Telephone Number')  	
	billingForm.DeliveryNumber.focus();
	return false;
   }


   if(billingForm.DeliveryAddress.value==''){
    alert('Please enter Delivery Address')  	
	billingForm.DeliveryAddress.focus();
	return false;
   }


   if(billingForm.DeliveryPostCode.value==''){
    alert('Please enter Delivery Postcode')  	
	billingForm.DeliveryPostCode.focus();
	return false;
   }

   if(billingForm.DeliveryCountry.value=='' || billingForm.DeliveryCountry.value=='0'){
    alert('Please select Delivery Country')  	
	billingForm.DeliveryCountry.focus();
	return false;
   }

}



function updateBasket(){
 document.shopping_basket.submit();
}


function orderConfirm(){

 var chk=true;
 chk =  checkBilling()

 if(chk){
  document.billingForm.submit();  
 }
 
 
}


function loadForm(id){

 if(id=='card'){
   document.billingForm.delivery_option.value='billing';
 }else{
  document.billingForm.delivery_option.value='another';
 }

 document.getElementById('otherAddress').style.display='none'; 
 document.getElementById(id).style.display='block';

}



 function openNEW(){ 
  window.open('http://www.dralkaitis.co.uk/chatBOX.php','myWindow','scrollbars=yes,width=550,height=350,screenX=200,screenY=150');
 }


 function openNEW1(){ 
  window.open('http://localhost/alkaitis/chatBOX.php','myWindow','scrollbars=yes,width=550,height=350,screenX=200,screenY=150');
 }


function closeDIV(id){
  document.getElementById(id).style.display='none';
}


function openDIV(id){
  document.getElementById(id).style.display='block';
}



function loadNav(id,url){

  window.location='http://localhost/eShop/'+id+'/'+url+'/';

}





function lightON(colr,id){

 document.getElementById(id).style.color=colr;

}


function lightOFF(colr,id){

 document.getElementById(id).style.color='#8D8D8D';

}


function nowON(colr,id){

 document.getElementById(id).style.color=colr;

}


function submitform()
{
  document.subscribe.submit();
}


function checkEmpty(form){
 
alert(form.name.value) 
  if(form.name.value==''){ 
    alert('Please enter name') 
	form.name.focus(); 	
	return false;
   }
  
   if(form.email.value==''){
    alert('Please enter email')  	
	form.email.focus();
	return false;
   }

}


function subsEmpty(){
 
  if(subscribe_form.name.value==''){ 
    alert('Please enter name') 
	subscribe_form.name.focus(); 	
	return false;
   }
  
   if(subscribe_form.email.value==''){
    alert('Please enter email')  	
	subscribe_form.email.focus();
	return false;
   }

}



function getCSSID(getID,second,third){
	
	document.getElementById(getID).style.color='#CF1A14';
	document.getElementById(getID).style.fontWeight='Bold';
	/*
	document.getElementById(second).style.color='#E40F85';
	document.getElementById(third).style.color='#E40F85';		
	*/
		
}


function whichBrs() {
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf("opera") != -1) return 'Opera';
if (agt.indexOf("staroffice") != -1) return 'Star Office';
if (agt.indexOf("webtv") != -1) return 'WebTV';
if (agt.indexOf("beonex") != -1) return 'Beonex';
if (agt.indexOf("chimera") != -1) return 'Chimera';
if (agt.indexOf("netpositive") != -1) return 'NetPositive';
if (agt.indexOf("phoenix") != -1) return 'Phoenix';
if (agt.indexOf("firefox") != -1) return 'Firefox';
if (agt.indexOf("safari") != -1) return 'Safari';
if (agt.indexOf("skipstone") != -1) return 'SkipStone';
if (agt.indexOf("msie") != -1) return 'Internet Explorer';
if (agt.indexOf("netscape") != -1) return 'Netscape';
if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
if (agt.indexOf('\/') != -1) {
if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
return navigator.userAgent.substr(0,agt.indexOf('\/'));}
else return 'Netscape';} else if (agt.indexOf(' ') != -1)
return navigator.userAgent.substr(0,agt.indexOf(' '));
else return navigator.userAgent;
}

