﻿
function showmain_menu(id)
{ 
document.getElementById('MAINMENU'+id).style.display=""; 
document.getElementById('col'+id).style.background="url('../images/red.gif') repeat";
}

function hidemain_menu(id)
{ 
document.getElementById('MAINMENU'+id).style.display="none";
document.getElementById('col' + id).style.background = "url('../images/top-bg.gif') no-repeat";
}




var y
var timerID = 0;
function showAutoImage(x)
{document.getElementById('Div1').style.display="none";
document.getElementById('Div2').style.display="none";
document.getElementById('Div'+x).style.display="";
if (x==2)
	{ y=1 ;}
else
	{ y=x+1; }
clearTimeout(timerID);
timerID=0;
timerID = setTimeout("showAutoImage(y)", 2000);
}



function MM_openBrWindowX(theURL,winName,features) { //v2.0
  mywin=window.open(theURL,winName,features);  
  if (mywin.opener==null)
      mywin.opener=self;  
  self.close();
}


function MM_openBrWindow(theURL,winName,features) { 
     window.open(theURL,winName,features);}


function chkstatus(obj)
{

	if (obj.id=="as3")
		{
			  if (document.getElementById("as3").checked==true )
			   		{document.getElementById("as3").checked=true; }
			    
			  else
			 {document.getElementById("as3").checked=false; }
			  document.getElementById("as4").checked=false;			  
            

		}
	else if (obj.id=="as4")
		{
			  if (document.getElementById("as4").checked==true )
			   		{document.getElementById("as4").checked=true ;}
			  else
			 {document.getElementById("as4").checked=false; }
			  document.getElementById("as3").checked=false;			  
             
		}
		
	else if(obj.id=="as1")
	        {
			if (document.getElementById("as3").checked==true )
			   		{document.getElementById("as3").checked=true; }		
			
			    document.getElementById("as4").checked=false			
			
			if (document.getElementById("as1").checked==false )	
			    {
			    document.getElementById("rd1").checked=false;
			    document.getElementById("rd2").checked=false;
			    document.getElementById("rd3").checked=false;
			    }	
       	
	        }
   else
			{
			if (document.getElementById("as3").checked==true )
			   		{document.getElementById("as3").checked=true; }		
			
			document.getElementById("as4").checked=false			
			}	
}



function chkstatussalwar(vall)
{
 document.getElementById("shopcart").style.display="";
 document.getElementById("measurement").style.display="";
 document.getElementById("wishlist").style.display=""; 
 
 if(vall=='0')
 {	
    document.getElementById("rd1").checked=false;
	document.getElementById("rd2").checked=false;
	document.getElementById("rd3").checked=false;
 }
 
}


function chkstatussalwarQuickView(vall,icd)
{
 
 if(vall=='0')
 {	
    document.getElementById(icd+"rd1").checked=false;
	document.getElementById(icd+"rd2").checked=false;
	document.getElementById(icd+"rd3").checked=false;
 }
 
}


function chkstatuslehenga(vall)
{
 if(vall=='0')
 {	
    document.getElementById("rd1").checked=false;
	document.getElementById("rd2").checked=false;
	document.getElementById("rd3").checked=false;
 }
 
}


function chkstatuslehengaQuickView(vall,icd)
{
 if(vall=='0')
 {	
    document.getElementById(icd+"rd1").checked=false;
	document.getElementById(icd+"rd2").checked=false;
	document.getElementById(icd+"rd3").checked=false;
 }
 
}



// quick view 


function chkstatusQuickView(obj,icd)
{

	if (obj=="as3")
		{
			  if (document.getElementById(icd+"as3").checked==true )
			   		{document.getElementById(icd+"as3").checked=true; }
			    
			  else
			 {document.getElementById(icd+"as3").checked=false; }
			  document.getElementById(icd+"as4").checked=false;			  
            

		}
	else if (obj=="as4")
		{
			  if (document.getElementById(icd+"as4").checked==true )
			   		{document.getElementById(icd+"as4").checked=true ;}
			  else
			 {document.getElementById(icd+"as4").checked=false; }
			  document.getElementById(icd+"as3").checked=false;			  
             
		}
		
	else if(obj=="as1")
	        {
			if (document.getElementById(icd+"as3").checked==true )
			   		{document.getElementById(icd+"as3").checked=true; }		
			
			    document.getElementById(icd+"as4").checked=false			
			
			if (document.getElementById(icd+"as1").checked==false )	
			    {
			    document.getElementById(icd+"rd1").checked=false;
			    document.getElementById(icd+"rd2").checked=false;
			    document.getElementById(icd+"rd3").checked=false;
			    }	
       	
	        }
   else
			{
			if (document.getElementById(icd+"as3").checked==true )
			   		{document.getElementById(icd+"as3").checked=true; }		
			
			document.getElementById(icd+"as4").checked=false			
			}	
}



// quick view end 






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 addToWlist(){
  	document.form1.mode.value="addwish";  	
  	document.form1.submit(); } 







// 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


// javascript for contact query help

	
	// second function for testing.......
	function contactquery()
{

var val=false;
var str;
var custname;
var fmail;
var oid;
var message;
var querysub;
var ccmail;

		if(document.form1.con_sub.value==0)
		{
		alert("select the Subject")
		val=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)
   	                            {custname=document.form1.fullname.value;
                                 fmail=document.form1.qemail.value;
                                 oid=document.form1.ordernumber.value;
	                             message=document.form1.message.value;
	                             querysub=document.form1.con_sub.value;
	                                     if(document.form1.concheck.checked==true)
	                                     {
	                                     ccmail="Yes";	                                    
                                         }
                                         else
                                         {
                                         ccmail="No";
                                         }
                                         
                                         centerWindowX('../store/submit.aspx?custname='+custname+'&fmail='+fmail+'&oid='+oid+'&message='+message+'&querysub='+querysub+'&ccmail='+ccmail+'&mode=contactquery'); 
                                         document.form1.reset();
                                   }                                        
                                         
                                         
                                 else
		                            {document.form1.message.focus();
		                            alert("Message Can Not Be Blank!")
		                            return false
		                            }}	
                    	
                      else
		                    {document.form1.fullname.focus();}
		                    
		                    }
                    		
	
		   else
	
	{document.form1.qemail.focus();}}
	
		return false;
	}

	
	
	
// javascript for contact query help
	
	// These two function should be deleted if the Xfunctions.js will be used
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 ";
          strError = strError + "[" + cmdvalue + "]";
          strError = strError + " 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 messageval(str)
{
if(str!="")
{
return true
}
	
}
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 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 checkjunkchar(str, fieldname){
	var invalidchar=" \"([{}])!#$%^&*';:,/\\?|+-`~<>=~@.0123456789"
	for (i=0; i<(invalidchar.length-1); i++){
		temp=invalidchar.substring(i,i+1);		      
		if (str.indexOf(temp)!=-1)
		{	alert("Special characters/spaces are not allowed in "+ fieldname +"." ); return false} 
	}		 		
return true; }



function itemdetailpopshow(itemcd) {
    document.getElementById('thumbMenu_' + itemcd + '').style.display = "";
    document.getElementById('bg_' + itemcd + '').style.backgroundColor = "#CCCCCC";
    document.getElementById('secCur_' + itemcd + '').style.display = "";
}


function itemquickviewpopshow(itemcd) {

    document.getElementById('quickview_' + itemcd + '').style.display = "";
    itemquickviewtabcode=itemcd;

}

function itemdetailpophide(itemcd)
{ 

 document.getElementById('thumbMenu_'+itemcd+'').style.display="none";
 document.getElementById('bg_'+itemcd+'').style.backgroundColor="";
 document.getElementById('secCur_'+itemcd+'').style.display="none";

}

function itemquickviewpophide(itemcd) {

    document.getElementById('quickview_' + itemcd + '').style.display = "none";

}



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 AllowAmount(e)
{
    var browserchk = window.event ? e.keyCode : e.which;
	if((browserchk >=58 && browserchk <=64)||(browserchk >=65 && browserchk <=90) || (browserchk >=97 && browserchk <=122) ||browserchk==47)
    {
         return false;
    }
    if((browserchk >=33 && browserchk <=45)|| (browserchk >=91 && browserchk <=96)|| (browserchk >=123 && browserchk <=182))
    {
         return false;
    }
    
    val = MM_findObj('Amount'); val = val.value;
	if (browserchk == 46)
	{
	    if (val.indexOf('.') != -1) return  false;
		else return true ;
	}
	if (browserchk >= 48 && browserchk <= 57)
	{
	  if ((val.indexOf('.') >= 1) && (val.indexOf('.') == (val.length - 3))) return  false;
		else return true ;
	}
	else return  false;
	
}

// Script for change currency div



var chcurrency;

function showcurrencydiv(icd, ict, loc) {

	chcurrency = checkajax();

	if (chcurrency == null) {
		alert("Your browser does not support AJAX!");
		return;
	}
	var url;

	url = "changecurrency.aspx?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/loadingstatus.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;

}

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";
}


// script for change currency end









// function for show shopping cart popup

function ShowCartPopupquickview(carttype, itemcode)
{

    document.getElementById('loadingcart_' + itemcode).style.display = "";
    if (carttype == 'CART')
    {
        document.getElementById('addtocart_' + itemcode).style.display = "";
    }
    else if (carttype == 'WISH')
    {
        document.getElementById('addtowish_' + itemcode).style.display = "";
    }
    
    

}


function HideCartPopupquickview(carttype) {


    document.getElementById('loadingcart_' + hidepopcart).style.display = "none";
    if (carttype == 'CART') {
        document.getElementById('addtocart_' + hidepopcart).style.display = "none";
    }
    else if (carttype == 'WISH') {
    document.getElementById('addtowish_' + hidepopcart).style.display = "none";
    }

}
 
 
 
 
  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/loadingstatus.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.window)

    setTimeout("pp.hide()", 3000);
	
	}
  
