function DisAllowNumbers(){
    if (window.event.keyCode >= 48 && window.event.keyCode <= 57){
		window.event.returnValue=false;}
	else if(window.event.keyCode == 32){
		window.event.returnValue=true;}}
		
		
function DisAllowAlphabets()
  {     
var isNS4 = (navigator.appName=="Netscape")?1:0;
if(!isNS4){
	if(event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;}
else{if((event.which < 48 || event.which > 57) && !(event.which == 8)){ return false;}}
}

		
		

// function for show shopping cart popup     
    
  var pp=window.createPopup()
    
  function ShowCartPopup(event,title,txt,w,h) {
	var pbody=pp.document.body
	var myHeight=0;
	myHeight=window.screen.height;
	
	pbody.style.border="solid lightgrey 1px"	
	var text="<table cellpedding=0 cellspacing=0 width='248'>"
	text=text+"<tr><td style='float:left; padding-left:6px;padding-right:6px; padding-top:4px; text-align:center; height:58px; font-size:13pt;font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;vertical-align:middle; background: #FBF9F9 url(images/loading.gif) no-repeat fixed 5px 15px;'>"
	text=text+"<span style='font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-weight:normal;font-size:10pt;position:absolute;left:35px;top:19px'> "+ txt +"</span></td></tr></table>"
	pbody.innerHTML=text
	pp.show(400,300,w,h,document.body)
    setTimeout("pp.hide()", 3000);
	
	}
  
// show shopping cart popup end 
function showcartpopNew(icd,txt)
{
	  	document.getElementById('info'+icd).innerHTML="<span style='font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-weight:normal;font-size:8pt;position:absolute;left:35px;top:8px'>"+txt+"</span>";
	  	document.getElementById('info'+icd).style.display='';
	  	setTimeout("document.getElementById('info"+icd+"').style.display='none'", 3000);
}


// function  for mouseover link without hyperlink START

function MouseOverLink(divid)
{
document.getElementById(divid).style.color="#993333";
document.getElementById(divid).style.textDecoration='underline';
}

function MouseOutLink(divid)
{
document.getElementById(divid).style.color="";
document.getElementById(divid).style.textDecoration='';
}

// function  for mouseover link without hyperlink END

function addToWlist(){
  	document.form1.mode.value="addwish";  	
  	document.form1.submit(); }


// Ajax function for add to cart and wishlist
  
var xmlHttp1

function addtocartwish (icd,mode,storelink)
{ 
xmlHttp1=GetXmlHttpObject();


if (xmlHttp1==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
if (mode=='addshop')
	{		
			if(navigator.appName == "Microsoft Internet Explorer")
				{
			  	 showcartpopNew(icd,"Adding item to<br />Shopping bag");
			    }
			else{	
				 showcartpopNew(icd,"Adding item to<br />Shopping bag");
			 	 //confirm("Adding item to shopping cart?");
			 	// window.open(url,'name','height=200,width=150');
			  	}
	}
else if (mode=='addwish')
	{
			if(navigator.appName == "Microsoft Internet Explorer")
				{
				  showcartpopNew(icd,"Adding item to<br />Wish List");
				 } 
			else{	
				  showcartpopNew(icd,"Adding item to<br />Shopping bag");
		 
				 // confirm("Adding item to wish list?");
				 } 
	}

var url=storelink +"navigate-cart.asp";
url=url+"?icode="+icd;
url=url+"&mode="+mode;
checkurl=storelink;

xmlHttp1.onreadystatechange=stateChanged1;

xmlHttp1.open("GET",url,true);
xmlHttp1.send(null);

}
  
var checkurl; 
function stateChanged1() 
{ 
if (xmlHttp1.readyState==4)
	if (checkurl=='store/')
	{
	 showminicart('Y');	
	 cart('Y');	
	}
	else
	{
     showminicart('N');	
     cart('N');	
	}

}

//---------------------

// new add to cart wish function new pop up -->

var xmlHttpNew

function addtocartwishNew(icd,mode,storelink)
{ 
xmlHttpNew=GetXmlHttpObject();

if (xmlHttpNew==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
if (mode=='addshop')
	{
	    showcartpopNew(icd,"Adding item to<br />Shopping bag");		
	}
else if (mode=='addwish')
	{
	    showcartpopNew(icd,"Adding item to<br />Wish list");		
	}

var url=storelink +"navigate-cart.asp";
url=url+"?icode="+icd;
url=url+"&mode="+mode;
checkurlNew=storelink;


xmlHttpNew.onreadystatechange=stateChangedNew;

xmlHttpNew.open("GET",url,true);
xmlHttpNew.send(null);

}
var checkurlNew; 
function stateChangedNew() 
{ 
if (xmlHttpNew.readyState==4)
	if (checkurlNew=='store/')
	{
	 showminicart('Y');	
	 cart('Y');	
	}
	else
	{
     showminicart('N');	
     cart('N');	
	}
}
  
  //<--

  
function GetXmlHttpObject()
{
var xmlHttp1=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp1=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp1=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp1=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp1;

}

 
//Mini cart Module

var xmlHttpobj

function showminicart(opt)
{ 

xmlHttpobj=GetXmlHttpObject1();


if (xmlHttpobj==null)

  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var urll;  
 if (opt=='Y') 
  {	urll="store/minishopcart.asp";}
 else if(opt=='N')
  { urll="minishopcart.asp"; }	

urll=urll+"?cart="+get_cookie('cart');
urll=urll+"&DScart="+get_cookie('DScart');
urll=urll+"&indx="+opt ;

xmlHttpobj.onreadystatechange=stateChangedfun;
xmlHttpobj.open("GET",urll,true);
xmlHttpobj.send(null);

}

function stateChangedfun() 
{ 
if (xmlHttpobj.readyState==4)

	{ 
	window.parent.document.getElementById("OSminicart").innerHTML=xmlHttpobj.responseText;
	}
}


function get_cookie ( cookie_name )
{
  var results = document.cookie.match ( cookie_name + '=(.*?)(;|$)' );

  if ( results )
    return ( unescape ( results[1] ) );
  else
    return null;
}


function GetXmlHttpObject1()
{
var xmlHttpobj=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttpobj=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttpobj=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttpobj=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttpobj;

}

//Ajax for mini cart end//





//contact us ////
function contactquery()
{
var val=false
var valnew
var str
		if(document.form1.con_sub.value==0)
		{
		alert("select the Subject")
		val=false
		return false
		}
		else
		{
		val=true
		if(val=true)
       str=document.form1.qemail.value;  val=validateData(str,'max=50,email','Email Address') 
   if (val==true)
    {str=document.form1.fullname.value ;val=validateData(str,'required,alpha','Full Name')
  
   if (val==true)
  	{str=document.form1.message.value; val=messageval(str)
   if (val==true)
   	{valnew=document.form1.fullname.value;
     valnew=valnew+'.;'+document.form1.qemail.value;
	 valnew=valnew+'.;'+document.form1.ordernumber.value;
	 valnew=valnew+'.;'+document.form1.message.value;
	  valnew=valnew+'.;'+document.form1.con_sub.value;
	 if(document.form1.concheck.checked==true)
	 {
	valnew=valnew+'.;'+'1';
     }
     else
     valnew=valnew+'.;'+'2';
	 centerWindowX('submit.asp?val='+valnew+'&mode=contactquery'); 
     document.form1.reset();}
     else
		{document.form1.message.focus();
		alert("Message Can Not Blank")
		return false
		
		}
		}	
	
  else
		{document.form1.fullname.focus();
		return false}}
		
	
		   else
	
	{
	document.form1.qemail.focus();
	return false
	}}}


//contact us end  ////


function centerWindowX(fname) {
    if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 640, yMax=480;
    var xOffset = (xMax - 490)/2, yOffset = (yMax - 190)/2;	
    MM_openBrWindow(fname,'info','width=400,height=150,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
}

function MM_openBrWindow(theURL,winName,features) { 
     window.open(theURL,winName,features);}


function messageval(str)
{
if(str!="")
{
return true
}
	
}



function validateData(strValidateStr,command,fieldname) 
{ var newcommand=command.split(",");
  for (var i=0; i < newcommand.length; i++){ 
   var val = validateform(strValidateStr,newcommand[i],fieldname)
   if (val==false){
  	return val;}}
  return val;}
  
  

function validateform(strValidateStr,command,fieldname)
{ var strError="";  var epos = command.search("="); var  newcommand  = ""; var  cmdvalue = ""; 
  if(epos >= 0){ 
     newcommand  = command.substring(0,epos); 
     cmdvalue = command.substr(epos+1);} 
  else{ 
     newcommand = command;} 
 
  switch(newcommand){ 
    case "req": 
    case "required": 
    { if((strValidateStr.length) == 0){ 
          strError = fieldname + " is a  Required Field"; 
          alert(strError);
          strError="";
          return false;} 
       break;} 
    case "maxlength": 
    case "max": 
    { if (strValidateStr.length > cmdvalue){ 
          strError = fieldname + " : has more than allowed maximum characters  "; 
          strError=strError + "\n[Current length = " + strValidateStr.length + " ]"
          alert(strError);
          strError = "";	
          return false; }
      break;}
    case "minlength": 
    case "min": 
    { if(strValidateStr.length < cmdvalue){ 
          strError = fieldname + " : has less than allowed minimum characters  "; 
          alert(strError + "\n[Current length = " + strValidateStr.length + " ]"); 
          return false;} 
          break;} 
    case "alnum": 
    case "alphanumeric":{ 
      var charpos = strValidateStr.search("[^A-Za-z0-9-/,.  ]"); 
      if(strValidateStr.length > 0  &&  charpos >= 0){ 
          strError = fieldname +" : allows Only alpha-numeric characters  "; 
          alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
          strError="";
          return false;} 
          break;}
    case "num": 
    case "numeric":{ 
      var charpos = strValidateStr.search("[^0-9]"); 
      if(strValidateStr.length > 0 &&  charpos >= 0){ 
          strError = fieldname+" : allows Only numbers ";                
          alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
          strError="";
          return false;} 
          break;} 
    case "alphabetic": 
    case "alpha":{ 
      var charpos = strValidateStr.search("[^A-Za-z ]"); 
      if(strValidateStr.length > 0 &&  charpos >= 0){ 
          strError = fieldname+" : allows Only alphabetic characters  "; 
          alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
          strError="";
          return false;} 
          break;} 
    case "email":{ 
      if(!checkmail(strValidateStr)){ 
          return false;} 
          break;} 
    case "lt": 
    case "lessthan":{ 
      if(isNaN(strValidateStr)){ 
          alert(fieldname+" : Should be a number "); 
          return false;} 
          if ((strValidateStr) >=  eval(cmdvalue)){ 
              strError = fieldname + " : value should be less than "+ cmdvalue;              
              alert(strError); 
              strError="";
              return false;}            
          break;}
    case "gt": 
    case "greaterthan":{ 
      if(isNaN(strValidateStr)){ 
          alert(objValue.name+" : Should be a number "); 
          return false;}
          if(strValidateStr <=  eval(cmdvalue)){ 
              strError = fieldname + " : value should be greater than "+ cmdvalue; 
              alert(strError);
              strError=""; 
              return false;}             
          break;} 
    case "regexp":{ 
      if(!strValidateStr.match(cmdvalue)){ 
          strError = fieldname +" : Invalid characters found "; 
          alert(strError); 
          return false;} 
          break;} 
    case "UT":{ 
      if(strValidateStr.search("UT") < 0 && strValidateStr.search("ut") < 0 && strValidateStr.search("uT") < 0 && strValidateStr.search("Ut") < 0){ 
          strError = fieldname +" : must start with UT"; 
          alert(strError); 
          return false;} 
          break;} 
   } 
 return true;}
 
 
 
 
 function checkmail(str){
   		var at="@"        
		var dot="."
		var temp;
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		var invalidchar=" \"([{}])!#$%^&*';:,/\\?|+`~<>=~"
		if (str.indexOf(at)==-1){
			alert("Please Enter a valid Email ID.")
		   	return false }
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr-1){
		   alert("Please Enter a valid Email ID.")
		   return false	}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr-1){
		    alert("Please Enter a valid Email ID.")
		    return false }
		if (str.indexOf(at,(lat+1))!=-1){
		    alert("Please Enter a valid Email ID.")
		    return false }
		if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Please Enter a valid Email ID.")
		    return false }
		if (str.indexOf(dot,(lat+2))==-1){
		    alert("Please Enter a valid Email ID.")
		    return false }		
		for (i=0; i<(invalidchar.length-1); i++){
		      temp=invalidchar.substring(i,i+1);		      
		      if (str.indexOf(temp)!=-1){
		         alert("Please Enter a valid Email ID.")
		         return false} 
	 	}		 		
return true; }

 

function displayquote(icode,storelink)
  {	
     s="border:raised;dialogHeight:300px;dialogWidth:450px;center:yes;help:no;resizeable:no;scroll:no;status:no;"
     s1=storelink +"itemquery.asp?icode="+ icode 
     if (window.showModalDialog) {   
        win1=window.showModalDialog(s1,"",s)}
     else{
        win1=window.open(s1,"","width=450,height=255,left=10,top=5") }       
  }
  
 
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_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='Enter a valid Email ID.\n';
        else {p=val.indexOf('.');
        if (p<1 || p==(val.length-1)) errors+='Enter a valid Email ID.\n';}
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+=nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+=nm+' must be between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') {if (test.indexOf('isEmail')!=-1); 
	else
	//errors += 'Email ID is required.\n'
		if(nm=="YName")
	{
	nm="Your Name";
	}
	if(nm=="FName")
	{
	nm="Friend Name";
	}
	if(nm=="FEmail")
	{
	nm="Friend Email";
	}

	 if(nm=="subject")
	{
	nm="Subject";
	}

 errors +=nm+' is required.\n'; }}
  } if (errors) alert('Please Enter following fields(s):\n\n'+errors);
  document.MM_returnValue = (errors == '');
}


