// FOR MAILING LIST
//////////////////////////////////////////////////////////////////////////////////////////
function mailing_list() {

  if (document.mailing.email.value < 5)  {
    alert("Please, enter your e-mail address");
    document.mailing.email.focus();
    return false;
  }
  
  em=0
  em=document.mailing.email.value.indexOf("@")
    if (em==-1)  {
    alert("Please, enter correct e-mail address");
    document.mailing.email.focus();
    return false;
  }  
  emp=0
  emp=document.mailing.email.value.indexOf(".")
  
  if (emp==-1)  {
    alert("Please, enter correct e-mail address");
    document.mailing.email.focus();
    return false;
  }
return true;
}


// FOR Rollover color
//////////////////////////////////////////////////////////////////////////////////////////
  
  function onColor(lr){
         lr.style.backgroundColor='C0C7CA';
		 //lr.style.backgroundColor='8A9093';
		 lr.style.color = "EB65AA";
 	}
   function offColor(lr) {
         lr.style.backgroundColor='FFFFFF';
		 //lr.style.color = "FFFFFF";
   }


// FOR CHECKOUT 1
//////////////////////////////////////////////////////////////////////////////////////////
function Changeshippingtype(stype) 
{
		if (stype == 1)
		{
			
			country_object="document.checkoutform.shipping_country";
			if (eval(country_object)) 
			{
			document.checkoutform.shipping_type[0].checked=true;
			select_field(country_object,"US");
			}
			
		}
		else
		{
			document.checkoutform.shipping_type[1].checked=true;
		}


}


function select_field(objectname,objvalue)
{
for (i=0;i<=(eval(objectname+'.length')-1);i++)
{
if ((eval(objectname + '.options[' + i + '].value'))==objvalue)
{
eval(objectname+'.options['+i+'].selected=true');
}
else{
eval(objectname+'.options['+i+'].selected=false');
}}}
//////////////////////////////////////////////////////////////////////////////////////////

// FOR CHECKOUT 2
//////////////////////////////////////////////////////////////////////////////////////////
function checkselectedshipping()
{

}
//////////////////////////////////////////////////////////////////////////////////////////

// FOR CHECKOUT 3
//////////////////////////////////////////////////////////////////////////////////////////


//document.billing.billing_country.value='[shipping_country]';

// For each option in country drop down... find index of shipping country, and select it!

function select_field(objectname,objvalue)
{
for (i=0;i<=(eval(objectname+'.length')-1);i++)
{
if ((eval(objectname + '.options[' + i + '].value'))==objvalue)
{
eval(objectname+'.options['+i+'].selected=true');
}
else{
eval(objectname+'.options['+i+'].selected=false');
}}}

function Changeshippingtypeb(stype) 
{
		if (stype == 1)
		{
			if (eval(country_object)) 
			{
			document.billing.billing_type[0].checked=true;
			country_object="document.billing.billing_country";
			select_field(country_object,"US");
			}
		}
		else
		{
			document.billing.billing_type[1].checked=true;
		}
}
//////////////////////////////////////////////////////////////////////////////////////////