// show shopping cart popup end 



function showcartpopNew(icd,txt)
{
	  	document.getElementById('cartpop-'+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('cartpop-'+icd).style.display='';
	  	setTimeout("document.getElementById('cartpop-"+icd+"').style.display='none'", 3000);
}



// 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 bag','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="../shop/navigate-cart.aspx";
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)
	{ 
	//alert('Item Added');
    showminicart('N');	
	}

}




// new add to cart wish function new pop up -->



var xmlHttpNew

function addtocartwishNew(icd,mode)
{ 
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="../shop/navigate-cart.aspx";
url=url+"?icode="+icd;
url=url+"&mode="+mode;


xmlHttpNew.onreadystatechange=stateChangedNew;

xmlHttpNew.open("GET",url,true);
xmlHttpNew.send(null);

}

function stateChangedNew() 
{ 
if (xmlHttpNew.readyState==4)
	{ 
	//alert('Item Added');
    showminicart('N');	
	}
}
  
  
  //<--
  


var xmlHttpsize
var sizeICD

function addtocartwishSize(icd,mode)
{ 
xmlHttpsize=GetXmlHttpObject();


var color="";

if (document.getElementById('itemcolor_' + icd) != null)
{
    if (document.getElementById('itemcolor_' + icd).value == "") {
        alert("Please select your desired color");
        return false;
    }
    
    color = document.getElementById('itemcolor_' + icd).value;
}


var size="";

if (document.getElementById('itemsize_' + icd) != null)
{
    if (document.getElementById('itemsize_' + icd).value == "") {
        alert("Please select your size");
        return false;
    }
    size = document.getElementById('itemsize_' + 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 (mode=='addshop')
	{		
	    showcartpopNew(icd,"Adding item to<br />Shopping bag");		
	}
else if (mode=='addwish')
	{
	    showcartpopNew(icd,"Adding item to<br />Wish list");		
	}

var url="../shop/navigate-cart.aspx";
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;
}

xmlHttpsize.onreadystatechange=stateChangedSize;

xmlHttpsize.open("GET",url,true);
xmlHttpsize.send(null);

}
  
  
  
function stateChangedSize() 
{ 
if (xmlHttpsize.readyState==4)
	{ 
	//alert('Item Added');
    showminicart('N');	
    document.getElementById('thumbSize_'+sizeICD).style.display = "none";
	}

}


function hidethumbSize(obj)
{
obj.style.display = "none";
}





var xmlHttp2
var hidepopcart = "";

function addtocartwishQuickView (icd,mode,iscolor)
{ 
xmlHttp2 = GetXmlHttpObject();

var docname = "";

docname = "availability_" + icd;


var availability = document.getElementById(docname).value;

 var size="";
 var color="";
 var as1="";
 var as2="";
 var moreopt="";
 
 var customize= document.getElementById(icd+'customize').value;

 if(iscolor==1) {
  var color=document.getElementById('IAColor').value;
 
 }

 if (availability.length > 1 && customize == 0 )
     {
         size = document.getElementById('size_' + icd).value;
     }
 else{
        if(document.getElementById(icd+'as1').checked == true)
         { as1=document.getElementById(icd+'as1').value; }

        if(document.getElementById('cid').value==1)
        { 
        if(document.getElementById(icd+'as3').checked==true)
         { as2=document.getElementById(icd+'as3').value; }
        if(document.getElementById(icd+'as4').checked==true)
         {as2=document.getElementById(icd+'as4').value;}
        }
        
        
        if(document.getElementById(icd+'Mopt').checked==true)
        {
            moreopt=document.getElementById(icd+'MOption').value;
        }
        
        
     }



 if (availability.length > 1 && document.getElementById('size_' + icd).value == "") {

       
        document.getElementById('customizationtab_'+icd).style.backgroundColor = "#42515A";
        document.getElementById('overviewtab_'+icd).style.backgroundColor = "#CCCCCC";
        document.getElementById('quickviewcustomization_' + icd).style.display = "";
        document.getElementById('quickviewoverview_' + icd).style.display = "none";
	 alert("Please select your garment size.");
	 }
	else if (iscolor==1 && color=="") {
	
        document.getElementById('customizationtab_'+icd).style.backgroundColor = "#42515A";
        document.getElementById('overviewtab_'+icd).style.backgroundColor = "#CCCCCC";
        document.getElementById('quickviewcustomization_' + icd).style.display = "";
        document.getElementById('quickviewoverview_' + icd).style.display = "none";
	
	 alert("Please select available colors.");
	}
	else 
	{

               if (xmlHttp2==null)
                  {
                  alert ("Your browser does not support AJAX!");
                  return;
                  } 
                  
                if (mode=='addshop') {


                    ShowCartPopupquickview('CART', icd);
                    hidepopcart = icd;
                    setTimeout("HideCartPopupquickview('CART')",3000);
			                    
			  	               
	                }
                else if (mode=='addwish')
	                {
	                    ShowCartPopupquickview('WISH', icd);
	                    hidepopcart = icd;
	                    setTimeout("HideCartPopupquickview('WISH')", 3000);
	                }

                var url="../shop/navigate-cart.aspx";
                url=url+"?icode="+icd;
                url=url+"&mode="+mode;
                if(as1!="")
                {url=url+"&as1="+as1;}
                if(as2!="")
                {url=url+"&as2="+as2;}
                if(size!="")
                {url=url+"&size="+size;}
                if(color!="")
                {url=url+"&IAColor="+color;}
                if(moreopt!="")
                {url=url+"&Mopt="+moreopt;}
                
                
          //   alert(url);
                xmlHttp2.onreadystatechange=stateChangedQV;

                xmlHttp2.open("GET",url,true);
                xmlHttp2.send(null);
    }


}


  
  
  
  
function stateChangedQV() 
{ 
if (xmlHttp2.readyState==4)
	{ 
	//alert('Item Added');
    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   



// showminicart function


var xmlHttpobj

function showminicart(opt)
{ 

xmlHttpobj=GetXmlHttpObject1();


if (xmlHttpobj==null)

  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var urll;  
 if (opt=='Y') 
  {	urll="shop/minishopcart.aspx";}
 else if(opt=='N')
  { urll="../shop/minishopcart.aspx"; }	
 else if(opt=='G')
  { urll="../../shop/minishopcart.aspx"; }	


urll=urll+"?cart="+get_cookie('shopcart');
urll=urll+"&DScart="+get_cookie('Dcart');
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;

}

//show minicart end//





//float enlarge iamge



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 = 650 //set x offset of bar in pixels
var startY = -100 //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("showenlargeimage").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("showenlargeimage");
	stayTopLeft();
}

function floatdivfunction(X,Y) {
    startX=X;
    startY=Y;

	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



//float enlarge image end




// javascript for enlarge image show

//Enlarge image.....................



function showhideimage(action) {
    if (action == "show") {
		document.getElementById('showenlargeimage').style.display = '';
	}
	else {
		document.getElementById('showenlargeimage').style.display = 'none';
	}
}




var enlargeimg;

function showlargeimage(itemcode, part, tmtoship, imagepath,cid) {

		enlargeimg = enlargcache();

	if (enlargeimg == null) {
		alert("Your browser does not support AJAX!");
		return;
	}

	var url = "../store/itemlarge.aspx";
	url = url + "?icode=" + itemcode;
	url = url + "&part=" + part;
	url = url + "&tmtoship=" + tmtoship;
	url = url + "&imgpath=" + imagepath;
	url = url + "&cid="+ cid+"";
	
	
	enlargeimg.onreadystatechange = enlargeimagestatus;
	enlargeimg.open("GET", url, true);
	enlargeimg.send(null);

}

function enlargeimagestatus() {
	if (enlargeimg.readyState == 4) {
		
		document.getElementById("showenlargeimage").innerHTML = enlargeimg.responseText;
	}
	else {
		document.getElementById("showenlargeimage").innerHTML = "<div style='backgroundcolor=#ffffff; width:100%'><img src='../images/loadingcircle.gif' alt=''/></div>";
	}
}

function enlargcache() {
	var enlargeimgcache = null;
	try {
		// Firefox, Opera 8.0+, Safari
		enlargeimgcache = new XMLHttpRequest();
	}
	catch (e) {
		// Internet Explorer
		try {
			enlargeimgcache = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			enlargeimgcache = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return enlargeimgcache;
}



// javascript for enlarge image end




// 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;
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 = "store/CurrencyDropDown.aspx";
	}
	else if (loc == "CATEGORY") {
		url = "../store/CurrencyDropDown.aspx";
	}
	else if (loc == "GLOBAL") {
		url = "../../store/CurrencyDropDown.aspx";
	}
	else {
		url = "CurrencyDropDown.aspx";
	}
	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;
	}
}



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 = "../../include/setothercurrency.aspx";
	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

// javascript for currency dropdown end



// Gift Card function in revieworder


  function AllowGCAmount(){
 			val=MM_findObj('GCamount'); 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;  }


///



//// javascript functions for sarees large

/*   
   
    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.aspx";
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 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 }	
	}
   
 var xmlHttpobj2;


function showitemtab1()
{

alert("jhsgdsdgskd");

}

function showitemtab(icd,mode,cid)
{ 

xmlHttpobj2=GetXmlHttpObject2();


if (xmlHttpobj2==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

	var checkt = 0;

	checkt = new Date().getTime();


  
var url="producttab.aspx";
url=url+"?icode="+icd;
url=url+"&mode="+mode;
url=url+"&cid="+cid;
url=url+"&chkd="+checkt;

xmlHttpobj2.onreadystatechange=stateChanged2;

xmlHttpobj2.open("GET",url,true);
xmlHttpobj2.send(null);

}

function stateChanged2() 
{ 
if (xmlHttpobj2.readyState==4)
	{
	     document.getElementById("sareetab").innerHTML=xmlHttpobj2.responseText;
	     restedivsize();
	}
	
else
	 {
		document.getElementById("sareetab").innerHTML="<table cellpadding=0 cellspacing=0 border=0 height='200px' width='700' style='vertical-align:top;padding:10px 0 0 10px'><tr><td width='700' height='200px' valign='top'><img src='../images/loadingstatus.gif' width='16' height='16' alt='' /><span class=carttext> Requesting content...</span><br><img src='../images/spacer.gif' width='750' height='16' alt=''></td></tr></table>"
		
	 }

}
 
function GetXmlHttpObject2()
{
var xmlHttpobj2=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttpobj2=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttpobj2=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttpobj2=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttpobj2;

}

function ShowTabCss(tabname)

{
     var IVIEW=document.getElementById('overview');   
     var SHIP=document.getElementById('shipping');   
     var BUYN=document.getElementById('buyernote');   
     var SITEM=document.getElementById('similaritems'); 
     var FAQ=document.getElementById('FAQ');   
     var ETF=document.getElementById('Email2Friend');
     var QA=document.getElementById('QA');   
   
     
     if (tabname=="IVIEW")
     {	
     IVIEW.style.backgroundColor="#42515A";
     SHIP.style.backgroundColor="";
     BUYN.style.backgroundColor="";
     SITEM.style.backgroundColor="";
     FAQ.style.backgroundColor="";
     ETF.style.backgroundColor="";
     QA.style.backgroundColor="";
     }     
    else if (tabname=="SHIP")     
     {	
     IVIEW.style.backgroundColor="";
     SHIP.style.backgroundColor="#42515A";
     BUYN.style.backgroundColor="";
     SITEM.style.backgroundColor="";
     FAQ.style.backgroundColor="";
     ETF.style.backgroundColor="";
     QA.style.backgroundColor="";
     }
     else if (tabname=="BUYN")
     
     {	
     IVIEW.style.backgroundColor="";
     SHIP.style.backgroundColor="";
     BUYN.style.backgroundColor="#42515A";
     SITEM.style.backgroundColor="";
     FAQ.style.backgroundColor="";
     ETF.style.backgroundColor="";
     QA.style.backgroundColor="";
     }

     else if (tabname=="SITEM")     
     {	
     IVIEW.style.backgroundColor="";
     SHIP.style.backgroundColor="";
     BUYN.style.backgroundColor="";
     SITEM.style.backgroundColor="#42515A";
     FAQ.style.backgroundColor="";
     ETF.style.backgroundColor="";
     QA.style.backgroundColor="";
     }
     
     else if (tabname=="FAQ")     
     {	
     IVIEW.style.backgroundColor="";
     SHIP.style.backgroundColor="";
     BUYN.style.backgroundColor="";
     SITEM.style.backgroundColor="";
     FAQ.style.backgroundColor="#42515A";
     ETF.style.backgroundColor="";
     QA.style.backgroundColor="";
     }
     else if (tabname=="ETF")
     {	
     IVIEW.style.backgroundColor="";
     SHIP.style.backgroundColor="";
     BUYN.style.backgroundColor="";
     SITEM.style.backgroundColor="";
     FAQ.style.backgroundColor="";
     ETF.style.backgroundColor="#42515A";
     QA.style.backgroundColor="";
     }
     else if (tabname=="QA")
     {	
     IVIEW.style.backgroundColor="";
     SHIP.style.backgroundColor="";
     BUYN.style.backgroundColor="";
     SITEM.style.backgroundColor="";
     FAQ.style.backgroundColor="";
     ETF.style.backgroundColor="";
     QA.style.backgroundColor="#42515A";

     }     
     
     
}

function ShowTabCssitem(tabname)

{
     var IVIEW=document.getElementById('overview');   
     var SHIP=document.getElementById('shipping');         
     var SITEM=document.getElementById('similaritems');        
     var ETF=document.getElementById('Email2Friend');
     var QA=document.getElementById('QA');   
   
     
     if (tabname=="IVIEW")
     {	
     IVIEW.style.backgroundColor="#42515A";
     SHIP.style.backgroundColor="";     
     SITEM.style.backgroundColor="";    
     ETF.style.backgroundColor="";
     QA.style.backgroundColor="";
     }     
    else if (tabname=="SHIP")     
     {	
     IVIEW.style.backgroundColor="";
     SHIP.style.backgroundColor="#42515A";     
     SITEM.style.backgroundColor="";     
     ETF.style.backgroundColor="";
     QA.style.backgroundColor="";
     }     

     else if (tabname=="SITEM")     
     {	
     IVIEW.style.backgroundColor="";
     SHIP.style.backgroundColor="";     
     SITEM.style.backgroundColor="#42515A";     
     ETF.style.backgroundColor="";
     QA.style.backgroundColor="";
     }     
     else if (tabname=="ETF")
     {	
     IVIEW.style.backgroundColor="";
     SHIP.style.backgroundColor="";     
     SITEM.style.backgroundColor="";     
     ETF.style.backgroundColor="#42515A";
     QA.style.backgroundColor="";
     }
     else if (tabname=="QA")
     {	
     IVIEW.style.backgroundColor="";
     SHIP.style.backgroundColor="";     
     SITEM.style.backgroundColor="";     
     ETF.style.backgroundColor="";
     QA.style.backgroundColor="#42515A";

     }     
     
     
}
//// javascript for sarees large end


/// Javascript for submit.aspx

function Validate()
{

  var flag=document.MailtoFriend.flag.value;
  var cid=document.MailtoFriend.cid.value;
  var icode=document.MailtoFriend.icode.value;
  var iname=document.MailtoFriend.iname.value;
  var imagpath=document.MailtoFriend.imagepath.value;
  var  Custname=document.MailtoFriend.YName.value;
  var messg = document.MailtoFriend.comments.value;
  var v=false;

if (document.MailtoFriend.FEmail1.value=="")
{
	alert("Please enter your friend's email address");
	document.MailtoFriend.FEmail1.focus();	
	return false;
}
else
{
   v=checkmail(document.MailtoFriend.FEmail1.value);
   if(v==false) 
    return false;
}
   
 if (document.MailtoFriend.YEmail.value=="")
{
	alert("Please enter your email address");
	document.MailtoFriend.YEmail.focus();	
	 return false;
}
else
{
   v=checkmail(document.MailtoFriend.YEmail.value);
   if(v==false) 
    return false;
}
  
 if (document.MailtoFriend.YName.value=="")
{
	alert("Please enter your name");
	document.MailtoFriend.YName.focus();
	 return false;	
}
if(document.MailtoFriend.FEmail2.value!="")
 {
  v=checkmail(document.MailtoFriend.FEmail2.value);
   if(v==false) 
    return false;
 }
 if(document.MailtoFriend.FEmail3.value!="")
 {
  v=checkmail(document.MailtoFriend.FEmail3.value);
   if(v==false) 
    return false;
 }
    iname = iname.replace("'","char(39)");
      Custname = Custname.replace("'","char(39)");
      messg = messg.replace("'","char(39)");            
		centerWindowX('submit.aspx?ItemCode='+icode+'&iname='+iname+'&mode=EmailToFriend&cid='+cid+'&Email1='+document.MailtoFriend.FEmail1.value+'&Email2='+document.MailtoFriend.FEmail2.value+'&Email3='+document.MailtoFriend.FEmail3.value+'&Email4='+document.MailtoFriend.YEmail.value+'&Custname='+Custname+'&messg='+messg+'&flag='+flag+'&imgpath='+imagpath+'');	
		document.MailtoFriend.reset();


}				
//email to friend

/// Javascript for submit.aspx


       


function submitLetterindexaspx(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('../store/submit.aspx?Email='+val+'&mode=letter');
         }
         else if(opt=='N')
         {  
        centerWindowX('submit.aspx?Email='+val+'&mode=letter');
         }

            document.newsletter.Email.value=''}}

       
function submitLetterindex2(){  
    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('submit.aspx?Email='+val2+'&mode=letter');
       document.newsletter2.EMailp.value=''}}


function validatecomment(str)
{
var comm
comm=str
if(comm!="")
{
return true;
}
else
{
alert("Comments can not Blank");
return false;


}
}

function checkSareeLarge(){
var val="false";
var str

	str=document.form2.Name.value;	
	val=validateData(str,'required,max=30,alpha','Name')
		
	if (val==true)
	{
	
		str=document.form2.mail.value;  
	
		val=validateData(str,'required,max=50,email','Email ID')
		if (val==true)
		{
			str=document.form2.Comments.value;  
		   val=validatecomment(str);
		
			if(val==true)
			{
			
			 return true;
			 
			 }
	else
	{ 
	document.form2.Comments.focus();}}
	else
	{ document.form2.mail.focus();} 
	} 
	else
	{ document.form2.Name.focus();}
	return val;}


function ReplaceAll(Source,stringToFind,stringToReplace)  //nkt
{
    var temp = Source;
    var index = temp.indexOf(stringToFind);

    while(index != -1)
    {
        temp = temp.replace(stringToFind,stringToReplace);
        index = temp.indexOf(stringToFind);
    }
    return temp;
}

function CheckAllSpecialChars() //nkt
{
    var SplChars = "`~!#$%^&*()+-=:[]\{}|\":<>'";
    var count=document.form2.Comments.value.length;
					
	for (var i = 0; i < count; i++)
	{
	    if (SplChars.indexOf(document.form2.Comments.value.charAt(i)) != -1) 
		{
			alert('Message : allows Only following Characters :\n [ @  ?  / .  ; ] \n\n Please remove unallowed characters and try again.');
			document.form2.Comments.focus();
			return false;
		}
		
    }
    return true;
}
//////////////////////////////////////////// 
//function CheckAllSpecialChars() //function call on submit for speciall charecter  
//{
//   var SplChars = "!#$%^&*+=[]\\\';/{}|\":<>";   
//   var f =document.getElementsByTagName("form");   
//    
//    for(var k=0;k<f.length;k++){   //for all form 'for'
//    var c = document.getElementsByTagName("form")[k].getElementsByTagName("*"); 
//   
//   for(var j = 0; j < c.length; j++) //for all tag in form 'for'
//   {
//	   
//           var el= c[j];  
//           if ( (el.tagName == "INPUT"&&el.type=="text") || el.tagName == "TEXTAREA" )
//           {   
//                   var elecount=c[j].name;  
//                   var count=document.getElementById(elecount).value;   
//                   		
//	                for (var i = 0; i < count.length; i++) //finding splcharecter 'for'
//	                {
//	                    if (SplChars.indexOf(count.charAt(i)) != -1) 
//		                {
//			               alert('Special Characters are not allowed!');
//                						
//			                var str=count;
//                            var iChars = "!#$%^&*+=[]\\\';/{}|\":<>";
//                            for (var p = 0; p < str.length; p++) //remooving splcharacter 'for'
//                            {
//                                    if (iChars.indexOf(str.charAt(p)) != -1)
//                                     {
//                                       var z=iChars.indexOf(str.charAt(p));
//                                       var sp=iChars.charAt(z);                
//                                       el.value=el.value.replace(sp,'');              
//                                     }
//                             }                
//			                return false;
//			                
//		                 }
//		                                  
//                     } 
//                     
//             }

//    }
//   
//   }
//  
//    return true;
// }
////////////////////////////////////////


function submitTquery(icode)
{ 

	var val=checkSareeLarge();	
	var custname = document.form2.Name.value;
	if (val==true && CheckAllSpecialChars()== true)  //nkt
	{
       val=document.form2.Comments.value;
       val = val.replace("'","char(39)");
       custname = custname.replace("'","char(39)");
       val = ReplaceAll(val,"-"," ");  //nkt
	   centerWindowX('submit.aspx?custemail='+document.form2.mail.value+'&custname='+custname+'&mode=queryforitem'+'&icode='+icode+'&comments='+val); 
       document.form2.reset();
    }
    else{return false;}
}





function textCounter(field,cntfield,maxlimit) {
if (field.value.length > maxlimit)
field.value = field.value.substring(0, maxlimit);
else
cntfield.value = maxlimit - field.value.length;
}




function make_blank(dis,q)
{

	if (dis=="hide")
	{
	if ( document.getElementById(q).value=="Enter Keyword or Item Code" )
	{
	document.getElementById(q).value="";	
	}
	}
	else if (dis=="show")
	{
	 if (document.getElementById(q).value=="")
	{
	document.getElementById(q).value="Enter Keyword or Item Code";	
	}}

	
}






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 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";	
	}
	}

	
}


function displaycartquery(icode) {	
     if (icode==undefined)
        alert("Your shoppingbag is empty.")
     else {
       s="width=545,height=370,left=150,top=55"
	   s1="../store/itemquery.aspx?cartlist="+icode
	   win1=window.open(s1,"",s); }
	}


function displayquery(icode) {	 
     if (icode==undefined)
        alert("Your Wishilst is Empty.")
     else {
       s="width=545,height=370,left=150,top=55"
	   s1="../store/itemquery.aspx?list="+icode
	   win1=window.open(s1,"",s); }
	}
	
	
function MailTo(list) { 
   if (list==undefined)
        alert("Your Wishilst is Empty."); 
   else{
        s="width=545,height=450,left=150,top=55"
		s1="../store/MailtoFriend.aspx?list="+ list 
		win1=window.open(s1,"",s)  
		return false;  }
   }    



// itemquery

function submitItemQuery(){

    
    var val="";
    var com= document.itemqueryform.Comments.value;
    com = com.replace("'","char(39)");
    var Yname = document.itemqueryform.YName.value;
    Yname = Yname.replace("'","char(39)");
    
    MM_validateForm('Comments','','R','YName','','R','Email','','RisEmail');
    
    if (document.MM_returnValue) { 
       if (checkmail(document.itemqueryform.Email.value)){
       val=document.itemqueryform.items.value 
       val=val+'|'+com; 
       val=val+'|'+Yname;       
       val=val+'|'+document.itemqueryform.Email.value;    
        
       centerWindow('submit.aspx?val='+val+'&mode=cartquery');}
    }
    }

// itemquery



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 DisAllowNumbers(){
      if ((window.event.keyCode >= 48 && window.event.keyCode <= 57) || window.event.keyCode==39 || window.event.keyCode==34 || window.event.keyCode==60 || window.event.keyCode==62 || window.event.keyCode==63 || window.event.keyCode==124 || window.event.keyCode==45 || window.event.keyCode==43 || window.event.keyCode==58 || window.event.keyCode==40 || window.event.keyCode==41) {
           window.event.returnValue=false; }
        else if(window.event.keyCode == 32){
          window.event.returnValue=true;}
}

//--------------start--------------------------------------------

function DisAllowNumbers1(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 >=65 && browserchk <=90)
    {
         return true;
    }
    if(browserchk >=97 && browserchk <=122)
    {
         return true;
    }
	
	if(browserchk >=48 && browserchk <=57)
    {
         return false;
    }
    if(browserchk >=33 && browserchk <=255)
    {
        return false;
    }
}

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 DisAllowSplCharandNumbers(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 >=65 && browserchk <=90)
    {
         return true;
    }
    if(browserchk >=97 && browserchk <=122)
    {
         return true;
    }
    if(browserchk == 46 || browserchk == 44)
    {
    return true;
    }
	
	if(browserchk >=48 && browserchk <=57)
    {
         return false;
    }
    if(browserchk >=33 && browserchk <=255)
    {
        return false;
    }
}

function DisAllowAlphabets1(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 >=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)
        
    }
}

function PostalCodeFormat(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 >=48 && browserchk <=57) ||(browserchk >=65 && browserchk <=90) || (browserchk >=97 && browserchk <=122)|| browserchk ==32 ) //space(32)and dash/hyphen(45)
    {
         return true;
    }
    if(browserchk >=33 && browserchk <=255)
    {
        return false;
    }  
}
//----------------------end-------------------------------------------

function changebuttoncolor(e, mouse) // change button color
{

var color="";
if (mouse == "OVER")
{
color="#C13100";
}
else
{
color="#CC6600";
}
var el=window.event? event.srcElement: e.target
if (el.tagName=="INPUT"&&el.type=="submit" || el.tagName=="INPUT"&&el.type=="button" )
el.style.backgroundColor=color
}

function verifysearchkeyword()
{

var keyword="";
keyword = document.search.q.value;

        if (keyword=="" || keyword=="Enter Keyword or Item Code")
        {

        alert("Please enter keyword for search!");

        }
        else
        {
      
                search.submit();
                            
        }

}



function verifysearchkeywords(pageloc)
{

var keyword="";
keyword = document.search.q.value;

        if (keyword=="" || keyword=="Enter Keyword or Item Code")
        {
        alert("Please enter keyword for search!");
        return false;
        }
        else
        {
            if(pageloc=='search') {   window.location.href='../store/search.aspx?q='+keyword ;}
            else if(pageloc=='adsearch') {   window.location.href='../store/textsearch.aspx?cx=006683068870264856926:db-jn-vpts4&cof=FORID:11&q='+keyword ;}
            else if(pageloc=='tag') {   window.location.href='../store/tagging.aspx?q='+keyword ;}
            return true;
        }
        

}
function verifysearchkeywordsindex(pageloc)
{

var keyword="";
keyword = document.search.q.value;

        if (keyword=="" || keyword=="Enter Keyword or Item Code")
        {
        alert("Please enter keyword for search!");
        }
        else
        {
            if(pageloc=='search') {   window.location.href='../../store/search.aspx?q='+keyword ;}
            else if(pageloc=='adsearch') {   window.location.href='../../store/advancedsearch.aspx?cx=006683068870264856926:db-jn-vpts4&cof=FORID:11&q='+keyword ;}
            else if(pageloc=='tag') {   window.location.href='../../store/tagging.aspx?q='+keyword ;}
        }
        

}





// 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)", 15000);

}

// END tab box timing show function //




 var faqid="";

function showFaq(fid)
{
if(faqid!="")
{ document.getElementById('F'+faqid).style.display="none"; }

document.getElementById('F'+fid).style.display="";
faqid=fid;

}

function checkspecialcharecter(str, fieldname){
	var invalidchar="([{}])!#$^*';:,/\\|+-`~<>=~@."
	for (i=0; i<(invalidchar.length-1); i++){
		temp=invalidchar.substring(i,i+1);	
		     
		if (str.indexOf(temp)!=-1)
		{	alert("Special characters/spaces are not allowed in "+ fieldname +"." ); return false} 
	}		 		
return true; }



function checktagval() {
    var countlength=0;
    var tag = document.SLtagform.tag.value;
    var cidref = document.SLtagform.cidref.value;
    var icode = document.SLtagform.icode.value;
    tag = tag.replace("'","char(39)");
    			
    if (tag == "") {
        alert("Please enter your tag.");
        document.SLtagform.tag.focus();
    }    
    else if (tag.length>30)
    {
       
        for(var i=1;i<=tag.length;i++){countlength=countlength+1;}
        alert("Please enter your tag not more than 30 characters. \nCurrently there are :  " +countlength+ "  Characters.");
        document.SLtagform.tag.focus();
    }
    
    
    else {
        if(checkspecialcharecter(tag,"Tag Box"))
          {  centerWindowX('submit.aspx?ItemCode=' + icode + '&tag=' + tag + '&mode=tagsub&cid=' + cidref + '');
            tag="";
          }
          document.SLtagform.tag.value="";
    }
}



function displaysetreview(icode, cid) {
    var win1
    var ss = "border:raised;dialogHeight:700px;dialogWidth:667px;center:yes;help:no;resizeable:no;scroll:yes;status:no;"
    var ss1 = "../store/itemreview.aspx?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 displaysetQA(cid,icode,mode,qid) {
    var win1
    var ss = "border:raised;dialogHeight:540px;dialogWidth:710px;center:yes;help:no;resizeable:no;scroll:yes;status:no;"
    var ss1 = "itemqueans.aspx?icode=" + icode;
    ss1 = ss1 + "&cid=" + cid;
    ss1 = ss1 + "&mode=" + mode;
    ss1 = ss1 + "&qid=" + qid;
    if (window.showModalDialog) {
        win1 = window.showModalDialog(ss1, "", ss)
    }
    else {
        win1 = window.open(ss1, "", "width=710px,height=540px,top=5")
    }
}


function submitQAns(icode,mode,qid){ 

	var val=checkSareeLarge();	
	var custname = document.form2.Name.value;
	if (val==true){
       val=document.form2.Comments.value;
       val = val.replace("'","char(39)");
       custname = custname.replace("'","char(39)");
       centerWindowX('submit.aspx?custemail='+document.form2.mail.value+'&custname='+custname+'&mode='+mode+'&icode='+icode+'&qid='+qid+'&comments='+val); 
       window.parent.close();}
    else{return false;}
    }





function initARC(formId, onClassRadio, offClassRadio, onClassCheckbox, offClassCheckbox) {
    
    var agt = navigator.userAgent.toLowerCase();

    // Browser Detection stuff
    this.major = parseInt(navigator.appVersion);

    this.ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));

    this.ie3 = (this.ie && (this.major < 4));
    this.ie4 = (this.ie && (this.major == 4) && (agt.indexOf("msie 4") != -1));
    this.iemac = (this.ie && (agt.indexOf("mac") != -1));

    if (!(this.iemac || ie3 || ie4)) {

        customiseInputs(formId, onClassRadio, offClassRadio, onClassCheckbox, offClassCheckbox);

    }

}


function submitform() {
    var val = getSelectedCheckboxValue(document.ratingform.rating);
    if (val == "") {
        alert("Please select one of the \"Code Rating\" options.");
    }
    else {
        centerWindowX('submit.aspx?ItemCode='+document.ratingform.ItemCode.value+'&rating=' + val + '&mode=rating');
    }
}



//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 customiseInputs(formId, onClassRadio, offClassRadio, onClassCheckbox, offClassCheckbox) {

    if (!document.getElementById) return;
    var prettyForm = document.getElementById(formId);
    if (!prettyForm) return;
    prettyForm.onreset = function() { customiseInputs(formId, onClassRadio, offClassRadio, onClassCheckbox, offClassCheckbox); }
    addLabelProperties(prettyForm);
    var inputs = prettyForm.getElementsByTagName('input');
    for (var i = 0; i < inputs.length; i++) {
        if ((inputs[i].type == "radio") && inputs[i].label && onClassRadio && offClassRadio) {
            //hide element
            inputs[i].style.position = "absolute"; inputs[i].style.left = "-1000px";
            //initialise element
            inputs[i].label.className = offClassRadio;
            //when the label is clicked, call toggleLabelStyle and toggle the label
            inputs[i].label.onclick = function() { toggleLabelStyle(formId, this, onClassRadio, offClassRadio); };
            //enable keyboard navigation
            inputs[i].onclick = function() { toggleLabelStyle(formId, this.label, onClassRadio, offClassRadio); };
            //if the radio was checked by default change this label's style to checked
            if (inputs[i].defaultChecked || inputs[i].checked) { toggleLabelStyle(formId, inputs[i].label, onClassRadio, offClassRadio); }
        }
        if ((inputs[i].type == "checkbox") || (inputs[i].type == "radio") && inputs[i].label) {
            //Attach keyboard navigation
            if (!this.ie) {
                inputs[i].label.style.margin = "1px";
                inputs[i].onfocus = function() { this.label.style.border = "1px dotted #333"; this.label.style.margin = "0px"; return false; };
                inputs[i].onblur = function() { this.label.style.border = "none"; this.label.style.margin = "1px"; return false; };
            }
        }
    }

}

function addLabelProperties(f) {
    if (typeof f.getElementsByTagName == 'undefined') return;
    var labels = f.getElementsByTagName("label"), label, elem, i = j = 0;

    while (label = labels[i++]) {
        if (typeof label.htmlFor == 'undefined') return;
        elem = document.getElementById(label.htmlFor);
        //elem = f.elements[label.htmlFor]; /* old method */

        if (typeof elem == 'undefined') {
            //no label defined, find first sub-input
            var inputs = label.getElementsByTagName("input");
            if (inputs.length == 0) {
                continue;
            } else {
                elem = inputs[0];
            }
        } else if (typeof elem.label != 'undefined') { // label property already added
            continue;
        } else if (typeof elem.length != 'undefined' && elem.length > 1 && elem.nodeName != 'SELECT') {
            for (j = 0; j < elem.length; j++) {
                elem.item(j).label = label;
            }
        }
        elem.label = label;
    }

}

