function displayquote(icode) {	
     s="border:raised;dialogHeight:370px;dialogWidth:545px;center:yes;help:no;resizeable:no;scroll:no;status:no;"
     s1="itemquery.asp?icode="+ icode ;
     if (window.showModalDialog) {   
        win1=window.showModalDialog(s1,"",s)}
     else{
        win1=window.open(s1,"","width=545,height=455,left=10,top=5") }       
  }	
  
function displaybig(pic){
	var h1=550
	var w1=750
	s="border:raised;dialogHeight:" + h1 + "px;dialogWidth:" + w1 + "px;center:yes;help:no;resizeable:no;scroll:Yes;status:no;"
	s1="Superenlarge.asp?icode="+ pic
	win1=window.showModalDialog(s1,"",s)
	}

function displaybigE(icode){	
	s="border:raised;dialogHeight:550px;dialogWidth:700px;center:yes;help:no;resizeable:yes;scroll:yes;status:no;"
	s1="Embroiderylarge.asp?icode="+ icode 
	if (window.showModalDialog){   
        win1=window.showModalDialog(s1,"",s) }
        else{
       win1=window.open(s1,"","width=680,height=550,left=100,top=50")}
	 }

function displayenlarge(icode){ 
	window.open("superenlarge.asp?icode=" + icode,"win1","width=750,height=500,left=10,top=5");
}
	
function displayquoteE(icode){	
	s="border:raised;dialogHeight:500px;dialogWidth:600px;center:yes;help:no;resizeable:no;scroll:yes;status:no;"
	s1="quoteform.asp?icode="+ icode 
	if (window.showModalDialog){   
        win1=window.showModalDialog(s1,"",s) }
        else{
       win1=window.open(s1,"","width=650,height=500,left=100,top=50")}
	}
	
	
function showcountrylist(){	
	countrylist.style.visibility="visible"
}

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
	
	//logistics.innerHTML=s.substr(0,s.indexOf("="))+"&nbsp;"+v
	document.getElementById("logistics1").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 }	
	}

function addToCart() { 	
		document.form1.mode.value="addshop";
  		document.form1.submit(); }

function addToCartJewelry()
{
  var cid=document.form1.cid.value;
  var typeid=document.form1.typeid.value;

  if(document.form1.size=='[object]')
    {
     if (document.form1.size.selectedIndex==0)
     
	    alert("Please select your size.");
	 
    
	else
	 {		
		document.form1.mode.value="addshop";
  		document.form1.submit();   		
     }
  }
  else
   {
   		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 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.")
 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 displaycartquery() {
var icode;
icode =document.getElementById('cartquerylist').value;
     if (icode==undefined)
        alert("Your shoppingcart is empty.")
     else {
       s="width=545,height=370,left=150,top=55"
	   s1="itemquery.asp?cartlist="+icode
	   win1=window.open(s1,"",s); }
	}


function SaveList(list){
     if (list==undefined)
        alert("Your Wishilst is Empty.");
     else      
        document.location.href='loginform.asp?loc=w';   
   }
   
function MailTo(list) { 
   if (list==undefined)
        alert("Your Wishilst is Empty."); 
   else{
        s="width=545,height=400,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 submitCartQuery(){
    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=cartquery');}
    }
    }



 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;}
    }
    

// function for show shopping cart popup     
    
  var pp
  function ShowCartPopup(event,title,txt,w,h) {
  	pp=window.createPopup()
	var pbody=pp.document.body
	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(365,250,w,h,document.body)

    setTimeout("pp.hide()", 3000);
	
	}
  
// show shopping cart popup end 

// Ajax function for add to cart and wishlist
  
var xmlHttp1

