
function displaylarge(icode){	
	s="border:raised;dialogHeight:600px;dialogWidth:680px;center:yes;help:no;resizeable:no;scroll:yes;status:no;"
	s1="item-super-large.asp?icode="+ icode 
	if (window.showModalDialog){   
        win1=window.showModalDialog(s1,"",s) }
        else{
       win1=window.open(s1,"","width=680,height=600,left=100,top=50")}
	}
function showcountrylist(){	
	countrylist.style.visibility="visible"
}

function addToCart() { 	
		document.form1.mode.value="addshop";
  		document.form1.submit(); }
  	
function addToWlist() {
  	document.form1.mode.value="addwish";  	
  	document.form1.submit(); } 
  	
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 removeSelected(){ 	
 if (document.getElementById("list").value=="")
    alert ("Please select item.")
 else
	document.location.href='navigate-cart.asp?list='+document.getElementById("list").value+'&mode=removewish';
}

function addSelected(){
 if (document.getElementById("list").value=="")
    alert ("Please select item.")
 else
   document.location.href='navigate-cart.asp?list='+document.getElementById("list").value+'&mode=addshop'+'&loc=W';
}

function displayquery(icode) {	 
     if (icode==undefined)
        alert("Your Wishilst is Empty.")
     else
       {
       s="width=545,height=370,left=150,top=55"
	   s1="itemquery.asp?list="+icode
	   win1=window.open(s1,"",s) 
	   }
	}

function SaveList(list){
     if (list==undefined)
        alert("Your Wishilst is Empty.");
     else      
        document.location.href='login.asp?loc=W';   
   }
   
function MailTo(list) { 
   if (list==undefined)
        alert("Your Wishilst is Empty."); 
   else{
        s="width=545,height=365,left=150,top=55"
		s1="MailtoFriend.asp?list="+ list 
		win1=window.open(s1,"",s)  
		return false;  }
   }

function Registernow(ucat){
  if (ucat=='B')
    path='../b2b/newuser.asp';
  else if(ucat=='R')
    path='resellerform.asp'    
  else
	path='newuser.asp'  
  MM_openBrWindow(path,'','')
  window.close()
}

function submitquote()  {
    MM_validateForm('Requirement','','R','Name','','R','Email','','RisEmail','Country','','R');   
    if (document.MM_returnValue){ 
       val=document.form1.itemcode.value
       val=val+'.;'+document.form1.CompanyName.value;
       val=val+'.;'+document.form1.Requirement.value;
       val=val+'.;'+document.form1.Name.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;
       val=val+'.;'+document.form1.Address.value;
       val=val+'.;'+document.form1.City.value;
       val=val+'.;'+document.form1.PIN.value;
       val=val+'.;'+document.form1.Country.value+'.;';       
       centerWindow('submit.asp?val='+val+'&mode=quotes'); 
       return false; }
   else
     return false;
  }  

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.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=inquiry');                    
		}      
      }
  } 

function setCode(){
    window.event.returnValue=false; }
   
function submitMailTo()  {
    MM_validateForm('subject','','R','Femail','','RisEmail','Comments','','R');
    if (document.MM_returnValue)
    { 
    	if (checkmail(document.form1.FEmail.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.FName.value;       
       val=val+'-'+document.form1.FEmail.value;            
       val=val+'-'+document.form1.subject.value;+'.;';
       centerWindow('submit.asp?val='+val+'&mode=mailto');                    
     }
     }
  }  

function submitWebquery(){
    MM_validateForm('comments','','R','Name','','R','Email','','RisEmail');
    if (document.MM_returnValue){ 
       val=document.form1.Comments.value;
       val=val+'.;'+document.form1.Name.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=query');       
       return false; }
   else
     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 submitrequest(){ 
    MM_validateForm('email','','RisEmail','icode','','R');
   if (document.MM_returnValue){ 
       val=document.frmdeal.email.value 
       val1=document.frmdeal.icode.value         
       centerWindow('submit.asp?email='+val+'&icode='+val1+'&mode=request');} 
         }

function updatecart(){
document.f1.action="updatecart.asp"
document.f1.submit()}

function submitTquery(icode)
{ 
var val=checkSareeLarge();
if (val==true){
       val=document.form2.Comments.value;
       val=val+'.;'+document.form2.Name.value;
       val=val+'.;'+document.form2.mail.value;
 	   val=val+'.;'+document.form2.prdinfo.value;
 	   val=val+'.;'+document.form2.typos.value;
 	   val=val+'.;'+document.form2.loadtime.value;
 	   val=val+'.;'+document.form2.todaydeals.value;
       centerWindowX('submit.asp?val='+val+'&mode=querysaree'+'&icode='+icode); 
       document.form2.reset()}
else{return false;}}