function toggleLabelStyle(formId, label, onClass, offClass) {
    if (!document.getElementById || !label) return;

    var form = document.getElementById(formId); //label.form;
    var ratingval = new Array("I don't like it", " It's OK ", "It's Good", "I like it", "I love it");
    var form = document.getElementById(formId); //label.form;
    if (!form) return;

    //find radio associated with label (if in htmlFor form)
    if (label.htmlFor) {
        var e = document.getElementById(label.htmlFor);

        if (e.type == "checkbox") {
            e.label.className = (e.label.className == onClass) ? offClass : onClass;
            e.checked = (e.label.className == onClass);
        } else if (e.type == "radio") {
            var radioGroup = form.elements[e.name];
            if (!radioGroup) return;

            var rating = (e.id.length == 7) ? e.id.substring(e.id.length - 1, e.id.length) : e.id.substring(e.id.length - 2, e.id.length);
            var cont = document.getElementById("content")
            if (cont) cont.innerHTML = ratingval[rating - 1];


            for (var i = 0; i < radioGroup.length; i++) {
                if (radioGroup[i].label) {
                    // REMOVED -- radioGroup[i].label.className = ((radioGroup[i].checked=(radioGroup[i].id == e.id)) && radioGroup[i].label) ? onClass : offClass;
                    radioGroup[i].label.className = (rating > i) ? onClass : offClass;
                    radioGroup[i].checked = (radioGroup[i].id == e.id);
                }
            }
        }
    }

}



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 {
        centerWindowX('submit.aspx?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');
        window.parent.close();
    }
}