function addtocartwish (icd,mode)
{ 
xmlHttp1=GetXmlHttpObject();


if (xmlHttp1==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
if (mode=='addshop')
	{		
			if(navigator.appName == "Microsoft Internet Explorer")
				{
			  	 ShowCartPopup(event,'','Adding item to shopping cart','235','60');
			    }
			else{			 
			 	 //confirm("Adding item to shopping cart?");
			 	// window.open(url,'name','height=200,width=150');
			  	}
	}
else if (mode=='addwish')
	{
			if(navigator.appName == "Microsoft Internet Explorer")
				{
				  ShowCartPopup(event,'','Adding item to wish list','235','60');
				 } 
			else{			 
				 // confirm("Adding item to wish list?");
				 } 
	}

var url="navigate-cart.asp";
url=url+"?icode="+icd;
url=url+"&mode="+mode;


xmlHttp1.onreadystatechange=stateChanged1;

xmlHttp1.open("GET",url,true);
xmlHttp1.send(null);

}
  
  
function stateChanged1() 
{ 
if (xmlHttp1.readyState==4)
	{ 
   showminicart('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;

}

 
// Ajax end   

var xmlHttpobj

function showminicart(opt)
{ 

xmlHttpobj=GetXmlHttpObject1();


if (xmlHttpobj==null)

  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var urll;  
 if (opt=='Y') 
  {	urll="pages/minishopcart.asp";}
 else if(opt=='N')
  { urll="../pages/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)
	{ 
	//document.getElementById("mini").innerHTML=xmlHttpobj.responseText;
	window.parent.document.getElementById("mini").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//


//email to friend
function Validate()
{

  var flag=document.MailtoFriend.flag.value;
  var cid=document.MailtoFriend.cid.value;
  var icode=document.MailtoFriend.icode.value;
  var price=document.MailtoFriend.price.value;
  var iname=document.MailtoFriend.iname.value;

if (document.MailtoFriend.FEmail1.value=="")
{
	alert("Please enter your friend's email address");
	document.MailtoFriend.FEmail1.focus();	
}

else if (document.MailtoFriend.YEmail.value=="")
{
	alert("Please enter your email address");
	document.MailtoFriend.YEmail.focus();	
}

else if (document.MailtoFriend.YName.value=="")
{
	alert("Please enter your name");
	document.MailtoFriend.YName.focus();	
}

else
{
		centerWindowX('submit.asp?ItemCode='+icode+'&iname='+iname+'&mode=EmailtoFreind&cid='+cid+'&Email1='+document.MailtoFriend.FEmail1.value+'&Email2='+document.MailtoFriend.FEmail2.value+'&Email3='+document.MailtoFriend.FEmail3.value+'&Email4='+document.MailtoFriend.YEmail.value+'&Custname='+document.MailtoFriend.YName.value+'&messg='+document.MailtoFriend.comments.value+'&flag='+flag+'');	
		document.MailtoFriend.reset();
}

}				
//email to friend


// review item 


function ItemReviewPage()
{
	
	
  var IReview=document.reviewform.review.value;
  var cidref=document.reviewform.cidreview.value;
  var icode=document.reviewform.reviewcode.value;
  
if (IReview=="")
{
	alert("Please enter your Review.");	
}
else
	{
		centerWindowX('submit.asp?ItemCode='+icode+'&IReview='+IReview+'&mode=ItemReview&cid='+cidref+'');
		document.reviewform.reset();
		
	}
}

//Review item


//Rate and Tag

function getSelectedCheckbox(buttonGroup) {
   var retArr = new Array();
   var lastElement = 0;
   if (buttonGroup[0]) { // if the button group is an array (one check box is not an array)
      for (var i=0; i<buttonGroup.length; i++) {
         if (buttonGroup[i].checked) {
            retArr.length = lastElement;
            retArr[lastElement] = i;
            lastElement++;
         }
      }
   } else { // There is only one check box (it's not an array)
      if (buttonGroup.checked) { // if the one check box is checked
         retArr.length = lastElement;
         retArr[lastElement] = 0; // return zero as the only array value
      }
   }
   return retArr;
} // Ends the 

function getSelectedCheckboxValue(buttonGroup) {
   var retArr = new Array(); // set up empty array for the return values
   var selectedItems = getSelectedCheckbox(buttonGroup);
   if (selectedItems.length != 0) { // if there was something selected
      retArr.length = selectedItems.length;
      for (var i=0; i<selectedItems.length; i++) {
         if (buttonGroup[selectedItems[i]]) { // Make sure it's an array
            retArr[i] = buttonGroup[selectedItems[i]].value;
         } else { // It's not an array (there's just one check box and it's selected)
            retArr[i] = buttonGroup.value;// return that value
         }
      }
   }
   return retArr;
} // Ends 


function submitform()
{
var ratecode=document.ratingform.ItemCode.value;
var val=getSelectedCheckboxValue(document.ratingform.rating);
if (val=="")
{
	alert("Please select one of the star to rate the item.");	
}
else
	{
		centerWindowX('submit.asp?ItemCode='+ratecode+'&rating='+val+'&mode=rating');			
	}
}


function checkSubmit()
{
  var tag=document.tagform.tag.value;
  var cidref=document.tagform.cidref.value;
  var icode=document.tagform.icode.value;
if (tag=="")
{
	alert("Please enter your tag.");	
}
else
{
		centerWindowX('submit.asp?ItemCode='+icode+'&tag='+tag+'&mode=tagsub&cid='+cidref+'');			
	}
}

// Rate and Tag


// Show item detail pop up 


var tempcode=0;

function viewclose(icode)
{
  document.getElementById('info'+icode+'').innerHTML=""
  document.getElementById(itemcode+'img').src="images/magnifier.jpg";

}


function closeitemhide(icode)
{
	alert('HideItemCheck'+icode+'');

  document.getElementById('HideItemCheck'+icode+'').innerHTML=""
  
}

function itemdetailpopshow(itemcd)
{ 

 document.getElementById('info'+itemcd+'').style.display="";
 document.getElementById('imgbg_'+itemcd+'').style.backgroundColor="#CCCCCC";
 document.getElementById(''+itemcd+'OP').style.display="";
}


function itemdetailpophide(itemcd)
{ 
 document.getElementById('info'+itemcd+'').style.display="none";
 document.getElementById('imgbg_'+itemcd+'').style.backgroundColor="";
 document.getElementById(''+itemcd+'OP').style.display="none";
}





 var xmlHttpobjquick;
 var itemcode
 
 function itemdetailpop(itemcd,type,stype)
{ 
	if (tempcode!='')
	{
  document.getElementById('info'+tempcode+'').innerHTML=""
	}

itemcode=itemcd
xmlHttpobjquick=GetXmlHttpObjectquick();

if (xmlHttpobjquick==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var url="item-detail.asp";
url=url+"?icode="+itemcode;
url=url+"&type="+type;
url=url+"&stype="+stype;

xmlHttpobjquick.onreadystatechange=stateChangedquick;

xmlHttpobjquick.open("GET",url,true);
xmlHttpobjquick.send(null);

}

function stateChangedquick() 
{ 
if (xmlHttpobjquick.readyState==4)
	{ 
     document.getElementById('info'+itemcode+'').innerHTML=xmlHttpobjquick.responseText;
     tempcode=itemcode
	}
	else
	{
	 document.getElementById('info'+itemcode+'').innerHTML="<br>&nbsp;&nbsp;<table cellpadding=0 cellspacing=0 width=160 border=0 style='background:#ffffff;padding-left:5px' class='darkgreyborder'><tr><td width=150><img src='images/loadingstatus.gif' /><span class=carttext> Requesting content...</span></td></tr></table>"
	}
	
}

 
function GetXmlHttpObjectquick()
{
var xmlHttpobjquick=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttpobjquick=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttpobjquick=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttpobjquick=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttpobjquick;
}

// Show pop up end



function displaysettags(icode,cid) {	
var win1
var   ss="border:raised;dialogHeight:370px;dialogWidth:545px;center:yes;help:no;resizeable:no;scroll:no;status:no;"
var   ss1="itemtags.asp?icode="+ icode ;
	  ss1=ss1+"&cid="+cid;
     if (window.showModalDialog) {   
        win1=window.showModalDialog(ss1,"",ss)}
     else{
        win1=window.open(ss1,"","width=545,height=455,left=10,top=5") }  
     
  }	
  
function displaysetreview(icode,cid) {	
var win1
var   ss="border:raised;dialogHeight:700px;dialogWidth:700px;center:yes;help:no;resizeable:no;scroll:yes;status:no;"
var   ss1="itemreview.asp?icode="+ icode ;
	  ss1=ss1+"&cid="+cid;
     if (window.showModalDialog) {   
        win1=window.showModalDialog(ss1,"",ss)}
     else{
        win1=window.open(ss1,"","width=700px,height=700px,top=5") }       
  }	
  
  
function checkSubmit1()
{
  var tag=document.tagform.tag.value;
  var cidref=document.tagform.cidref.value;
  var icode=document.tagform.icode.value;
if (tag=="")
{
	alert("Please enter your tag.");	
}
else
{
		centerWindow('submit.asp?ItemCode='+icode+'&tag='+tag+'&mode=tagsub&cid='+cidref+'');			
	}
}


function ItemReviewPage1()
{
  var IReview=document.reviewform.review.value;
  var cidref=document.reviewform.cidreview.value;
  var icode=document.reviewform.reviewcode.value;
  
if (IReview=="")
{
	alert("Please enter your Review.");	
}
else
	{
		centerWindow('submit.asp?ItemCode='+icode+'&IReview='+IReview+'&mode=ItemReview&cid='+cidref+'');
		document.reviewform.reset();
	}
}

function ItemReview()
{
  var reviewhead=document.reviewform.reviewhead.value;
  var cidreview=document.reviewform.cidreview.value;
  var reviewcode=document.reviewform.reviewcode.value;
  var pros=document.reviewform.pros.value;
  var pros1=document.reviewform.pros1.value;
  var cons1=document.reviewform.cons1.value;
  var review=document.reviewform.review.value;
  var nickname=document.reviewform.nickname.value;
  var loc=document.reviewform.loc.value;
  var h=1;
var found_it 
var reviewbot
var cons=getSelectedCheckboxValue(document.reviewform.cons);
var pros=getSelectedCheckboxValue(document.reviewform.pros);
for (var i=0; i<document.reviewform.rating.length; i++) 
 { 
if (document.reviewform.rating[i].checked)
 {
found_it = document.reviewform.rating[i].value; 
} 
}
for (var j=0; j<document.reviewform.reviewbot.length; j++) 
 { 
if (document.reviewform.reviewbot[j].checked)
 {
reviewbot = document.reviewform.reviewbot[j].value; 
} 
}
if (document.reviewform.reviewhead.value=="")
{
	alert("Please enter review headline.");
    document.getElementById("reviewheadline").style.color="#cc0000";
	document.reviewform.reviewhead.focus();
    return false;
}
else if (found_it == null)
{
	alert("Please enter rating.");
	document.getElementById("rate").style.color="#cc0000";
}
else if (document.reviewform.review.value=="")
{
	alert("Please enter your review.");	
	document.getElementById("comments").style.color="#cc0000";
	document.reviewform.review.focus();
    return false;
}
else if (document.reviewform.nickname.value=="")
{
	alert("Please enter your Nickname.");	
	document.getElementById("name").style.color="#cc0000";
	document.reviewform.nickname.focus();
    return false;
}
else if (document.reviewform.loc.value=="")
{
	alert("Please enter your location.");	
	document.getElementById("location").style.color="#cc0000";
	document.reviewform.loc.focus();
    return false;
}
else
	{
      centerWindow('submit.asp?reviewcode='+reviewcode+'&reviewhead='+reviewhead+'&rating='+found_it+'&cidreview='+cidreview+'&pros='+pros+'&cons='+cons+'&pros1='+pros1+'&cons1='+cons1+'&review='+review+'&reviewbot='+reviewbot+'&nickname='+nickname+'&loc='+loc+'&h='+h+'&mode=ItemReview');
	}
}
//Enlarge image.....................


 var productlarge;

function showlargeimage(itemcode,part,tmtoship)
{ 
productlarge=Productenlargecheck();

//document.getElementById(itemcode+'img').src="images/red-magnifier.gif";


if (productlarge==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var url="itemenlarge.asp";
url=url+"?icode="+itemcode;
url=url+"&part="+part;
url=url+"&tmtoship="+tmtoship;


productlarge.onreadystatechange=Productenlargestatus;

productlarge.open("GET",url,true);
productlarge.send(null);

}

function Productenlargestatus() 
{ 
if (productlarge.readyState==4)
	{ 
     //document.getElementById('showenlargeitem').innerHTML=productlarge.responseText;
     window.parent.document.getElementById('showenlargeitem').innerHTML=productlarge.responseText;
	}
	else
	{
	 //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>"
	 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

// Float div start------------

var persistclose=0 //set to 0 or 1. 1 means once the bar is manually closed, it will remain closed for browser session
var startX = 775 //set x offset of bar in pixels
var startY = 40 //set y offset of bar in pixels
var verticalpos="fromtop" //enter "fromtop" or "frombottom"

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function check_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}


function enlargeitemfloat(){

	barheight=document.getElementById("showenlargeitem").offsetHeight
	var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
	var d = document;

	function ml(id){
		var el=d.getElementById(id);
		if (!persistclose || persistclose && check_cookie("remainclosed")=="")
		el.style.visibility="visible"
		if(d.layers)el.style=el;
		el.sP=function(x,y){this.style.left=x+"px";this.style.top=y+"px";};
		el.x = startX;
		if (verticalpos=="fromtop")
		el.y = startY;
		else{
		el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
		el.y -= startY;
		}
		return el;
	} 

	window.stayTopLeft=function(){
		if (verticalpos=="fromtop"){
		var pY = ns ? pageYOffset : iecompattest().scrollTop;
		ftlObj.y += (pY + startY - ftlObj.y)/8;
		}
		else{
		var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
		ftlObj.y += (pY - startY - ftlObj.y)/8;
		}
		ftlObj.sP(ftlObj.x, ftlObj.y);
		setTimeout("stayTopLeft()", 1);
	}
	ftlObj = ml("showenlargeitem");
	stayTopLeft();
}

function floatdivfunction(){

if (window.addEventListener)
window.addEventListener("load", enlargeitemfloat, false);
else if (window.attachEvent)
window.attachEvent("onload", enlargeitemfloat);
else if (document.getElementById)
window.onload=enlargeitemfloat ;

}
//----Float Div end

var menupos

function showmainmenu(id)
{ document.getElementById('MAINMENU').style.display=""; 


mainmenulist(id)

}

function showmainmenu1(id)
{ document.getElementById('MAINMENU').style.display=""; 

}


function hidemainmenu()
{ 

document.getElementById('MAINMENU').style.display="none"; 

}


function showmain_menu(id)
{ 

document.getElementById('MAINMENU').style.display=""; 

}


function hidemain_menu()
{ 

document.getElementById('MAINMENU').style.display="none"; 

}

function b2bshowmain_menu(id)
{ 
document.getElementById('MAINMENU'+id).style.display=""; 
document.getElementById('col'+id).style.background="background-image: url('http://www.utsavsarees.com/pages/images/index-images/red.jpg') no-repeat";
}

function b2bhidemain_menu(id)
{ 
document.getElementById('MAINMENU'+id).style.display="none";
document.getElementById('col' + id).style.background = "background-image: url('http://www.utsavsarees.com/pages/images/top-bg.gif') no-repeat";
}





// function to show drop down menu on header ///
 var ddownitem;
 var ddownitemA;
 var divid;
 var dividA;

// function for JEWELRY drop down//

function mainmenulist(isIn)
{ 


//divid=dvid;
ddownitem=CheckMenuList();

	if (ddownitem==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
var url;

if (isIn==1)
	{  url="mainmenu.asp"; }
	
else if (isIn==2)
	{  url="http://b2b.utsavsarees.com/b2bmenu.asp";}	
	
else
	{  url="../pages/mainmenu.asp";}

	 url=url+"?i="+isIn;

	ddownitem.onreadystatechange=ddChange;
	ddownitem.open("GET",url,true);
	ddownitem.send(null);
}

function ddChange() 
{ 
if (ddownitem.readyState==4)
	{
	     document.getElementById('MAINMENU').innerHTML=ddownitem.responseText;
	}
}

// end function for drop down//


function CheckMenuList()
{
var item=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  item=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    item=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    item=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return item;

}
// end function to show drop down menu on header ///


//function for hilight magnifier of item thmbnail images

function showhidemagnifier(itemcode,option)
{

if (option=="S")
	{
	document.getElementById(itemcode+'img').src="images/red-magnifier.gif";
	document.getElementById(itemcode+'OP').style.display="";
	}
else if (option=="H")
	{
	document.getElementById(itemcode+'img').src="images/magnifier.jpg";
	document.getElementById(itemcode+'OP').style.display="none";
	}
	
}


//

function showdoyouknow()
{ 

document.getElementById('DOYOUKNOW').style.display="";

}

function hidedoyouknow()
{

document.getElementById('DOYOUKNOW').style.display="none"; 

}


function ShowHideIndexNav(tab)
{ 

if (tab=="simple")
{
document.getElementById('simpletab').style.display="";
document.getElementById('advancetab').style.display="none";
document.getElementById('simpletext').style.fontWeight="bold";
document.getElementById('advancetext').style.fontWeight="normal";
}
else if (tab=="advance")
{
document.getElementById('simpletab').style.display="none";
document.getElementById('advancetab').style.display="";
document.getElementById('simpletext').style.fontWeight="normal";
document.getElementById('advancetext').style.fontWeight="bold";
}

}



// 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 SpecialCharFilter(text)
{  	
var iChars = "!@#$%^&*()+=-[]\\;,./{}|\":<>?";

  for (var i = 0; i < text.length; i++) {
  	if (iChars.indexOf(text.charAt(i)) != -1) {
  	return false;
  	alert("dcdfdff");
  	}
  }



}


function TagSearch()
{
if (document.searchtag.q.value!="")
{
		
		if (SpecialCharFilter(document.searchtag.q.value)==false)
		{
		
  			alert ("Your search tag has special characters. \nThese are not allowed.\n Please remove them and try again.");
			document.searchtag.q.focus();
		
		}
		
		else
		
		{
		
			document.searchtag.submit();		
		
		}
		

}

else

{

alert("Please enter your tag!");
}

}



//for faq Q & Ans

 var xmlHttpobjFaq;
 var faqid;
 var hideFaq=0;
 
 
function showFaq(fid)
{ 

	if (hideFaq!='')
	{
		  document.getElementById('F'+hideFaq).innerHTML=""
	}


faqid=fid;
xmlHttpobjFaq=GetXmlHttpObjectFaq();

if (xmlHttpobjFaq==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var url="helpresource.asp";
url=url+"?id="+faqid;

xmlHttpobjFaq.onreadystatechange=stateChangedFaq;

xmlHttpobjFaq.open("GET",url,true);
xmlHttpobjFaq.send(null);

}

function stateChangedFaq() 
{ 
if (xmlHttpobjFaq.readyState==4)
	{ 
     document.getElementById('F'+faqid).innerHTML=xmlHttpobjFaq.responseText;
     hideFaq=faqid;
	}
	else
	{
	 document.getElementById('F'+faqid).innerHTML="<table cellpadding=0 cellspacing=0 width=160 border=0 style='background:#ffffff;padding-left:5px' class='darkgreyborder'><tr><td width=150><img src='images/loadingstatus.gif' /><span class=carttext> Requesting content...</span></td></tr></table>";
	}
}
 
function GetXmlHttpObjectFaq()
{
var xmlHttpFaq=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttpFaq=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttpFaq=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttpFaq=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttpFaq;
}

//--


function doyouknowshow()
{
document.getElementById("doyouknow").style.display=""


}
function doyouknowhide()
{
document.getElementById("doyouknow").style.display="none"


}


function addToCartAvailability()
{
  var availability=document.form1.availability.value;

    if (availability.length>1  && document.form1.size.value=="")
     {
	 alert("Please select your garment size.");
	 }	
	else
	 {		
		document.form1.mode.value="addshop";
  		document.form1.submit();   		
     }
}



function addToCartAvailabilityColor()
{
  var availability=document.form1.availability.value;
  var color=document.form1.IAColor.value;


    if (availability.length>1  && document.form1.size.value=="")
     {
	 alert("Please select your garment size.");
	 }	
	else if (color=="") 
	{
	 alert("Please select available colors.");
	}
	else
	 {		
		document.form1.mode.value="addshop";
  		document.form1.submit();   		
     }
}




function showmorecolor(color,ccode)
{

if(color=='As Shown')
	{document.getElementById('Colbox').innerHTML="<span class=maroonbigtext style='font-size:17px;'></br></br></br><b>"+color+"</b><span>" ;
	 document.getElementById('Colbox').style.backgroundColor='#FFFFFF' ;}
else	
	{document.getElementById('Colbox').style.backgroundColor=ccode ;
	document.getElementById('Colbox').innerHTML="" ; }

document.getElementById('Colname').innerHTML="<b>"+color+"</b>"
document.getElementById('morecolor').style.display='';


}


// more color end



//select color
var SColor='0';



function selectcolor (color)
{
if (SColor!='0')
{
	 document.getElementById(SColor).style.borderColor='#cccccc';
}

document.getElementById(color).style.borderColor='#000000';
document.getElementById('Selectcol').innerHTML="<b>Selected color is "+color+".</b>";
document.getElementById('Selectcol').style.display='';
document.form1.IAColor.value=color;


SColor=color;
}

//select color end


//Currency List


function ShowCurrencylisting(mouse)
{
	if (mouse=="OVER")
	{
	currencyChangemsg
	document.getElementById('currencyChangemsg').style.display='none'
	document.getElementById('Shortcurrencylist').style.display=''
	}
	else
	{
	document.getElementById('Shortcurrencylist').style.display='none'
	}

}


 var SetSecCurr;
 
function SetSecCurrlist(curname)
{ 

SetSecCurr=GetSetSecCurr();

var checkt=0;

checkt=new Date().getTime();


if (SetSecCurr==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var url="set-sec-currency.asp";
url=url+"?SecC="+curname;
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);
	}
	else
	{
	 document.getElementById('currencyChangemsg').innerHTML="<table cellpadding=0 cellspacing=0 width=160 border=0 style='background:#ffffff;padding-left:5px' class='darkgreyborder'><tr><td width=150><img src='images/loadingstatus.gif' /><span class=carttext> Requesting content...</span></td></tr></table>";
	}
}
 
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;
}


var CurrDropDown=0;
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=="HOME")
	{
	url="CurrencyDropDown.asp";
	}
	else
	{
	url="CurrencyDropDown.asp";
	}
url=url+"?loc="+loc;
url=url+"&chkt="+checktt;

CurrDropDown.onreadystatechange=stateChangedSetDropCur;

CurrDropDown.open("GET",url,true);
CurrDropDown.send(null);

}

function stateChangedSetDropCur() 
{ 
if (CurrDropDown.readyState==4)
	{ 
     document.getElementById('currencydropdown').innerHTML=CurrDropDown.responseText;
	}
}

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+'');			
	}
}


 




//--







 ////////////////////////////////////
 
   // Setting "onlyOnImages" to "true" will disable right-clicking only for
  // images
  var onlyOnImages =false;
 
  // Detect the browser
  var isIE5 = document.all && document.getElementById;  // IE 5 or higher
  var isMoz = !isIE5 && document.getElementById;  // Mozilla/Firefox
 
  function cancelContextMenu(e) {
    // Here you can add additional code that is executed when the context menu
    // is blocked. For instance, you can use the following code to display a
    // message to the user:
    //    alert("Right-click disabled!");
 
    return false;
  }
 
  /* This function is fired every time a user clicks the right mouse button to
     open the browser's context menu. */
  function onContextMenu(e) {
    // Depending on the "onlyOnImages" variable the context menu is either
    // blocked for the complete page or only for <img> tags.
    if (onlyOnImages=false
     || (isIE5 && event.srcElement.tagName == "IMG")
     || (isMoz && e.target.tagName == "IMG"))
     {
      return cancelContextMenu(e);
    }
  }
 
  if (document.getElementById) {
    // Register event handler
    document.oncontextmenu = onContextMenu;
  // document.onkeyup = disallowspecialchars;
  }
  
  function disallowspecialchars(e)
  {
  
  var el=window.event? event.srcElement: el.target

      if ((isIE5 && el.tagName == "INPUT"&&el.type=="text" || el.tagName == "TEXTAREA") || (isMoz && el.tagName == "INPUT"&&el.type=="text" || el.tagName == "TEXTAREA"))
      {
        if (isSplCharcheck(el.value)==false)
        {
        el.value="";
        }
      }

  
  }
  

  function isSplCharcheck(str)
{	
	var iChars = "!~`#$%^&*()+=[]\\\';/{}|\":<>?";
        for (var i = 0; i < str.length; i++) {
                if (iChars.indexOf(str.charAt(i)) != -1) {
                alert ("Special Characters are not allowed!");
                return false;
        }
                }
}
////////////////////////////////////////////

function showmain_menu(id)
{ 
document.getElementById('MAINMENU'+id).style.display=""; 
document.getElementById('col'+id).style.background="background-image: url('../pages/images/index-images/red.jpg') no-repeat";
}

function hidemain_menu(id)
{ 
document.getElementById('MAINMENU'+id).style.display="none";
document.getElementById('col' + id).style.background = "background-image: url('../pages/images/top-bg.gif') no-repeat";
}


function submitLetterindexaspx_n(opt){  

    if(document.newsletter.Email.value=="")
   		{alert("Please Enter Email ID");
   		document.newsletter.Email.focus();}
    else if (checkmail(document.newsletter.Email.value)){
       val=document.newsletter.Email.value 
         if (opt=='Y') 
         {	
        centerWindowX('pages/submit.asp?Email='+val+'&mode=letter');
         }
         else if(opt=='N')
         {  
        centerWindowX('../pages/submit.asp?Email='+val+'&mode=letter');
         }

            document.newsletter.Email.value=''}}
            
            
function make_blanknmail(dis,q)
{

	if (dis=="hide")
	{
	if ( document.getElementById(q).value=="Enter your Email id" )
	{
	document.getElementById(q).value="";	
	}
	}
	else if (dis=="show")
	{
	 if (document.getElementById(q).value=="")
	{
	document.getElementById(q).value="Enter your Email id";	
	}}

	
}   

// START tab box timing show function //
var y
var timerID = 0;

function showTab(x)
{
document.getElementById('Div1').style.display="none";
document.getElementById('Div2').style.display="none";
document.getElementById('Div3').style.display="none";
document.getElementById('Div4').style.display="none";
document.getElementById('Div5').style.display="none";
document.getElementById('Div'+x).style.display="";

if (x==5)
	{ y=1 ;}
else
	{ y=x+1; }

clearTimeout(timerID);
timerID=0;
timerID = setTimeout("showTab(y)", 25000);

}

// END tab box timing show function //
function OpenDiv()
{ 
document.getElementById('notifyrules').style.display="block";
}

function MOver(N)
{ document.getElementById(N).style.textDecoration='underline'; 
  document.getElementById(N).style.color='#993333';
}

function MOut(N)
{ document.getElementById(N).style.textDecoration='';
  document.getElementById(N).style.color='#3E3939';
 }
 
 
 
 function submitAlertquery()
{
var pros=document.notifyForm.pros.value;
var email=document.notifyForm.mail.value;
var icode=document.notifyForm.icode.value;
var pros=getSelectedCheckboxValue(document.notifyForm.pros);

if (document.notifyForm.mail.value=="")
{
	alert("Please enter your Email.");	
	document.notifyForm.mail.focus();
    return false;
}
else if(document.notifyForm.mail.value!="")
{
        var check=checkmail(document.notifyForm.mail.value) 
		if (check==false) 
		{
		document.notifyForm.mail.focus();
        return false;
		}
		
 }
 if(ch==1)
 {
      document.getElementById('notifyrules').style.display='none';
      centerWindowX('submit.asp?icode='+icode+'&pros='+pros+'&email='+email+'&mode=notifyitem');
   
      }
      
  else
  {
    alert('Please select atleast one of the option');
    return false;
   }    
}
var ch=0;
function checkrules()
{
ch=1;
}   

 
//Alert Item
var notifyrules;

function HelpList(icode,opt)
{ 

document.getElementById('notifyrules').style.display="block";

notifyrules=custnotifyrules();

if (notifyrules==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var url="alert.asp?icode="+icode+"&opt="+opt;
notifyrules.onreadystatechange=custmmtpophelp;
notifyrules.open("GET",url,true);
notifyrules.send(null);

}

function custmmtpophelp() 
{ 
if (notifyrules.readyState==4)
	{ 
     document.getElementById('notifyrules').innerHTML=notifyrules.responseText;
	}
	else
	{
	document.getElementById('notifyrules').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 custnotifyrules()
{
var notifyrules=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  notifyrules=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    notifyrules=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    productlarge=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return notifyrules;
}

function HelpListhide()
{
document.getElementById('notifyrules').style.display="none";
}
//Alert Item


function submitLetterindexaspx_nindex(opt){  

    if(document.newsletter.Email.value=="")
   		{alert("Please Enter Email ID");
   		document.newsletter.Email.focus();}
    else if (checkmail(document.newsletter.Email.value)){
       val=document.newsletter.Email.value 
         if (opt=='Y') 
         {	
        centerWindowX('../../pages/submit.asp?Email='+val+'&mode=letter');
         }
         else if(opt=='N')
         {  
        centerWindowX('../../pages/submit.asp?Email='+val+'&mode=letter');
         }

            document.newsletter.Email.value=''}}
            
     
function showmain_menuindex(id)
{ 
document.getElementById('MAINMENU'+id).style.display=""; 
document.getElementById('col'+id).style.background="background-image: url('../../pages/images/index-images/red.jpg') no-repeat";
}

function hidemain_menuindex(id)
{ 
document.getElementById('MAINMENU'+id).style.display="none";
document.getElementById('col' + id).style.background = "background-image: url('../../pages/images/top-bg.gif') no-repeat";
}
function submitRSVPQuery(){ 
    var fname
    var RSVP
    if(document.Events.fname.value=="")
   		{alert("Please Enter Your Name");
   		document.Events.fname.focus();}
    else if(document.Events.EMail.value=="")
   		{alert("Please Enter Email ID");
   		document.Events.EMail.focus();}
   	else if(document.Events.RSVP.value==0)
   		{alert("Please Select Your RSVP");
   		document.Events.RSVP.focus();}

    else if (checkmail(document.Events.EMail.value)){
       val=document.Events.EMail.value 
       fname=document.Events.fname.value 
       RSVP=document.Events.RSVP.value 

       centerWindowX('../pages/submit.asp?email='+val+'&fname='+fname+'&RSVP='+RSVP+'&mode=RSVP');
       document.Events.fname.value=''
       document.Events.EMail.value=''
       }}

      




      
      
      