function centerWindow(fname) {
    if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 640, yMax=480;
    var xOffset = (xMax - 490)/2, yOffset = (yMax - 190)/2;	
    MM_openBrWindowX(fname,'info','width=400,height=150,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
}

function MM_openBrWindowX(theURL,winName,features) { //v2.0
  mywin=window.open(theURL,winName,features);  
  if (mywin.opener==null)
      mywin.opener=self;  
  self.close();
}


function submitInqury()
  {
  MM_validateForm('Comments','','R','YName','','R','Email','','RisEmail');
    if (document.MM_returnValue)
      { 
       if (checkmail(document.form1.Email.value))
       {
       val=document.form1.itemcode.value
       val=val+'.;'+document.form1.YName.value;
       val=val+'.;'+document.form1.Email.value;
       val=val+'.;'+document.form1.Comments.value;
       centerWindow('submit.asp?val='+val+'&mode=inquiry');                    
		}      
      }
      return false;
  }
 function submitIQuery()
  {
      MM_validateForm('comments','','R','YName','','R','Email','','RisEmail');
    if (document.MM_returnValue)
      { 
      	 if (checkmail(document.form1.Email.value))
       		{
       		val=document.form1.items.value 
       		val=val+'.;'+document.form1.Comments.value; 
       		val=val+'.;'+document.form1.YName.value;       
       		val=val+'.;'+document.form1.Email.value;      
       		val=val+'.;'+document.form1.PhoneCountry.value;
       		val=val+'.;'+document.form1.PhoneAreaCode.value;
       		val=val+'.;'+document.form1.PhoneNumber.value+'.;';  
       		centerWindow('submit.asp?val='+val+'&mode=wishquery');                    
      		}
      }
  } 


////////////////////////////////////////////////////////////////////


function make_blankemail(dis)
{

	if (dis=="hide")
	{
	if (document.newsletter2.EMailp.value=="enter your email address")
	{
	document.newsletter2.EMailp.value="";	
	}
	}
	else if (dis=="show")
	{
	 if (document.newsletter2.EMailp.value=="")
	{
	document.newsletter2.EMailp.value="enter your email address";	
	}}

	
}


function submitLetterindex2(storelink){  
    if(document.newsletter2.EMailp.value=="")
   		{alert("Please Enter Email ID");
   		document.newsletter2.EMailp.focus();}
    else if (checkmail(document.newsletter2.EMailp.value)){
       val2=document.newsletter2.EMailp.value 
       centerWindowX(storelink+'submit.asp?Email='+val2+'&mode=letter');
       document.newsletter2.EMailp.value=''}}
	   
/////////////////////////////////////////////

var lid=0;
function showmain_menu(id)
{ 
if(lid!=0)
document.getElementById('MAINMENU'+lid).style.display=""; 

}

function showmain_menu1(id)
{ 
lid=id;


}


function hidemain_menu(id)
{ 

document.getElementById('MAINMENU'+lid).style.display="none"; 

}
function settotals(){
	var s=new String(document.getElementById("countries").value)
	var i=s.indexOf("-")
	var v=eval(s.substr(i+1,s.length))
	document.cookie="shipchg="+v
	document.getElementById("logistics1").innerHTML=s.substr(0,s.indexOf("="))+"&nbsp;"+v
	document.getElementById("logistics2").innerHTML=s.substr(0,s.indexOf("="))+"&nbsp;"+v

	var gt=eval(document.getElementById("gtotal").value)		
	var nt=eval(gt+v)	
	nt=nt.toString()	
	i=nt.indexOf(".")
    if (i!=-1)
	  nt=nt.substr(0,i+3)
	else
	  nt=nt+".00";
	document.getElementById("ntotal").innerHTML=s.substr(0,s.indexOf("="))+"&nbsp;"+nt
	}


function showshipping(){   
	var s=document.getElementById("countries")
	var F5=document.getElementById("F5")
	var S5=document.getElementById("S5")
	var F1=document.getElementById("F1")
	var F2=document.getElementById("F2")
	var NT=document.getElementById("NT")
	var logistics=document.getElementById("logistics")
	s=new String(s.value);
	
	if (s.length==0){
	   F5.style.visibility='hidden';
	   NT.style.visibility='hidden';
	   S5.style.visibility='hidden';
	   logistics.innerHTML=""
	   F1.innerHTML=""
	   F2.innerHTML=""}	
	else{
	   F5.style.visibility='visible';
	   NT.style.visibility='visible';
	   S5.style.visibility='visible';
	   var i=s.indexOf("=")
	   var j=s.indexOf("-",i+1)
	   var k=s.indexOf("-",j+1)
	   var v=eval(s.substring(i+1,j))
	   logistics.innerHTML=s.substr(0,s.indexOf("="))+"&nbsp;"+v	
	
	   v=eval(s.substring(j+1,k))
	   F1.innerHTML=s.substr(0,s.indexOf("="))+"&nbsp;"+v
	
	   v=eval(s.substring(k+1,s.length))
	   F2.innerHTML=s.substr(0,s.indexOf("="))+"&nbsp;"+v }	
	}

//for change currency  div

function showfullcurrency()
{
		document.getElementById("currencylist").style.display="none" ;
		document.getElementById("currencylist1").style.display="" ;
}


function hidecurrency()
{
document.getElementById("currencylist").style.display="none" ;
document.getElementById("currencylist1").style.display="none" ;
}


 var chcurrency;

function showcurrencydiv(icd,ict,loc)
{ 

chcurrency=checkajax();

if (chcurrency==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url;

	url="changecurrency.asp?icode="+icd;
	url=url+"&icost="+ict;
	url=url+"&loc="+loc;
	chcurrency.onreadystatechange=fetchcurrencydiv;
	chcurrency.open("GET",url,true);
	chcurrency.send(null);

	
}

function fetchcurrencydiv() 
{ 
	if (chcurrency.readyState==4)
		{
		     document.getElementById("currencydiv").innerHTML=chcurrency.responseText;
		}
		
	else
		{
		 document.getElementById('currencydiv').innerHTML="<table cellpadding=0 cellspacing=0 width=200 border=0 style='background:#ffffff;padding-left:5px' class='darkgreyborder'><tr><td width=200 class='carttext'><img src='../images/loading.gif' / alt=''><b> Loading. Please wait.....</b></td></tr></table>"
		}
}


function checkajax()
{
var check=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  check=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    check=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    check=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return check;

}



//end

//for Shipping Charges  div

function showfullshipping()
{
		document.getElementById("shippinglist").style.display="none" ;
}


function hideshipping()
{
document.getElementById("shippinglist").style.display="none" ;
}


 var ShippingCharges;

function showshippingdiv(icd)
{ 

ShippingCharges=checkShippingajax();

if (ShippingCharges==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url;

	url="shippingcharges.asp?weight="+icd;
	ShippingCharges.onreadystatechange=fetchshippingdiv;
	ShippingCharges.open("GET",url,true);
	ShippingCharges.send(null);
}

function fetchshippingdiv() 
{ 
	if (ShippingCharges.readyState==4)
		{
		     document.getElementById("shippingdiv").innerHTML=ShippingCharges.responseText;
		}
		
	else
		{
		 document.getElementById('shippingdiv').innerHTML="<table cellpadding=0 cellspacing=0 width=200 border=0 style='background:#ffffff;padding-left:5px' class='darkgreyborder'><tr><td width=200 class='carttext'><img src='images/loading.gif' / alt=''><b> Loading. Please wait.....</b></td></tr></table>"
		}
}


function checkShippingajax()
{
var checkShipping=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  checkShipping=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    checkShipping=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    checkShipping=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return checkShipping;

}



//end

function showshipping(){   
	var s=document.getElementById("countries")
	var F5=document.getElementById("F5")
	var S5=document.getElementById("S5")
	var F1=document.getElementById("F1")
	var F2=document.getElementById("F2")
	var NT=document.getElementById("NT")
	var logistics=document.getElementById("logistics")
	s=new String(s.value);
	
	if (s.length==0){
	   F5.style.visibility='hidden';
	   NT.style.visibility='hidden';
	   S5.style.visibility='hidden';
	   logistics.innerHTML=""
	   F1.innerHTML=""
	   F2.innerHTML=""}	
	else{
	   F5.style.visibility='visible';
	   NT.style.visibility='visible';
	   S5.style.visibility='visible';
	   var i=s.indexOf("=")
	   var j=s.indexOf("-",i+1)
	   var k=s.indexOf("-",j+1)
	   var v=eval(s.substring(i+1,j))
	   logistics.innerHTML=s.substr(0,s.indexOf("="))+"&nbsp;"+v	
	
	   v=eval(s.substring(j+1,k))
	   F1.innerHTML=s.substr(0,s.indexOf("="))+"&nbsp;"+v
	
	   v=eval(s.substring(k+1,s.length))
	   F2.innerHTML=s.substr(0,s.indexOf("="))+"&nbsp;"+v }	
	}

function AllowAmount(){
 			val=MM_findObj('Amount'); val=val.value; 				
 			if (window.event.keyCode == 46){ 				
 				if (val.indexOf('.')!=-1) window.event.returnValue=false;	
 				else window.event.returnValue=true; }	
      		else if (window.event.keyCode >= 48 && window.event.keyCode <= 57) {
      			if ((val.indexOf('.') >=1) && (val.indexOf('.')==(val.length-3))) window.event.returnValue=false;
          		else window.event.returnValue=true;}      
        	else window.event.returnValue=false;  }
        	
//Enlarge image.....................


 var productlarge;

function showlargeimage(itemcode,part,tmtoship,opt,cid)
{ 

productlarge=Productenlargecheck();

//document.getElementById(itemcode+'img').src="images/red-magnifier.gif";


if (productlarge==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var url; 
if (opt=='store/') 
  {	url="store/itemenlarge.asp";}
 else if(opt=='')
  { url="itemenlarge.asp"; }  
url=url+"?icode="+itemcode;
url=url+"&part="+part;
url=url+"&tmtoship="+tmtoship;
url=url+"&cid="+cid;



productlarge.onreadystatechange=Productenlargestatus;

productlarge.open("GET",url,true);
productlarge.send(null);

}

function Productenlargestatus() 
{ 
if (productlarge.readyState==4)
	{ 
     window.parent.document.getElementById('showenlargeitem').innerHTML=productlarge.responseText;
	}
	else
	{
	 window.parent.document.getElementById('showenlargeitem').innerHTML="<table cellpadding=0 cellspacing=0 width=200 border=0 style='background:#ffffff;padding-left:5px' class='darkgreyborder'><tr><td width=200 class='carttext'><img src='images/loadingstatus.gif' / alt=''><b> Loading image. Please wait.....</b></td></tr></table>"
	}
}
 
function Productenlargecheck()
{
var productlarge=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  productlarge=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    productlarge=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    productlarge=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return productlarge;
}

//Item large end


function itemdetailpopshowold(itemcd)
{ 

 document.getElementById('info'+itemcd+'').style.display="";
 document.getElementById('imgbg_'+itemcd+'').style.backgroundColor="#CCCCCC";
 document.getElementById(''+itemcd+'OP').style.display="";
}


function itemdetailpophideold(itemcd)
{ 
 document.getElementById('info'+itemcd+'').style.display="none";
 document.getElementById('imgbg_'+itemcd+'').style.backgroundColor="";
 document.getElementById(''+itemcd+'OP').style.display="none";
}
//--------new
function itemdetailpopshow(itemcd) {
  if(document.getElementById('thumbMenu_' + itemcd + '')!= null )
   { document.getElementById('thumbMenu_' + itemcd + '').style.display = "";}
   document.getElementById('imgbg_' + itemcd + '').style.backgroundColor = "#CCCCCC";
   document.getElementById(''+itemcd+'OP').style.display="";

 // if(document.getElementById('secCur_' + itemcd + '')!= null )
   //{document.getElementById('secCur_' + itemcd + '').style.display = "";}
}


function itemdetailpophide(itemcd)
{ 
if(document.getElementById('thumbMenu_' + itemcd + '')!= null )
 {document.getElementById('thumbMenu_'+itemcd+'').style.display="none";}
 document.getElementById('imgbg_'+itemcd+'').style.backgroundColor="";
  document.getElementById(''+itemcd+'OP').style.display="none";

 //if(document.getElementById('secCur_' + itemcd + '')!= null )
 //{document.getElementById('secCur_'+itemcd+'').style.display="none";}

}

//------end



function addTocartList(comp){
 var item=document.getElementById('c'+comp);
 var lval=document.getElementById("cartlist").value; 
 if (item.checked==true){
     if (lval=="")
     lval=item.value
     else
     lval=lval + "," +item.value
     document.getElementById("cartlist").value=lval    }
 else{
    if (lval!="")
       if (lval.indexOf(comp)>=0){
           tval=lval
           if (lval.indexOf(comp)==0)    			
    			lval=tval.substr(lval.indexOf(comp)+comp.length+1,tval.length)
    	   else if (lval.indexOf(comp)+comp.length==lval.length)
    	        lval=tval.substr(0,lval.indexOf(comp)-1)
    	   else
    	        lval=tval.substr(0,lval.indexOf(comp)-1) + tval.substr(lval.indexOf(comp)+comp.length,tval.length)    			
    	   document.getElementById("cartlist").value=lval }
   	}}
   	
 function removeSelected(){ 	
 if (document.getElementById("list").value=="")
   {
    alert ("Please select item.")
    return false;
    }
 else
   {
	document.location.href='navigate-cart.asp?list='+document.getElementById("list").value+'&mode=removewish';
	return false;

	}
}

function addSelected(){
 if (document.getElementById("list").value=="")
   {
    alert ("Please select item.")
    return false;
    }
 else
   {
   document.location.href='navigate-cart.asp?list='+document.getElementById("list").value+'&mode=addshop'+'&loc=W';
   return false;
   }
}

function addToList(comp){
 var item=document.getElementById('c'+comp);
 var lval=document.getElementById("list").value; 
 if (item.checked==true){
     if (lval=="")
     lval=item.value
     else
     lval=lval + "," +item.value
     document.getElementById("list").value=lval    }
 else{
    if (lval!="")
       if (lval.indexOf(comp)>=0){
           tval=lval
           if (lval.indexOf(comp)==0)    			
    			lval=tval.substr(lval.indexOf(comp)+comp.length+1,tval.length)
    	   else if (lval.indexOf(comp)+comp.length==lval.length)
    	        lval=tval.substr(0,lval.indexOf(comp)-1)
    	   else
    	        lval=tval.substr(0,lval.indexOf(comp)-1) + tval.substr(lval.indexOf(comp)+comp.length,tval.length)    			
    	   document.getElementById("list").value=lval }
   	}}
 	
function displaycartquery(icode) {	
     if (icode==undefined)
        alert("Your shopping bag is empty.")
     else {
       s="width=545,height=370,left=150,top=55"
	   s1="itemquery.asp?cartlist="+icode
	   win1=window.open(s1,"",s); }
	}

function checkWholeForm(Lform){
 	var val=false
 	var str
   	str=Lform.loginname.value; 
   	val=validateData(str,'required,max=50,email','Email ID')   	
   	if (val==true){
	  str=Lform.password.value; 
	  val=validateData(str,'required,alnum','Your Password')
   	  if (val==true){
         Lform.submit(); }
      else {
	     Lform.password.focus(); 
	     return false; } }		
    else {
	  Lform.loginname.focus();
	  return false; }
   } 
 
 function checkNewuserForm(NUform) {
 var val=false
 var str
   str=NUform.FName.value
   val=validateData(str,'required,max=30,alpha','First Name')
   if (val==true)
    {str=NUform.lname.value;  val=validateData(str,'max=30,alpha','Last Name')
   if (val==true)
	{str=NUform.YEmail.value; val=validateData(str,'required,max=50,email','Email ID')
   if (val==true)
   	{if (str!=NUform.CEmail.value)
   		{alert('Confirm Email ID does not match Email ID');
   		 NUform.CEmail.focus();
   		 return false;}
	   else	
	   	{return true;}
	}
   	else
   	{NUform.YEmail.focus();
   	 return false;}}
	else
	{NUform.lname.focus();
	 return false;}}		
    else
	{NUform.FName.focus();
	 return false;}} 
	 
	 
	 // for Dresses-Fabric option


var Fabrictlist;

function ShowFabricList(icode,msid)
{ 

document.getElementById('choosecustomfabric').style.display="";
if (icode!="Category")
{
document.getElementById('Fabric').style.display="none";
}

Fabrictlist=Fabriccheck();

if (Fabrictlist==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var url="fabric_opener.asp?msid="+msid+"&icode="+icode;

Fabrictlist.onreadystatechange=Fabricchecktatus;
Fabrictlist.open("GET",url,true);
Fabrictlist.send(null);

}

function Fabricchecktatus() 
{ 
if (Fabrictlist.readyState==4)
	{ 
     document.getElementById('choosecustomfabric').innerHTML=Fabrictlist.responseText;
	}
	else
	{
	 document.getElementById('choosecustomfabric').innerHTML="<table cellpadding=0 cellspacing=0 width=200 border=0 style='background:#ffffff;padding-left:5px' class='darkgreyborder'><tr><td width=200 class='carttext'><img src='../images/loadingstatus.gif' / alt=''><b> Loading, Please wait.....</b></td></tr></table>"
	}
}
 
function Fabriccheck()
{
var Fabrictlist=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  Fabrictlist=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    Fabrictlist=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    productlarge=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return Fabrictlist;
}


//end 

function selectFabric(icode,fcode,msid)
{

window.parent.location.href='dresses.asp?icode='+icode+'&msid='+msid+'&fcode='+fcode+'&C=1';

}
   
   
function show(id)
{
document.getElementById(id).style.display="";
}
function hide(id)
{
document.getElementById(id).style.display="none";
}

function verifysearchkeyword(st)
{
var keyword=document.getElementById('Keyword').value;
        if (keyword=="")
        {
        alert("Please enter keyword for search!");
        document.search.Keyword.focus();
        return false;
        }
        else
        {
        document.search.action=st+'search.asp?keyword='+keyword;
        //document.search.submit();
        }
}



var xmlheaderobj;
var page1;
function showhead(page)
{  
page1=page;
xmlheaderobj=GetXmlHttpObjheader();
var currentDate = new Date()
if (xmlheaderobj==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
 
   if(page=='y')
 {

var url="customersignin.asp?check="+currentDate.getMilliseconds();
 }
 else
 {
 var url="store/customersignin.asp?check="+currentDate.getMilliseconds();
  }
xmlheaderobj.onreadystatechange=stateChangedheader;

xmlheaderobj.open("GET",url,true);
xmlheaderobj.send(null);

}

function stateChangedheader() 
{ 
if (xmlheaderobj.readyState==4)
	{ 

          document.getElementById("fwsigncust").innerHTML=xmlheaderobj.responseText;

          if(xmlheaderobj.responseText !="") 
           	 {
       	 	document.getElementById("fwsigncust").className="redprice";
      	 	document.getElementById("fwsigncust").style.paddingLeft=0 ;
      	 	    if(page1=='y')
      	 	    {
      	 	    document.getElementById("fwsign").innerHTML="&nbsp;<a href='loginform.asp' title='My Account' class='txtDefault'>My Account<\/a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='logout.asp' title='Sign Out' class='txtDefault'>Sign Out<\/a>" ;
      	 	    }
      	 	    else
      	 	    {
      	 	    document.getElementById("fwsign").innerHTML="&nbsp;<a href='store/loginform.asp' title='My Account' class='txtDefault'>My Account<\/a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='store/logout.asp' title='Sign Out' class='txtDefault'>Sign Out<\/a>" ;

      	 	    }
      	 }
      	 else
	     {
	        if(page1=='y')
      	 	    {
	           document.getElementById("fwsign").innerHTML="&nbsp;<a href='loginform.asp' title='My Account' class='txtDefault'>My Account<\/a>" ;
	           }
	           else
	           {
	           document.getElementById("fwsign").innerHTML="&nbsp;<a href='store/loginform.asp' title='My Account' class='txtDefault'>My Account<\/a>" ;

	           }
	     }
  
	}
}
 
function GetXmlHttpObjheader()
{
var xmlhead=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlhead=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlhead=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlhead=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlhead;
}

//--------itemsizecart
var itemSize;
var sizeIcode="";
var checkurlitemsize="";

function showitemSize(itemcode,mode,storelink) {
    
    var chk;
    sizeIcode=itemcode;
    
    chk = new Date().getTime();
    itemSize = itemquickviewcache();
  
    if (itemSize == null) {
        alert("Your browser does not support AJAX!");
        return;
    }

    var url = storelink +"viewsize.asp";
    url = url + "?itemcode=" + sizeIcode + "&mode="+mode+"&dt="+chk ;
    checkurlitemsize=storelink;
    if (checkurlitemsize=='store/')
	{
	 url=url +"&link=Y";	
	}
	else
	{
	 url=url;	
	}
 
    itemSize.onreadystatechange = itemSizestatus;
    itemSize.open("GET", url, true);
    itemSize.send(null);

}

function itemSizestatus() {
document.getElementById("thumbSize_" + sizeIcode).style.display = "";
    if (itemSize.readyState == 4) {
        document.getElementById("thumbSize_" + sizeIcode).innerHTML = itemSize.responseText;
    }
    else {
        document.getElementById("thumbSize_" + sizeIcode).innerHTML = "<div style='backgroundcolor=#ffffff; width:100%; position:absolute'><img src='images/loadingcircle.gif' alt=''/></div>";
     
    }
}

function itemquickviewcache() {
    var itemquickviewcache = null;
    try {
        // Firefox, Opera 8.0+, Safari
        itemquickviewcache = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            itemquickviewcache = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            itemquickviewcache = new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    return itemquickviewcache;
}

function sizeview_hide(obj)
{

obj.style.display = "none";


}

function setthumbitemsize(itemcode, size) {


    document.getElementById("itemsize_" + itemcode).value = size;
    document.getElementById("sizeselct_" + itemcode).innerHTML = size;
    document.getElementById("itemsizedrop_" + itemcode).style.display = "none";
}
function showthumbitemsize(itemcode) {


    document.getElementById("itemsizedrop_" + itemcode).style.display = ""
}

function setthumbcolorsize(itemcode, color) {

    document.getElementById("itemcolor_" + itemcode).value = color;
    document.getElementById("colorselct_" + itemcode).innerHTML = color;
    document.getElementById("itemcolordrop_" + itemcode).style.display = "none";
}


function showthumbitemcolor(itemcode) {
   
    document.getElementById("itemcolordrop_" + itemcode).style.display = "";
 
}
function divbackgroundcolor(divid, action) {

    if (action == "over") {
        document.getElementById(divid).style.backgroundColor = "#cccccc";
    }
    else {
  
        document.getElementById(divid).style.backgroundColor = "#ffffff";
    }
}

//<--
 
var xmlHttpsize
var sizeICD

function addtocartwishSize(icd,mode,storelink)
{ 
xmlHttpsize=GetXmlHttpObject();
var checkcondition=0;

var size="";

if (document.getElementById('itemsize_' + icd) != null)
{
    if (document.getElementById('itemsize_' + icd).value == "") {
        alert("Please select your size");
        //return false;
        checkcondition=-1;
    }
    else
    size = document.getElementById('itemsize_' + icd).value;

}

var color="";

if (document.getElementById('itemcolor_' + icd) != null && checkcondition!=-1)
{
    if (document.getElementById('itemcolor_' + icd).value == "") {
        alert("Please select your desired color");
        checkcondition=-1;
    }
    else
    color = document.getElementById('itemcolor_' + icd).value;
}



var typeid="";
if (document.getElementById('typeid_' + icd) != null)
{
    typeid=document.getElementById('typeid_' + icd).value;
}

var cid="";
if (document.getElementById('cid_' + icd) != null)
{
    cid=document.getElementById('cid_' + icd).value;
}

sizeICD = icd;

if (xmlHttpsize==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
if(checkcondition==0)
  {
if (mode=='addshop')
	{		
	    showcartpopNew(icd,"Adding item to<br />Shopping bag");		
	}
else if (mode=='addwish')
	{
	    showcartpopNew(icd,"Adding item to<br />Wish list");		
	}

var url=storelink +"navigate-cart.asp";
url=url+"?icode="+icd;
url=url+"&mode="+mode;
if(size!="")
{
    url=url+"&size="+size;
}
if(color!="")
{
    url=url+"&IAColor="+color;
}

if(typeid!="")
{
    url=url+"&typeid="+typeid;
}

if(cid!="")
{
    url=url+"&cid="+cid;
}
checkurlsize=storelink;
xmlHttpsize.onreadystatechange=stateChangedSize;
xmlHttpsize.open("GET",url,true);
xmlHttpsize.send(null);
}
}
var checkurlsize;   
function stateChangedSize() 
{ 
if (xmlHttpsize.readyState==4)

    if (checkurlsize=='store/')
	{
	 showminicart('Y');	
	 cart('Y');	
	}
	else
	{
     showminicart('N');	
     cart('N');	
	}
    document.getElementById('thumbSize_'+sizeICD).style.display = "none";
}


function hidethumbSize(obj)
{
obj.style.display = "none";
}


// javascript for header drop down

function CurrencySelection(loc)
{

        if (loc=="EUR")
        {
        document.getElementById('EUR').style.backgroundColor='#cccccc';
        document.getElementById('GBP').style.backgroundColor='#ffffff';
        document.getElementById('CAD').style.backgroundColor='#ffffff';
        document.getElementById('AUD').style.backgroundColor='#ffffff';
        document.getElementById('INR').style.backgroundColor='#ffffff';
        document.getElementById('USD').style.backgroundColor='#ffffff';
        document.getElementById('MYR').style.backgroundColor='#ffffff';
        document.getElementById('NZD').style.backgroundColor='#ffffff';
        document.getElementById('AED').style.backgroundColor='#ffffff';
        document.getElementById('PKR').style.backgroundColor='#ffffff';
        document.getElementById('ZAR').style.backgroundColor='#ffffff';
        
        }
        else if (loc=="GBP")
        {
        document.getElementById('EUR').style.backgroundColor='#ffffff';
        document.getElementById('GBP').style.backgroundColor='#cccccc';
        document.getElementById('CAD').style.backgroundColor='#ffffff';
        document.getElementById('AUD').style.backgroundColor='#ffffff';
        document.getElementById('INR').style.backgroundColor='#ffffff';
        document.getElementById('USD').style.backgroundColor='#ffffff';
        document.getElementById('MYR').style.backgroundColor='#ffffff';
        document.getElementById('NZD').style.backgroundColor='#ffffff';
        document.getElementById('AED').style.backgroundColor='#ffffff';
        document.getElementById('PKR').style.backgroundColor='#ffffff';
        document.getElementById('ZAR').style.backgroundColor='#ffffff';
        }
        else if (loc=="CAD")
        {
        document.getElementById('EUR').style.backgroundColor='#ffffff';
        document.getElementById('GBP').style.backgroundColor='#ffffff';
        document.getElementById('CAD').style.backgroundColor='#cccccc';
        document.getElementById('AUD').style.backgroundColor='#ffffff';
        document.getElementById('INR').style.backgroundColor='#ffffff';
        document.getElementById('USD').style.backgroundColor='#ffffff';
        document.getElementById('MYR').style.backgroundColor='#ffffff';
        document.getElementById('NZD').style.backgroundColor='#ffffff';
        document.getElementById('AED').style.backgroundColor='#ffffff';
        document.getElementById('PKR').style.backgroundColor='#ffffff';
        document.getElementById('ZAR').style.backgroundColor='#ffffff';
        }
        else if (loc=="AUD")
        {
        document.getElementById('EUR').style.backgroundColor='#ffffff';
        document.getElementById('GBP').style.backgroundColor='#ffffff';
        document.getElementById('CAD').style.backgroundColor='#ffffff';
        document.getElementById('AUD').style.backgroundColor='#cccccc';
        document.getElementById('INR').style.backgroundColor='#ffffff';
        document.getElementById('USD').style.backgroundColor='#ffffff';
        document.getElementById('MYR').style.backgroundColor='#ffffff';
        document.getElementById('NZD').style.backgroundColor='#ffffff';
        document.getElementById('AED').style.backgroundColor='#ffffff';
        document.getElementById('PKR').style.backgroundColor='#ffffff';
        document.getElementById('ZAR').style.backgroundColor='#ffffff';

        }
        else if (loc=="INR")
        {
        document.getElementById('EUR').style.backgroundColor='#ffffff';
        document.getElementById('GBP').style.backgroundColor='#ffffff';
        document.getElementById('CAD').style.backgroundColor='#ffffff';
        document.getElementById('AUD').style.backgroundColor='#ffffff';
        document.getElementById('INR').style.backgroundColor='#cccccc';
        document.getElementById('USD').style.backgroundColor='#ffffff';
        document.getElementById('MYR').style.backgroundColor='#ffffff';
        document.getElementById('NZD').style.backgroundColor='#ffffff';
        document.getElementById('AED').style.backgroundColor='#ffffff';
        document.getElementById('PKR').style.backgroundColor='#ffffff';
        document.getElementById('ZAR').style.backgroundColor='#ffffff';

        }
        else if (loc=="USD")
        {
        document.getElementById('EUR').style.backgroundColor='#ffffff';
        document.getElementById('GBP').style.backgroundColor='#ffffff';
        document.getElementById('CAD').style.backgroundColor='#ffffff';
        document.getElementById('AUD').style.backgroundColor='#ffffff';
        document.getElementById('INR').style.backgroundColor='#ffffff';
        document.getElementById('USD').style.backgroundColor='#cccccc';
        document.getElementById('MYR').style.backgroundColor='#ffffff';
        document.getElementById('NZD').style.backgroundColor='#ffffff';
        document.getElementById('AED').style.backgroundColor='#ffffff';
        document.getElementById('PKR').style.backgroundColor='#ffffff';
        document.getElementById('ZAR').style.backgroundColor='#ffffff';
        }
        else if (loc=="MYR")
        {
        document.getElementById('EUR').style.backgroundColor='#ffffff';
        document.getElementById('GBP').style.backgroundColor='#ffffff';
        document.getElementById('CAD').style.backgroundColor='#ffffff';
        document.getElementById('AUD').style.backgroundColor='#ffffff';
        document.getElementById('INR').style.backgroundColor='#ffffff';
        document.getElementById('USD').style.backgroundColor='#ffffff';
        document.getElementById('MYR').style.backgroundColor='#cccccc';
        document.getElementById('NZD').style.backgroundColor='#ffffff';
        document.getElementById('AED').style.backgroundColor='#ffffff';
        document.getElementById('PKR').style.backgroundColor='#ffffff';
        document.getElementById('ZAR').style.backgroundColor='#ffffff';
        }
        else if (loc=="NZD")
        {
        document.getElementById('EUR').style.backgroundColor='#ffffff';
        document.getElementById('GBP').style.backgroundColor='#ffffff';
        document.getElementById('CAD').style.backgroundColor='#ffffff';
        document.getElementById('AUD').style.backgroundColor='#ffffff';
        document.getElementById('INR').style.backgroundColor='#ffffff';
        document.getElementById('USD').style.backgroundColor='#ffffff';
        document.getElementById('MYR').style.backgroundColor='#ffffff';
        document.getElementById('NZD').style.backgroundColor='#cccccc';
        document.getElementById('AED').style.backgroundColor='#ffffff';
        document.getElementById('PKR').style.backgroundColor='#ffffff';
        document.getElementById('ZAR').style.backgroundColor='#ffffff';
        }
        else if (loc=="AED")
        {
        document.getElementById('EUR').style.backgroundColor='#ffffff';
        document.getElementById('GBP').style.backgroundColor='#ffffff';
        document.getElementById('CAD').style.backgroundColor='#ffffff';
        document.getElementById('AUD').style.backgroundColor='#ffffff';
        document.getElementById('INR').style.backgroundColor='#ffffff';
        document.getElementById('USD').style.backgroundColor='#ffffff';
        document.getElementById('MYR').style.backgroundColor='#ffffff';
        document.getElementById('NZD').style.backgroundColor='#ffffff';
        document.getElementById('AED').style.backgroundColor='#cccccc';
        document.getElementById('PKR').style.backgroundColor='#ffffff';
        document.getElementById('ZAR').style.backgroundColor='#ffffff';
        }
        else if (loc=="PKR")
        {
        document.getElementById('EUR').style.backgroundColor='#ffffff';
        document.getElementById('GBP').style.backgroundColor='#ffffff';
        document.getElementById('CAD').style.backgroundColor='#ffffff';
        document.getElementById('AUD').style.backgroundColor='#ffffff';
        document.getElementById('INR').style.backgroundColor='#ffffff';
        document.getElementById('USD').style.backgroundColor='#ffffff';
        document.getElementById('MYR').style.backgroundColor='#ffffff';
        document.getElementById('NZD').style.backgroundColor='#ffffff';
        document.getElementById('AED').style.backgroundColor='#ffffff';
        document.getElementById('PKR').style.backgroundColor='#cccccc';
        document.getElementById('ZAR').style.backgroundColor='#ffffff';
        }
        else if (loc=="ZAR")
        {
        document.getElementById('EUR').style.backgroundColor='#ffffff';
        document.getElementById('GBP').style.backgroundColor='#ffffff';
        document.getElementById('CAD').style.backgroundColor='#ffffff';
        document.getElementById('AUD').style.backgroundColor='#ffffff';
        document.getElementById('INR').style.backgroundColor='#ffffff';
        document.getElementById('USD').style.backgroundColor='#ffffff';
        document.getElementById('MYR').style.backgroundColor='#ffffff';
        document.getElementById('NZD').style.backgroundColor='#ffffff';
        document.getElementById('AED').style.backgroundColor='#ffffff';
        document.getElementById('PKR').style.backgroundColor='#ffffff';
        document.getElementById('ZAR').style.backgroundColor='#cccccc';
        }
        
        

}

var CurrDropDown = 0;
var Noteloc;

function SetSecCurrlistDropDown(loc) {


	
	CurrDropDown = GetSetSecCurr();

	var checktt = 0;

checktt = new Date().getTime();

	if (CurrDropDown == null) {
		alert("Your browser does not support AJAX!");
		return;
	}

	var url = 0;
	if (loc == "") {
		url = "../store/CurrencyDropDown.asp";
	}
	else if (loc == "HOME") {
		url = "store/CurrencyDropDown.asp";
	}
	else
	 {
		url = "store/CurrencyDropDown.asp";
	}
	url = url + "?loc=" + loc;
	url = url + "&chkt=" + checktt;
	Noteloc=loc;

	CurrDropDown.onreadystatechange = stateChangedSetDropCur;

	CurrDropDown.open("GET", url, true);
	CurrDropDown.send(null);

}

function stateChangedSetDropCur() {
	if (CurrDropDown.readyState == 4) {
		document.getElementById('currencydropdown').innerHTML = CurrDropDown.responseText;
	}
}



var SetSecCurr;

function SetSecCurrlist(curname) {

	SetSecCurr = GetSetSecCurr();

	var checkt = 0;
	var url;

	checkt = new Date().getTime();


	if (SetSecCurr == null) {
		alert("Your browser does not support AJAX!");
		return;
	}
	if (Noteloc == "") {
		url = "../include/set-sec-currency.asp";
	}
	else
	 {
		url = "include/set-sec-currency.asp";
	}

	url = url + "?currency=" + curname;
	url = url + "&loc=header";
	url = url + "&icode=nocode";
	url = url + "&chkt=" + checkt;

	SetSecCurr.onreadystatechange = stateChangedSetSecCurr;

	SetSecCurr.open("GET", url, true);
	SetSecCurr.send(null);

}

function stateChangedSetSecCurr() {
	if (SetSecCurr.readyState == 4) {
		document.getElementById('Shortcurrencylist').style.display = 'none';
		document.getElementById('currencyChangemsg').style.display = '';
		document.getElementById('currencyChangemsg').innerHTML = SetSecCurr.responseText;
		setTimeout("location.reload(true);", 3000);
	}
}


function GetSetSecCurr() {
	var SetSecCurr = null;
	try {
		// Firefox, Opera 8.0+, Safari
		SetSecCurr = new XMLHttpRequest();
	}
	catch (e) {
		// Internet Explorer
		try {
			SetSecCurr = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			SetSecCurr = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return SetSecCurr;
}


//Currency List

function ShowCurrencylisting(mouse) {
	if (mouse == "OVER") {
		document.getElementById('currencyChangemsg').style.display = 'none'
		document.getElementById('Shortcurrencylist').style.display = ''
	}
	else {
		document.getElementById('Shortcurrencylist').style.display = 'none'
	}

}

//Currency List end


function DisAllowSplCharacters(e,id)
{     
    var val1=DisAllowApostrophe(e,id);
    var val2=DisAllowSpaceAsFirstChar(e,id);
    if(val1==false)return false;
    if(val2==false)return false;
    
    var browserchk = window.event ? e.keyCode : e.which;
	if(browserchk ==39)return false;  // apostrophe(39)
	if(browserchk==40 || browserchk==41 || browserchk==45)
    {
         return true;
    }
	if(browserchk >=65 && browserchk <=90)
    {
         return true;
    }
    if(browserchk >=97 && browserchk <=122)
    {
         return true;
    }
    if(browserchk == 46 || browserchk == 44 || browserchk == 47 )
    {
    return true;
    }
	
	if(browserchk >=48 && browserchk <=57)
    {
         return true;
    }
    if(browserchk >=33 && browserchk <=255)
    {
        return false;
    }
}

function DisAllowApostrophe(e,id)
{     
    var val1=DisAllowSpaceAsFirstChar(e,id);
    if(val1==false)return false;
    
    var browserchk = window.event ? e.keyCode : e.which;
	if(browserchk ==39)return false;  //apostrophe(39)
}
function DisAllowSpaceAsFirstChar(e,id)
{
    var browserchk = window.event ? e.keyCode : e.which;
    var chkfirstchar = document.getElementById(id).value;
    
    if(chkfirstchar.length < 1)
    {
        if(browserchk ==32)
        return false; //space(32)
        
    }
}

    var cookval=0; 
//--- free gift code

function addfreeGift(icd,mode,qty)
{ 
if(cookval!=qty)
{
var xmlHttpNew

var dtime ;
dtime = new Date().getTime();

xmlHttpNew=checkajax();

if (xmlHttpNew==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
if (mode=='add')
	{
	    showcartpopNew(icd,"Adding item to<br/>Gift Box");	
	    	
	}

var url="../store/freegiftcookies.asp";
url=url+"?icode="+icd;
url=url+"&mode="+mode;


if(mode=='add')
{url=url+"&iqty="+qty;}

url=url + "&dt="+dtime;


xmlHttpNew.onreadystatechange= function()
{
if (xmlHttpNew.readyState==4)
	{ 
      showGiftbox(qty);	
	}

}

xmlHttpNew.open("GET",url,true);
xmlHttpNew.send(null);
}
}

function showGiftbox(qty)
{ 

var xmlHttpobj

xmlHttpobj=checkajaxfree();

var datime;
datime= new Date().getTime();

if (xmlHttpobj==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

 
var urll;  

urll="../store/showfreegift.asp" ; 
urll=urll+"?freegift=" + get_cookie('freegift');

urll =urll + "&dt="+datime;
 
//alert(urll);

xmlHttpobj.onreadystatechange= function(){

if (xmlHttpobj.readyState==4)
	{ 
	  window.parent.document.getElementById("Giftbox").innerHTML=xmlHttpobj.responseText;
        var cookarr;
        cookval =document.getElementById("additem").innerHTML ;
  
        if(cookval!=0)
        {
            if(parseInt(cookval)== qty)
            {
              
            showsavebox('show');
           
            }
        }
	
	}
 }
	
xmlHttpobj.open("GET",urll,true);
xmlHttpobj.send(null);

}



function checkajaxfree() {
	var checkfree = null;
	try {
		// Firefox, Opera 8.0+, Safari
		checkfree = new XMLHttpRequest();
	}
	catch (e) {
		// Internet Explorer
		try {
			checkfree = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			checkfree = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return checkfree;

}


//---

var imagechk="";
function enlargefreegift(ficode,showhide)
{
if (showhide=="show")
{

    if(showhide!="")
    {
    
    if(document.getElementById("freeenlargeshowhide_"+ficode)!= null)
        {
        
           document.getElementById("freeenlargeshowhide_"+ficode).style.display="none";
          
        }
    }
document.getElementById("freeenlargeshowhide_"+ficode).style.display="";

}
else
{
document.getElementById("freeenlargeshowhide_"+ficode).style.display="none";
}

imagechk = ficode ;

}


function showsavebox(act)
{

if(act=="show")
{
document.getElementById('showenlargeitem').style.display="";
}
else
{
document.getElementById('showenlargeitem').style.display="none";
}

}
/// end of Free Gift

//Mini cart Module

var xmlHttpobj7

function cart(opt)
{ 

xmlHttpobj7=GetXmlHttpObject7();


if (xmlHttpobj7==null)

  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var urll;  
 if (opt=='Y') 
  {	urll="store/cart.asp";}
 else if(opt=='N')
  { urll="cart.asp"; }	


urll=urll+"?cart="+get_cookie('cart');
urll=urll+"&DScart="+get_cookie('DScart');
urll=urll+"&indx="+opt ;


xmlHttpobj7.onreadystatechange=stateChangedfun7;
xmlHttpobj7.open("GET",urll,true);
xmlHttpobj7.send(null);

}

function stateChangedfun7() 
{ 
if (xmlHttpobj7.readyState==4)

	{ 
	window.parent.document.getElementById("minicart").innerHTML=xmlHttpobj7.responseText;

	}
}


function get_cookie ( cookie_name )
{
  var results = document.cookie.match ( cookie_name + '=(.*?)(;|$)' );

  if ( results )
    return ( unescape ( results[1] ) );
  else
    return null;
}


function GetXmlHttpObject7()
{
var xmlHttpobj7=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttpobj7=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttpobj7=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttpobj7=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttpobj7;

}
function checktagval()
{
  var tag=document.SLtagform.tag.value;
  var cidref=document.SLtagform.cidref.value;
  var icode=document.SLtagform.icode.value;
if (tag=="")
{
	alert("Please enter your tag.");	
}
else if (tag.length >100)
{
alert("Please enter your tag not more than 100 character.");	
}

else
{
		centerWindowX('submit.asp?ItemCode='+icode+'&tag='+tag+'&mode=tagsub&cid='+cidref+'');			
	}
}