var y;
var i;
var z;
var timerID = 0;
function showNewlyAdded(x, countNewlyadded) {
    z = countNewlyadded;
    for (i = 0; i < countNewlyadded; i++) 
    {
        document.getElementById('Div_' + i).style.display = "none";
    }
    document.getElementById('Div_' + x).style.display = "";
    if (x == countNewlyadded-1) {
     y = 0; }
    else
    { y = x + 1; }
    clearTimeout(timerID);
    timerID = 0;
    timerID = setTimeout("showNewlyAdded(y,z)", 1500);
}

function stopCount()
{
clearTimeout(timerID);
}
function timedCount()
{

timerID = setTimeout("showNewlyAdded(y,z)", 1500);
}

function stopMatchingAss()
{

timerID = setTimeout("showMatchingitems(y,z)", 1500);
}



function DisAllowspace(e)
{
var key =window.event ? e.keyCode : e.which;
      if (key >= 48 && key <= 57) {
           return true; }
                 else if(key >=32 && key <=255){
          return false;}
 }

 
 
 ////////////////////////////////////
 
   // 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 (!e) e = window.event;
  if (e.target) el = e.target;
  else if (e.srcElement) el = e.srcElement;

      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)
        {
        
       var str=el.value;
        var iChars = "!#`~$%^&*+=[]';{}|\":<>";
        for (var i = 0; i < str.length; i++) {
                if (iChars.indexOf(str.charAt(i)) != -1) {
                var z=iChars.indexOf(str.charAt(i));
                var sp=iChars.charAt(z);                
               el.value=el.value.replace(sp,'');               
               
        }
                }
                
       
        }
      }

  
  }

  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 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(pros!="")
 {
      document.getElementById('notifyrules').style.display='none';
      centerWindowX('../store/submit.aspx?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.aspx?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 notifyrules1=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  notifyrules1=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    notifyrules1=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    notifyrules1=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return notifyrules1;
}

function HelpListhide()
{
document.getElementById('notifyrules').style.display="none";
}
//Alert Item


function submitLetterindexaspx_n(opt){  


if (opt =='F'){

    var giftcode="";

    giftcode=document.surveyfeedback.surveycode.value;


    if(document.surveyfeedback.Email.value=="")
   		{alert("Please Enter Email ID");
   		document.surveyfeedback.Email.focus();}
    else if (checkmail(document.surveyfeedback.Email.value)){
       val=document.surveyfeedback.Email.value
       
         if (opt=='F') 
         {	
        centerWindowX('../store/submit.aspx?Email='+val+'&mode=surveyfeedback&giftcode='+giftcode);
         }
            document.surveyfeedback.Email.value=''}
            
     }
     else
     {
     
    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('../store/submit.aspx?Email='+val+'&mode=letter');
         }
         else if(opt=='N')
         {  
        centerWindowX('../store/submit.aspx?Email='+val+'&mode=letter');
         }

            document.newsletter.Email.value=''}
     }
            }
            
            
            
            
            
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 submitRSVPQuery(){ 
    var fname
    var RSVP
    var telephone
    if(document.Events.fname.value=="")
   		{alert("Please Enter Your Name");
   		document.Events.fname.focus();}
    else if(document.Events.EMail1.value=="")
   		{alert("Please Enter Email ID");
   		document.Events.EMail1.focus();}
   	else if(document.Events.RSVP.value==0)
   		{alert("Please Select Your RSVP");
   		document.Events.RSVP.focus();}

    else if (checkmail(document.Events.EMail1.value)){
       val=document.Events.EMail1.value 
       fname=document.Events.fname.value 
       RSVP=document.Events.RSVP.value 
       telephone=document.Events.telephone.value 
       fname = fname.replace("'","char(39)");

       centerWindowX('../store/submit.aspx?email='+val+'&fname='+fname+'&RSVP='+RSVP+'&telephone='+telephone+'&mode=RSVP');
       document.Events.fname.value=''
       document.Events.EMail1.value=''
       document.Events.telephone.value=''
       }}
       
function submitItemRSVPQuery(){ 
    var fname
    var icode
    var RSVP
    var category
    var telephone
    var type
    if(document.Variety.EMail1.value=="")
   		{alert("Please Enter Email ID");
   		document.Variety.EMail1.focus();}
    else if(document.Variety.icode.value=="" && document.Variety.category.value==0)
   		{
   		
   		 alert("Please choose atleast one of the options either Item code or Category");
   		document.Variety.category.focus();}
   	//else if(document.Variety.category.value==0)
   		//{alert("Please Select Category");
   		//document.Variety.category.focus();}
   		else if(document.getElementById('checkmmt').innerHTML == "Invalid Itemcode")
   		{
   		alert("please Enter valid itemcode");
   		}

    else if (checkmail(document.Variety.EMail1.value)){
       val=document.Variety.EMail1.value 
       fname=document.Variety.fname.value 
       icode=document.Variety.icode.value 
       category=document.Variety.category.value 
       telephone=document.Variety.telephone.value 
       type=document.Variety.type.value 
       fname = fname.replace("'","char(39)");

       centerWindowX('../store/submit.aspx?email='+val+'&fname='+fname+'&icode='+icode+'&category='+category+'&type='+type+'&telephone='+telephone+'&mode=itemRSVP');
       document.Variety.fname.value=''
       document.Variety.icode.value=''
       document.Variety.EMail1.value=''
       document.Variety.type.value=''
       document.Variety.category.value=0
       document.Variety.telephone.value=''
       }}

       
       
       
       
       function showmain_menuindex(id)
{ 
document.getElementById('MAINMENU'+id).style.display=""; 
document.getElementById('col'+id).style.background="background-image: url('../../images/index-images/red.gif') repeat";
}

function hidemain_menuindex(id)
{ 
document.getElementById('MAINMENU'+id).style.display="none";
document.getElementById('col' + id).style.background = "background-image: url('../../images/top-bg.gif') no-repeat";
}



///custumer detail ////
function closediv()
{
document.getElementById("logindetaildiv").style.display = "none";
}

function HideLine(obj){	
  var d=document.getElementById(obj);
	d.style.textDecoration="none";
	d.style.color= "black";}
	
function DisplayLine(or){  
  var d=document.getElementById(or);  
	d.style.textDecoration="underline"	
	d.style.color= "#993333";
	}
	
	var detail;

function showdetaildiv(divstatus) {


if (divstatus=='SHOW')
{

var tempurl;

tempurl=new Date();

	detail= checkajax();

	if (detail== null) {
		alert("Your browser does not support AJAX!");
		return;
	}
	var url;

	url = "customerdetaildiv.aspx?custd="+divstatus+"&dt="+tempurl;
	
	detail.onreadystatechange = fetchdetaildiv;
	detail.open("GET", url, true);
	detail.send(null);
	
	}
}

function fetchdetaildiv() {

	if (detail.readyState == 4)
	{
	
		document.getElementById("detaildiv").innerHTML = detail.responseText;
	}

	else
	{
		document.getElementById('detaildiv').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 Reload () {
var f = document.getElementById('iframe1');
f.contentWindow.location.reload(true);
}

///custumer detail end ////


// x-function.js file functions...///

function displayquote(icode) {	
     s="border:raised;dialogHeight:370px;dialogWidth:545px;center:yes;help:no;resizeable:no;scroll:no;status:no;"
     s1="../store/itemquery.aspx?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="../store/Superenlarge.aspx?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="../store/Embroiderylarge.aspx?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("../store/superenlarge.aspx?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.aspx?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 addToCart() { 	
		document.form1.mode.value="addshop";
  		document.form1.submit(); }

function addToCartJewelry()
{
      var cid=document.form1.cid.value;
      var typeid=document.form1.typeid.value;
      var ie=navigator.appName;
     if(ie=='Netscape')
     {
        if(document.form1.size=='[object HTMLSelectElement]' )
        {
         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();  
       }   
        
     }
      else
       {
           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 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='../shop/navigate-cart.aspx?list='+document.getElementById("list").value+'&mode=removewish';
}


function addSelected(){
 if (document.getElementById("list").value=="")
    alert ("Please select item.")
 else
   document.location.href='../shop/navigate-cart.aspx?list='+document.getElementById("list").value+'&mode=addshop'+'&loc=W';
}


function SaveList(list){
     if (list==undefined)
        alert("Your Wishilst is Empty.");
     else      
        document.location.href='../account/loginform.aspx?loc=w';   
   }


function Registernow(ucat){
  if (ucat=='B')
    path='../b2b/newuser.aspx';
  else if(ucat=='R')
    path='resellerform.aspx'    
  else
	path='newuser.aspx'  
  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('../store/submit.aspx?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('../store/submit.aspx?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('../store/submit.aspx?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('../store/submit.aspx?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('../store/submit.aspx?val='+val+'&mode=wishquery');}
    }
    }  


function submitCartQuery(){
var Yname = document.form1.YName.value;
Yname= Yname.replace("'","char(39)");
    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+'.;'+Yname;       
       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('../store/submit.aspx?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('../store/submit.aspx?email='+val+'&icode='+val1+'&mode=request');} 
      }


function updatecart(){
	document.f1.action="../shop/updatecart.aspx"
	document.f1.submit()
	}

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('../store/submit.aspx?ItemCode='+icode+'&IReview='+IReview+'&mode=ItemReview&cid='+cidref+'');
		document.reviewform.reset();
		
	}
}

function checkSubmit()
{
  var tag=document.tagform.tag.value;
  tag = tag.replace("'","char(39)");
  var cidref=document.tagform.cidref.value;
  var icode=document.tagform.icode.value;
if (tag=="")
{
	alert("Please enter your tag.");	
}
else
{
		centerWindowX('../store/submit.aspx?ItemCode='+icode+'&tag='+tag+'&mode=tagsub&cid='+cidref+'');			
	}
}

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=""
  
}

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="../store/item-detail.aspx";
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;
}

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.aspx?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 checkSubmit1()
{
  var tag=document.tagform.tag.value;
  tag = tag.replace("'","char(39)");
  var cidref=document.tagform.cidref.value;
  var icode=document.tagform.icode.value;
if (tag=="")
{
	alert("Please enter your tag.");	
}
else
{
		centerWindow('../store/submit.aspx?ItemCode='+icode+'&tag='+tag+'&mode=tagsub&cid='+cidref+'');			
	}
}

function ItemReviewPage1()
{
  var IReview=document.reviewform.review.value;
  IReview = IReview.replace("'","char(39)");
  var cidref=document.reviewform.cidreview.value;
  var icode=document.reviewform.reviewcode.value;
  
if (IReview=="")
{
	alert("Please enter your Review.");	
}
else
	{
		centerWindow('../store/submit.aspx?ItemCode='+icode+'&IReview='+IReview+'&mode=ItemReview&cid='+cidref+'');
		document.reviewform.reset();
	}
}

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;
}

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 b2bshowmain_menu(id)
{ 
document.getElementById('MAINMENU'+id).style.display=""; 
document.getElementById('col'+id).style.background="background-image: url('http://www.utsavsarees.com/images/index-images/red.gif') 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/images/top-bg.gif') no-repeat";
}

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.aspx"; }
	
else if (isIn==2)
	{  url="http://b2b.utsavsarees.com/b2bmenu.aspx";}	
	
else
	{  url="../store/mainmenu.aspx";}

	 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;
	}
}

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;

}

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 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!");
}

}

function doyouknowshow()
{
document.getElementById("doyouknow").style.display=""


}
function doyouknowhide()
{
document.getElementById("doyouknow").style.display="none"


}

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=color;
document.getElementById('morecolor').style.display='';


}


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;
document.getElementById('IAColor').value=color;

SColor=color;
}


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 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('../../store/submit.aspx?Email='+val+'&mode=letter');
         }
         else if(opt=='N')
         {  
        centerWindowX('../../store/submit.aspx?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('../../store/images/index-images/red.gif') repeat";
}

function contactquery1()
{

var val=false;
var str;
var custname;
var fmail;
var message;
var querysub;
var ccmail;

		if(document.form1.con_sub.value==0)
		{
		alert("select the Subject")
		val=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)
   	                            {custname=document.form1.fullname.value;
                                 fmail=document.form1.qemail.value;
                                 message=document.form1.message.value;
	                             querysub=document.form1.con_sub.value;
	                                     if(document.form1.concheck.checked==true)
	                                     {
	                                     ccmail="Yes";	                                    
                                         }
                                         else
                                         {
                                         ccmail="No";
                                         }
                                         
                                         centerWindowX('../store/submit.aspx?custname='+custname+'&fmail='+fmail+'&message='+message+'&querysub='+querysub+'&ccmail='+ccmail+'&mode=contactquery'); 
                                         document.form1.reset();
                                   }                                        
                                         
                                         
                                 else
		                            {document.form1.message.focus();
		                            alert("Message Can Not Be Blank!")
		                            return false
		                            }}	
                    	
                      else
		                    {document.form1.fullname.focus();}
		                    
		                    }
                    		
	
		   else
	
	{document.form1.qemail.focus();}}
	
		return false;
	}
	
	
	
	function contactqueryb2b()
{
var valnew
var why = true;
if (document.form1.message.value=="")
{
alert("Message Can Not Blank")
document.form1.message.focus();
return false;

}
else if (document.form1.fullname.value=="")
{
alert("Contact Person Name Can Not Blank")
document.form1.fullname.focus();
return false;
}
else if (document.form1.qemail.value=="")
{
alert("E-Mail Address Can Not Blank")
document.form1.qemail.focus();
return false;
}
else if (document.form1.phone.value=="")
{
alert("Phone Number Can Not Blank")
document.form1.phone.focus();
return false;
}
else if (document.form1.Countryname.selectedIndex=="")
{
alert("Country Name Can Not Blank")
document.form1.Countryname.focus();
return false;
}

else if (document.form1.qemail.value != "")
    {
    	why = checkmail(document.form1.qemail.value );
    		if (why != true)
    		{
    		document.form1.qemail.focus();
    		return false;
    		}   	
	 }
 
 valnew=document.form1.message.value;
 valnew=valnew+'.;'+document.form1.companyname.value;
 valnew=valnew+'.;'+document.form1.fullname.value;
 valnew=valnew+'.;'+document.form1.qemail.value;
 valnew=valnew+'.;'+document.form1.phone.value;
 valnew=valnew+'.;'+document.form1.address.value;
 valnew=valnew+'.;'+document.form1.city.value;
 valnew=valnew+'.;'+document.form1.Countryname.value;
 centerWindowX('http://www.utsavsarees.com/store/submit.aspx?val='+valnew+'&mode=contactqueryb2b'); 
 document.form1.reset();
 

}



// my account

 function submitTrackRequest(co)
 {
    var frm=document.getElementById("ODetails");
    var ctrl=document.getElementById("txtTrackNbrs");
    ctrl.value=co;
    frm.action="http://track.dhl-usa.com/TrackByNbr.asp?nav=Tracknbr"
    frm.submit();
 }
 
   function DPEXTrackRequest(a)
{
         var frm=document.getElementById("ODetails");
         var ctrl=document.getElementById("txtConnote");
         ctrl.value=a;
         frm.action="http://www.dpex.com/trackenq_general.asp"
         frm.submit();
}

function DivHide(divid)
{
document.getElementById(divid+'Div').style.display='none';
document.getElementById(divid+'hide').style.display='none';
document.getElementById(divid+'show').style.display='';
}

function DivShow(divid)
{
document.getElementById(divid+'show').style.display='none';
document.getElementById(divid+'hide').style.display='';
showtracking(divid);
}



//

function restedivsize() { // function to reset the div size

	var pageHeight;

	pageHeight = document.documentElement.scrollHeight;


	document.getElementById("mainouterdiv").style.height = pageHeight + 'px';

}


function showshort()
{ 

document.getElementById('short').style.display=""; 

}

function hideshort()
{ 
document.getElementById('short').style.display="none";

}



function cstimedivshow()
{
document.getElementById('cstimediv').style.display=""; 
}

function cstimedivhide()
{
document.getElementById('cstimediv').style.display='none'; 
}



var cstime;

function showcstimediv() {

	cstime = checkajax();
	
	if (cstime == null) {
		alert("Your browser does not support AJAX!");
		return;
	}
	var url;
	url = "../store/cstime.aspx" ;
	cstime.onreadystatechange = fetchCStimediv;
	cstime.open("GET", url, true);
	cstime.send(null);
}


function showcstimedivGBL()   // for global folder
 {

	cstime = checkajax();
	
	if (cstime == null) {
		alert("Your browser does not support AJAX!");
		return;
	}
	var url;

	url = "../../store/cstime.aspx" ;

	cstime.onreadystatechange = fetchCStimediv;
	cstime.open("GET", url, true);
	cstime.send(null);
}


function fetchCStimediv() {
	if (cstime.readyState == 4) {
	    document.getElementById('cstimediv').style.display=""; 
		document.getElementById("cstimediv").innerHTML = cstime.responseText;
	}

	else {
		  document.getElementById('cstimediv').style.display=""; 
		 document.getElementById('cstimediv').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>"
	}
}


 /// live chat code
/* var lpMTagConfig ;

function chat()
 {
 var lpButtonCTTUrl ;
 lpButtonCTTUrl = 'http://server.iad.liveperson.net/hc/39756636/?cmd=file&amp;file=visitorWantsToChat&amp;site=39756636&amp;imageUrl=http://www.utsavsarees.com/images/chat&amp;referrer='+escape(document.location); lpButtonCTTUrl = (typeof(lpAppendVisitorCookies) != 'undefined' ? lpAppendVisitorCookies(lpButtonCTTUrl) : lpButtonCTTUrl); lpButtonCTTUrl = ((typeof(lpMTag)!='undefined' && typeof(lpMTag.addFirstPartyCookies)!='undefined')?lpMTag.addFirstPartyCookies(lpButtonCTTUrl):lpButtonCTTUrl);window.open(lpButtonCTTUrl,'chat39756636','width=475,height=400,resizable=yes');return false;
 }
 
 function chatfunc()
 {
  lpMTagConfig = {'lpServer' : "server.iad.liveperson.net",'lpNumber' : "39756636",'lpProtocol' : "http"}; 
 
 }
function lpAddMonitorTag(src){if(typeof(src)=='undefined'||typeof(src)=='object'){src=lpMTagConfig.lpMTagSrc?lpMTagConfig.lpMTagSrc:'/hcp/html/mTag.js';}if(src.indexOf('http')!=0){src=lpMTagConfig.lpProtocol+"://"+lpMTagConfig.lpServer+src+'?site='+lpMTagConfig.lpNumber;}else{if(src.indexOf('site=')<0){if(src.indexOf('?')<0)src=src+'?';else src=src+'&';src=src+'site='+lpMTagConfig.lpNumber;}};var s=document.createElement('script');s.setAttribute('type','text/javascript');s.setAttribute('charset','iso-8859-1');s.setAttribute('src',src);document.getElementsByTagName('head').item(0).appendChild(s);} if (window.attachEvent) window.attachEvent('onload',lpAddMonitorTag); else window.addEventListener("load",lpAddMonitorTag,false);*/
 /// end of live chat code



function getpricevalue(pageloc)
    { 
    var pageloc=pageloc;
    var rang1= document.getElementById('pricerangefrom').value;
    var rang2= document.getElementById('pricerangeto').value;
    if(rang1==""||rang1=="From")
    {
        alert("Please enter minimum price");
        document.getElementById('pricerangefrom').focus();
    }
    else if(rang2==""||rang2=="To")
    {
        alert("Please enter maximum price");
        document.getElementById('pricerangeto').focus();
    }
    else if(parseInt(rang1,10)>parseInt(rang2,10)||parseInt(rang1,10)==parseInt(rang2,10))
    {
        alert("Maximum price must be greater than minimum price");
    }
    else
    { 
        if(parseInt(rang1,10)-1>=0)
        {  
        var loc=pageloc+(rang1-1)+'-'+rang2; 
        }
        else
        {var loc=pageloc+rang1+'-'+rang2;}   
    window.parent.location.href=loc; 
    }   
    }
    
    
    
 function make_blankrange(valu,id,disp)
    {
    var  val = document.getElementById(id).value;
    
if (disp=='hide')
{
    if(val==valu)
    {
    document.getElementById(id).value='';
    document.getElementById(id).style.color="#3E3939";
    }
 }
 else
 {
    if( (val==valu) || (val==''))
    {
    document.getElementById(id).value=valu;
    document.getElementById(id).style.color="#cccccc";
    }
 }   
    }





var xmlheaderobj;
var i=0;
function showhead(page)
{ 
xmlheaderobj=GetXmlHttpObjheader();
var currentDate = new Date()
if (xmlheaderobj==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
 
var url="../../account/customersignin.aspx?check="+currentDate.getMilliseconds();
xmlheaderobj.onreadystatechange=stateChangedheader;

xmlheaderobj.open("GET",url,true);
xmlheaderobj.send(null);

}

function stateChangedheader() 
{ 
if (xmlheaderobj.readyState==4)
	{ 

          document.getElementById("signcust").innerHTML=xmlheaderobj.responseText;

          if(xmlheaderobj.responseText !="") 
           	 {
       	 	document.getElementById("signcust").className="redprice";
      	 	document.getElementById("signcust").style.paddingLeft=5 ;
      	 	document.getElementById("sign").innerHTML="&nbsp;,&nbsp;&nbsp;<a href='../../account/loginform.aspx' title='My Account'>My Account<\/a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='../../account/logout.aspx' title='Sign Out'>Sign Out<\/a>" ;
      	 }
      	 else
	     {
	     document.getElementById("sign").innerHTML="&nbsp;&nbsp;<a href='../../account/loginform.aspx' title='My Account'>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;
}


function rsvpitemcheck()
{ 
var code=document.getElementById("icode");

var icode=code.value;

document.getElementById('checkmmt').style.display="";

mmtlistpop=custmmtpop();

if (mmtlistpop==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var url="../store/rsvpitemcheck.aspx?icode="+icode;

mmtlistpop.onreadystatechange=custmmtpoptatus;
mmtlistpop.open("GET",url,true);
mmtlistpop.send(null);

}

function custmmtpoptatus() 
{ 
if (mmtlistpop.readyState==4)
	{ 
     document.getElementById('checkmmt').innerHTML=mmtlistpop.responseText;
    
	}
	else
	{
	 document.getElementById('checkmmt').innerHTML="<table cellpadding='0' cellspacing='0' width='200' border='0' style='background:#ffffff;padding-left:5px'><tr><td width='200' class='carttext'><img src='../images/loadingstatus.gif' alt='' /><b> Loading, Please wait.....</b></td></tr></table>"
	}
}
 
function custmmtpop()
{
var mmtlistpop=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  mmtlistpop=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    mmtlistpop=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    productlarge=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return mmtlistpop;
}



// more option function 
function chkstatusms()
{
if(document.getElementById('cbox1').checked==true)
{
 document.getElementById('ms').style.display="";
 }
 else
 {
 document.getElementById('ms').style.display="none";
 }
}


function chkstatusmsQuickView(icd)
{

if(document.getElementById(icd+'Mopt').checked==true)
 {
 document.getElementById(icd+'ms').style.display="";
// document.getElementById(icd+'Moption').value="";
 }
 else
 {
 document.getElementById(icd+'ms').style.display="none";
 }
  //alert(document.getElementById(icd+'Moption').value);

 
}


function show(id)
{
document.getElementById(id).style.display="";
}
function hide(id)
{
document.getElementById(id).style.display="none";
}



function mcheck(id)
{
if(document.getElementById(id).checked==true)
{
 document.getElementById('as1').checked=true;
 //document.getElementById('as3').checked=true;
}
if(id=='rd1')
{
 document.getElementById('rd2').checked=false;
 document.getElementById('rd3').checked=false;
}
if(id=='rd2')
{
 document.getElementById('rd1').checked=false;
 document.getElementById('rd3').checked=false;
}
if(id=='rd3')
{
 document.getElementById('rd2').checked=false;
 document.getElementById('rd1').checked=false;
}
}



function mcheckQuickView(id,icd)
{
if(document.getElementById(icd+id).checked==true)
{
 document.getElementById(icd+'as1').checked=true;
 //document.getElementById('as3').checked=true;
}
if(id=='rd1')
{
 document.getElementById(icd+'rd2').checked=false;
 document.getElementById(icd+'rd3').checked=false;
 document.getElementById(icd+'MOption').value = document.getElementById(icd+'rd1').value;
}
if(id=='rd2')
{
 document.getElementById(icd+'rd1').checked=false;
 document.getElementById(icd+'rd3').checked=false;
 document.getElementById(icd+'MOption').value = document.getElementById(icd+'rd2').value;
}
if(id=='rd3')
{
 document.getElementById(icd+'rd2').checked=false;
 document.getElementById(icd+'rd1').checked=false;
 document.getElementById(icd+'MOption').value = document.getElementById(icd+'rd3').value;
}
}


/////////////////





var feedbackshow;
var pageview;
var classid;

function showtestimonailindex(page,classifyid) 
{

    var chk;
    classid = classifyid;

    chk = new Date().getTime();
    pageview = page;
    feedbackshow = feedbackshowpop();

    if (feedbackshow == null) {
        alert("Your browser does not support AJAX!");
        return;
    }
    var url;
    if (pageview == "mainpage") {
        url = "../store/testimonialindexshowaspx.aspx?classfyid=" + classid + "&chk=" + chk;
    }
    else if (pageview == "ajaxpage") {
    url = "../store/customerfeedback.aspx?classfyid=" + classid + "&chk=" + chk;
}
    
    feedbackshow.onreadystatechange = feedbackshowstatus;
    feedbackshow.open("GET", url, true);
    feedbackshow.send(null);

}

function feedbackshowstatus() {
    if (feedbackshow.readyState == 4) {
        if (pageview == "mainpage") {
            document.getElementById('feedbackshowdiv_' + classid).innerHTML = feedbackshow.responseText;
        }
        else if (pageview == "ajaxpage") {
        document.getElementById('customerfeedbackshowdiv_' + classid).style.display = "";
        document.getElementById('customerfeedbackshowdiv_' + classid).innerHTML = feedbackshow.responseText;
    }
    }
    else {
        if (pageview == "mainpage") {
            document.getElementById('feedbackshowdiv_' + classid).innerHTML = "<table cellpadding='0' cellspacing='0' width='200' border='0' style='background:#ffffff;padding-left:5px'><tr><td width='200' class='carttext'><img src='../images/loadingstatus.gif' alt='' /> Loading, Please wait.....</td></tr></table>"
        }
        else if ( pageview=="ajaxpage")
        {
            document.getElementById('customerfeedbackshowdiv_' + classid).innerHTML = "<table cellpadding='0' cellspacing='0' width='200' border='0' style='background:#ffffff;padding-left:5px'><tr><td width='200' class='carttext'><img src='../images/loadingstatus.gif' alt='' /> Loading, Please wait.....</td></tr></table>"
        }

    }
}

function feedbackshowpop() {
    var feedbackshow = null;
    try {
        // Firefox, Opera 8.0+, Safari
        feedbackshow = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            feedbackshow = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            feedbackshow = new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    return feedbackshow;
}

//////////////////////////////////




var itemquickview;
var quickviewcode;
var tempquickviewcode="";

function showitemquickview(itemcode,thumbposition) {

    
    //var chk;
    var loadloc;

    if (thumbposition > 2 ) {
        loadloc = "left:0px;"
    }
    else {
        loadloc = "right:0px"
    }
    
    
    //chk = new Date().getTime();
    itemquickview = itemquickviewcache();
    quickviewcode = itemcode;

  
    document.getElementById("quickview_" + quickviewcode).style.display = "none";
    if (tempquickviewcode != "") {
        if (tempquickviewcode != quickviewcode) {
            document.getElementById("quickview_" + tempquickviewcode).style.display = "none";
        }
        document.getElementById("thumbDetailview_" + tempquickviewcode).style.display = "none";
    }
    if (itemquickview == null) {
        alert("Your browser does not support AJAX!");
        return;
    }

    var url = "../store/quickview.aspx";
    url = url + "?itemcode=" + quickviewcode + "&loadloc=" + loadloc;

 
    itemquickview.onreadystatechange = itemquickviewstatus;
    itemquickview.open("GET", url, true);
    itemquickview.send(null);

}

function itemquickviewstatus() {
    if (itemquickview.readyState == 4) {
        document.getElementById("thumbDetailview_" + quickviewcode).style.display = "";
        document.getElementById("thumbDetailview_" + quickviewcode).innerHTML = itemquickview.responseText;
        tempquickviewcode = quickviewcode;
    }
    else {
        document.getElementById("thumbDetailview_" + quickviewcode).innerHTML = "<div style='backgroundcolor=#ffffff; width:100%; position:absolute'><img src='../images/loadingcircle.gif' alt=''/></div>";
        tempquickviewcode = quickviewcode;
    }
}



var itemSize;
var sizeIcode="";

function showitemSize(itemcode,mode) {
    
    var chk;
    sizeIcode=itemcode;
    
    chk = new Date().getTime();
    itemSize = itemquickviewcache();
  
    if (itemSize == null) {
        alert("Your browser does not support AJAX!");
        return;
    }

    var url = "../store/sizeview.aspx";

    url = url + "?itemcode=" + sizeIcode + "&mode="+mode+"&dt="+chk ;

 
    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 itemquickviewhide(itemcode)
{
    document.getElementById('quickview_' + itemcode).style.display = "";
    document.getElementById('thumbDetailview_' + itemcode).style.display = "none";

}


function sizeview_hide(obj)
{
//alert(icd);
//document.getElementById('thumbSize_'+icd).style.display = "none";

obj.style.display = "none";


}


function mouseovercolorchange(tab1,tab2,hidediv,showtab) {

    document.getElementById(tab1).style.backgroundColor = "#42515A";
    document.getElementById(tab2).style.backgroundColor = "#CCCCCC";
    document.getElementById(showtab).style.display = "";
    document.getElementById(hidediv).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";
    }
}
//function dropwindow(style)
//{

//var cid=document.form1.DropDownList1.value;
//var color=document.form1.DropDownList2.value;
//var range=document.form1.DropDownList3.value;
//var qstring = "";

//if (cid != "Select Category")
//           { qstring = "?cid=" + cid; }
//         if (color != "Select Color")
//         { qstring = qstring + "&color=" + color; }
//        if (range != "Select Range")
//         { qstring = qstring + "&range=" + range; }
//        
//         window.open('../store/advancedsearch.aspx' + qstring ,style);
//        
//}

function dropwindow(style)
{

var cid=document.form1.DropDownList1.value;
var color=document.form1.DropDownList2.value;
var range=document.form1.DropDownList3.value;
var fabric=document.form1.DropDownList4.value;
var qstring = "";

if (cid != "Select Category")
           { qstring = "?cid=" + cid; }
            if (fabric != "Select Fabric"&&fabric != "Select Type")
         { qstring = qstring + "&fabric=" + fabric; }
         if (color != "Select Color")
         { qstring = qstring + "&color=" + color; }
        if (range != "Select Range")
         { qstring = qstring + "&range=" + range; }
        
         window.open('../store/advancedsearch.aspx' + qstring ,style);
        
}



var xmlHttpfooter

function showfooternote()
{ 
xmlHttpfooter=GetXmlHttpObject();

if (xmlHttpfooter==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var dttime=0;
dttime= new Date().getTime();

var url="../store/footernote.aspx?dt="+ dttime ;

xmlHttpfooter.onreadystatechange=footernote;

xmlHttpfooter.open("GET",url,true);
xmlHttpfooter.send(null);

}

function footernote() 
{ 
if (xmlHttpfooter.readyState==4)
	 { 
        document.getElementById('footernote').innerHTML = xmlHttpfooter.responseText;
        restedivsize()
	 }
else {
        document.getElementById('footernote').innerHTML = "<div style='backgroundcolor=#ffffff; width:100%; position:absolute'><img src='../images/loadingcircle.gif' alt=''/></div>";
     
     }	
	
	
	
}


