//++++++++++++++++++start function for AroundBust++++++++++++++++++++++++++
//Function for check following condition
//1.Is Around Above Waist is blank ?
//2.If not blank then Maxvalue of Around Above Waist is value(Around Bust)+8 and MinValue = value(Around Bust)-3 

function AroundBust()
{
	var ABust = document.measure.around_bust.value;
	var AAWaist = document.measure.around_above_waist.value;
	var AHips = document.measure.around_hips.value;	
	
	if (AAWaist!=0){
		var MaxVal = parseInt(ABust) - 3;
		var MinVal = parseInt(ABust) - 8;
	
		if (AAWaist < MinVal){alert("As your Around Bust "+ ABust + "."+'\n' +"So Around Above Waist value must between "+ MinVal+ " and "+ MaxVal+"." );document.measure.around_above_waist.selectedIndex=0; document.measure.around_above_waist.focus();}	
		else if (AAWaist > MaxVal){alert("As your Around Bust "+ ABust + "."+ '\n' +"So Around Above Waist value must between "+ MinVal+ " and "+ MaxVal+"." );document.measure.around_above_waist.selectedIndex=0; document.measure.around_above_waist.focus();}	
	}
}

//++++++++++++++++++End function for AroundBust++++++++++++++++++++++++++


//++++++++++++++++++Start function for AroundAboveWaist++++++++++++++++++++++++++
//Function for check following condition
//1.Is Around Bust is blank ?
//2.If not blank then Maxvalue of Around Above Waist is value(Around Bust)+8 and MinValue = value(Around Bust)-3 
//3.Is Around Hips is blank?
//4.If not blank then check Around Hips value must be greater then Around Above waist.

function AroundAboveWaist()
{
	var ABust = document.measure.around_bust.value;
	var AAWaist = document.measure.around_above_waist.value;
	var AHips = document.measure.around_hips.value;	

	var MaxVal = parseInt(ABust) - 3;
	var MinVal = parseInt(ABust) - 8;	
		
	if (ABust != 0){
		if (AAWaist < MinVal){alert("As your Around Bust "+ ABust +"."+ '\n' +"So Around Above Waist value must between "+ MinVal+ " and "+ MaxVal+"." );document.measure.around_above_waist.selectedIndex=0;}	
		else if (AAWaist > MaxVal){alert("As your Around Bust "+ ABust +"."+ '\n' + "So Around Above Waist value must between "+ MinVal+ " and "+ MaxVal+"." );document.measure.around_above_waist.selectedIndex=0;}	
	}
	if (AHips != 0){
		var AAWaist = document.measure.around_above_waist.value;
		if (AHips <= AAWaist){alert("As your Around Above Waist is "+ AAWaist +"."+ '\n' +"So Your Around Hips value must be greater then "+AAWaist+".");document.measure.around_hips.selectedIndex=0;document.measure.around_hips.focus();}	
	 }
}

//++++++++++++++++++End function for AroundAboveWaist++++++++++++++++++++++++++


//++++++++++++++++++Start function for AroundHips++++++++++++++++++++++++++
//Function for check following condition
//1.Is Around Hips is less then Around waist
//2.Around Hips is less then Around Above waist

function AroundHips()
{
	var AWaist = document.measure.around_waist.value;
	var AAWaist = document.measure.around_above_waist.value;
	var AHips = document.measure.around_hips.value;		
	var MaxVal = parseInt(AWaist) + 15;

if (AAWaist != 0)
{
	if (AHips <= AAWaist){alert("As your Around Above Waist is "+ AAWaist +".So Your Around Hips value must be greater than "+AAWaist+".");document.measure.around_hips.selectedIndex=0;}
}	
if (AWaist != 0){	
		if (AHips <= AWaist){alert("Around Hips value must be greater than Around Waist.");document.measure.around_hips.selectedIndex=0;}
		//else if (AHips <= AAWaist){alert("As your Around Above Waist is "+ AAWaist +".So Your Around Hips value must be greater than "+AAWaist+".");document.measure.around_hips.selectedIndex=0;}
	}	
if (AWaist != 0){
	if (AHips > MaxVal){alert("As your Above Waist is "+ AWaist +". So Max value of Your Around Hips is "+MaxVal+".");document.measure.around_hips.selectedIndex=0;}
	}
}
//++++++++++++++++++End function for AroundHips++++++++++++++++++++++++++


//++++++++++++++++++Start function for AroundWaist++++++++++++++++++++++++++
//Function for check following condition
//1.Is Around Hips is blank ?
//2.If not then Around Hips must be greter then Around Waist.

function AroundWaist()
{
	var AHips = document.measure.around_hips.value;	
	var AWaist = document.measure.around_waist.value;
	if (AHips!=0)
	{
		if (AHips <= AWaist){alert("As your Around Waist is "+ AWaist +".So Your Around Hips value must be greater then "+AWaist+".");document.measure.around_hips.selectedIndex=0;document.measure.around_hips.focus();}
	}
}
//++++++++++++++++++End function for AroundWaist++++++++++++++++++++++++++

//++++++++++++++++++Start function for CheckSleeve++++++++++++++++++++++++++
//Function for check following condition
//1.If sleeveless then disable sleeve length

function CheckSleeve(sleeve_type){
		var myindex  = sleeve_type.selectedIndex
		var SelValue = sleeve_type.options[myindex].value				
		
		
		if (SelValue=="Sleeveless")
		{
			document.measure.sleeve_length.selectedIndex=0;		
 			document.getElementById('sleeve_length').disabled=true;  			
 		} 		
		else{document.getElementById('sleeve_length').disabled=false;}			
	}
//++++++++++++++++++End function for CheckSleeve++++++++++++++++++++++++++

//++++++++++++++++++Start function for CheckFrontStyle++++++++++++++++++++++++++
//Function for check following condition
//1.If Frontstyle is Chinese then disable Backstyle
//2.If Frontstyle is Sweet-heart 1 and Sweet-heart 2  then disable Backstyle


function CheckFrontStyle(front_neck_style){
		var myindex  = front_neck_style.selectedIndex
		var SelValue = front_neck_style.options[myindex].value
		if ((SelValue=="Chinese Collar") || (SelValue=="Sweet-heart 2"))
		{
			document.measure.back_neck_style.selectedIndex=0;		
 			document.getElementById('back_neck_style').disabled=true;  			
 		} 
 		
 		else if (SelValue=="Off-shoulder")
		{
			document.measure.back_neck_style.selectedIndex=8;	
			document.getElementById('front_neck_depth').disabled=true; 	
 			document.getElementById('back_neck_style').disabled=true; 
 			document.getElementById('back_neck_depth').disabled=true;  	 			
 		} 
 		
 		else if (SelValue=="One-shoulder")
		{
			document.measure.back_neck_style.selectedIndex=9;		
 			document.getElementById('back_neck_style').disabled=true;  			
 		} 


		else{document.getElementById('back_neck_style').disabled=false;}			
	}
//++++++++++++++++++End function for CheckFrontStyle++++++++++++++++++++++++++


//++++++++++++++++++Start function for CheckFrontStyle++++++++++++++++++++++++++
//Function for check following condition
//1.If Frontstyle is Chinese then disable Backstyle
//2.If Frontstyle is Sweet-heart 1 and Sweet-heart 2  then disable Backstyle


function CheckSleeveStyle(front_neck_style){
		var myindex  = front_neck_style.selectedIndex
		var SelValue = front_neck_style.options[myindex].value
		if ((SelValue=="Halter neck 1") || (SelValue=="Halter neck 2") || (SelValue=="Halter neck 3") || (SelValue=="One-shoulder") || (SelValue=="Off-shoulder"))
		{
			document.measure.sleeve_type.selectedIndex=0;		
 			document.getElementById('sleeve_type').disabled=true;  
 			document.measure.sleeve_length.selectedIndex=0;		
 			document.getElementById('sleeve_length').disabled=true;  				
 		} 
 		
		else
		{
		document.getElementById('sleeve_type').disabled=false;
		document.getElementById('sleeve_length').disabled=false;

		}			
	}
//++++++++++++++++++End function for CheckFrontStyle++++++++++++++++++++++++++



//++++++++++++++++++Start function for CheckStyle++++++++++++++++++++++++++
//Function for check following condition
//1.If churidar then disable around_knee

function CheckStyle(bottomstyle){
		var myindex  = bottomstyle.selectedIndex
		var SelValue = bottomstyle.options[myindex].value				
		
		
		if (bottomstyle.selectedIndex==6) 
		{
		//document.measure.bottomstyle.selectedIndex=0;
		document.getElementById('around_knee').disabled=false;
		document.getElementById('around_ankle').disabled=false;
		document.getElementById('around_thigh').disabled=false;
		document.getElementById('around_calf').disabled=false;
		document.getElementById('around_bottom').disabled=true;
 		} 
 		else if (bottomstyle.selectedIndex==7)
		{
	
		//document.measure.bottomstyle.selectedIndex=0;
		document.getElementById('around_knee').disabled=false;
		document.getElementById('around_ankle').disabled=false;
		document.getElementById('around_thigh').disabled=false;
		document.getElementById('around_calf').disabled=false;
		document.getElementById('around_bottom').disabled=true;
 		} 		
		else if (bottomstyle.selectedIndex==8)
		{
		//document.measure.bottomstyle.selectedIndex=0;
		document.getElementById('around_knee').disabled=false;
		document.getElementById('around_ankle').disabled=false;
		document.getElementById('around_thigh').disabled=false;
		document.getElementById('around_calf').disabled=false;
		document.getElementById('around_bottom').disabled=true;
 		} 		

		else if (bottomstyle.selectedIndex==9)
		{
		//document.measure.bottomstyle.selectedIndex=0;
		document.getElementById('around_bottom').disabled=false;
		document.getElementById('around_knee').disabled=true;
		document.getElementById('around_ankle').disabled=true;
		document.getElementById('around_thigh').disabled=true;
		document.getElementById('around_calf').disabled=true;
		}	
		else if (bottomstyle.selectedIndex==10)
		{
		//document.measure.bottomstyle.selectedIndex=0;
		document.getElementById('around_bottom').disabled=false;
		document.getElementById('around_knee').disabled=true;
		document.getElementById('around_ankle').disabled=true;
		document.getElementById('around_thigh').disabled=true;
		document.getElementById('around_calf').disabled=true;
		}	

		else
		{
		//alert("hello");
		//document.measure.bottomstyle.selectedIndex=0;
		document.getElementById('around_knee').disabled=true;
		document.getElementById('around_ankle').disabled=true;
		document.getElementById('around_thigh').disabled=true;
		document.getElementById('around_calf').disabled=true;
		document.getElementById('around_bottom').disabled=true;
		}		
	}
//++++++++++++++++++End function for CheckSyle++++++++++++++++++++++++++


//++++++++++++++++++Start function for CheckStyle++++++++++++++++++++++++++
//Function for check following condition
//1.If churidar then disable around_knee

function CheckKidsStyle(bottomstyle){
		var myindex  = bottomstyle.selectedIndex
		var SelValue = bottomstyle.options[myindex].value				
		
		if (SelValue!="Churidar")
		{
			document.measure.around_knee.selectedIndex=0;		
 			document.getElementById('around_knee').disabled=true;  
 			document.getElementById('around_knee').style.backgroundColor="#B6B4B4";  
 			document.measure.around_ankle.selectedIndex=0;		
 			document.getElementById('around_ankle').disabled=true;	
 			document.getElementById('around_ankle').style.backgroundColor="#B6B4B4"; 
 			document.measure.around_thigh.selectedIndex=0;		
 			document.getElementById('around_thigh').disabled=true;	
 			document.getElementById('around_thigh').style.backgroundColor="#B6B4B4"; 
 			document.measure.around_calf.selectedIndex=0;		
 			document.getElementById('around_calf').disabled=true;	
 			document.getElementById('around_calf').style.backgroundColor="#B6B4B4";  
		
 		} 		
		else{
		document.getElementById('around_knee').disabled=false;
		document.getElementById('around_knee').style.backgroundColor="#ffffff";  
		document.getElementById('around_ankle').disabled=false;
		document.getElementById('around_ankle').style.backgroundColor="#ffffff";  
		document.getElementById('around_thigh').disabled=false;
		document.getElementById('around_thigh').style.backgroundColor="#ffffff";  
		document.getElementById('around_calf').disabled=false;
		document.getElementById('around_calf').style.backgroundColor="#ffffff";  

		}			
	}
//++++++++++++++++++End function for CheckSyle++++++++++++++++++++++++++




//++++++++++++++++++Start function for ShowWindow++++++++++++++++++++++++++
	
	function ShowWindow(url, name, param, v){
	val= MM_findObj(v);
	var x=window.showModalDialog(url,name,param);
	val.selectedIndex=x
	}
//++++++++++++++++++End function for ShowWindow++++++++++++++++++++++++++


//++++++++++++++++++Start function for Around Ankle++++++++++++++++++++++++++
//Function for check following condition
//1.Is Around Calf is blank ?
//2.If not blank then it's value must be Less then then Around Calf. 

function Around_Ankle(){
	 var ACalf = parseInt(document.measure.around_calf.value);
	 var AAnkle = parseInt(document.measure.around_ankle.value);
	 
	 if (ACalf != 0) 
	 {
	 	if (AAnkle >= ACalf){alert("Around Ankle value must be Less then Around Calf.");document.measure.around_ankle.selectedIndex=0;}
	 }
}
//++++++++++++++++++End function for Around Ankle++++++++++++++++++++++++++

//++++++++++++++++++Start function for Around Calf++++++++++++++++++++++++++
//Function for check following condition
//1.Is Around Knee is blank ?
//2.If not blank then it's value must be grater then Around Calf. 
//3.Is Around Ankle is blank?
//4.If not blank then it's value must be Less then Around calf.

function Around_Calf(){

 var AKnee = parseInt(document.measure.around_knee.value);
 var ACalf = parseInt(document.measure.around_calf.value);
 var AAnkle = parseInt(document.measure.around_ankle.value);
 
 if (AKnee != 0)
 { 	
 	if (ACalf >= AKnee){alert("Around Calf value must be Less then Around Knee.");document.measure.around_calf.selectedIndex=0;document.measure.around_calf.focus();}
 }
 if (AAnkle != 0)
 {
 	if (ACalf <= AAnkle){alert("Around Ankle value must be Less then Around Calf.");document.measure.around_ankle.selectedIndex=0;document.measure.around_ankle.focus();}
 }
}
//++++++++++++++++++End function for Around Calf++++++++++++++++++++++++++

//++++++++++++++++++Start function for Around Knee++++++++++++++++++++++++++
//Function for check following condition
//1.Is Around Calf is blank ?
//2.If not blank then it's value must be less then Around Knee. 

function Around_Knee(){

 var AKnee = parseInt(document.measure.around_knee.value);
 var ACalf = parseInt(document.measure.around_calf.value);
 
if (ACalf != 0)
  {  
 	if (ACalf >= AKnee){alert("Around Calf value must be Less then Around Knee.");document.measure.around_calf.selectedIndex=0;document.measure.around_calf.focus(); }
  }
}

//++++++++++++++++++End function for Around Knee++++++++++++++++++++++++++

//++++++++++++++++++Start function for AroundAboveWaist for salwar kameeze only++++++++++++++++++++++++++
//Function for check following condition
//1.Is Around Bust is blank ?
//2.If not blank then Maxvalue of Around Above Waist is value(Around Bust)+8 and MinValue = value(Around Bust)-3 
//3.Is Around Hips is blank?
//4.If not blank then check Around Hips value must be greater then Around Above waist.

function AroundAboveWaist_SK(Stype)
{
	var ABust = document.measure.around_bust.value;
	var AAWaist = document.measure.around_above_waist.value;

	var MaxVal = parseInt(ABust) - 3;
	var MinVal = parseInt(ABust) - 8;
	if ((Stype == 'salwar') || (Stype == 'churidar')){	
		if (ABust!=0){
			if (AAWaist < MinVal){alert("As your Around Bust "+ ABust +".So Around Above Waist value must between "+ MinVal+ " and "+ MaxVal+"." );document.measure.around_above_waist.selectedIndex=0;}	
			else if (AAWaist > MaxVal){alert("As your Around Bust "+ ABust +".So Around Above Waist value must between "+ MinVal+ " and "+ MaxVal+"." );document.measure.around_above_waist.selectedIndex=0;}	
		}	
	}
	else
	{
		var AHips = document.measure.around_hips.value;	
		if (ABust!=0){
		if (AAWaist < MinVal){alert("As your Around Bust "+ ABust +".So Around Above Waist value must between "+ MinVal+ " and "+ MaxVal+"." );	document.measure.around_above_waist.selectedIndex=0;}	
		else if (AAWaist > MaxVal){alert("As your Around Bust "+ ABust +".So Around Above Waist value must between "+ MinVal+ " and "+ MaxVal+"." ); document.measure.around_above_waist.selectedIndex=0;}	
	}
	if (AHips!=0){
		var AAWaist = document.measure.around_above_waist.value;
		if (AHips <= AAWaist){alert("As your Around Above Waist is "+ AAWaist +".So Your Around Hips value must be greater then "+AAWaist+".");document.measure.around_hips.selectedIndex=0;document.measure.around_hips.focus();}	
	 }
	}
}

//++++++++++++++++++End function for AroundAboveWaist for salwar kameeze only++++++++++++++++++++++++++

//++++++++++++++++++Start function for AroundThigh++++++++++++++++++++++++++
//Function for check following condition
//1.Is Around Hips is blank ?
//2.If not then Around Thigh  must be greter then Around Hips.

function AroundThigh_SK(Stype)
{
	var AHips = document.measure.around_hips.value;	
	var AThigh = document.measure.around_thigh.value;
	
	if (AHips!=0)
	{
		if (AThigh >= AHips){alert("As your Around Hips is "+ AHips +".So Your Around Thigh value must be less then "+AHips+".");document.measure.around_thigh.selectedIndex=0;document.measure.around_thigh.focus();}
	}
}
//++++++++++++++++++End function for AroundThigh++++++++++++++++++++++++++


function Sleeve_Length()
{
 var SSize = document.measure.sleeve_type.value;
 var SLength = document.measure.sleeve_length.value;
 
 if (SSize != 0)
 {
 	if (SSize == 'Half Sleeves'){if (SLength > 8){alert('Max. Length of Half Sleeves is 8 inches.');document.measure.sleeve_length.selectedIndex=0;}}
 	else if (SSize == 'Mega Sleeves'){if (SLength > 4){alert('Max. Length of Mega Sleeves is 4 inches.');document.measure.sleeve_length.selectedIndex=0;}}	
 } 
}

var debug = true; 
//function right(e)
// { if (navigator.appName == 'Netscape' && (e.which == 3 || e.which== 2)) 
// return false; 
// else if (navigator.appName == 'Microsoft Internet Explorer'&& (event.button == 2 || event.button == 3)) 
// {alert('Right click is protected!'); 
// return false;
//  } 
// return true; 
// } 
// document.onmousedown=right; 
// if (document.layers) 
//window.captureEvents(Event.MOUSEDOWN); 
//window.onmousedown=right; 

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 closeDiv1()
{
document.getElementById('checkmmtlist').style.display="none";
}

function closeDiv2()
{
document.getElementById('checkmmtlist1').style.display="none";
}

var designitem;
function closeDivpop(design)
{
designitem=design;
document.getElementById('checkmmtpop'+designitem).style.display="none";
}

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 MM_openBrWindow(theURL,winName,features) { 
     window.open(theURL,winName,features);}
     
function checkWholeForm(Lform){
 	var val=false
 	var str
   	str=Lform.loginname.value; 
   	val=validateData(str,'required,max=50,email','Email ID')   	
   	if (val==true){
	  str=Lform.password.value; 
	  val=validateData(str,'required,alnum','Your Password')
   	  if (val==true){
         Lform.submit(); }
      else {
	     Lform.password.focus(); 
	     return false; } }		
    else {
	  Lform.loginname.focus();
	  return false; }
   }
   
   function validateData(strValidateStr,command,fieldname) 
{ var newcommand=command.split(",");
  for (var i=0; i < newcommand.length; i++){ 
   var val = validateform(strValidateStr,newcommand[i],fieldname)
   if (val==false){
  	return val;}}
  return val;}

function validateform(strValidateStr,command,fieldname)
{ var strError="";  var epos = command.search("="); var  newcommand  = ""; var  cmdvalue = ""; 
  if(epos >= 0){ 
     newcommand  = command.substring(0,epos); 
     cmdvalue = command.substr(epos+1);} 
  else{ 
     newcommand = command;} 
 
  switch(newcommand){ 
    case "req": 
    case "required": 
    { if((strValidateStr.length) == 0){ 
          strError = fieldname + " is a  Required Field"; 
          alert(strError);
          strError="";
          return false;} 
       break;} 
    case "maxlength": 
    case "max": 
    { if (strValidateStr.length > cmdvalue){ 
          strError = fieldname + " : has more than allowed maximum characters  "; 
          strError=strError + "\n[Current length = " + strValidateStr.length + " ]"
          alert(strError);
          strError = "";	
          return false; }
      break;}
    case "minlength": 
    case "min": 
    { if(strValidateStr.length < cmdvalue){ 
          strError = fieldname + " : has less than allowed minimum characters  "; 
          alert(strError + "\n[Current length = " + strValidateStr.length + " ]"); 
          return false;} 
          break;} 
    case "alnum": 
    case "alphanumeric":{ 
      var charpos = strValidateStr.search("[^A-Za-z0-9-/,.  ]"); 
      if(strValidateStr.length > 0  &&  charpos >= 0){ 
          strError = fieldname +" : allows Only alpha-numeric characters  "; 
          alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
          strError="";
          return false;} 
          break;}
    case "num": 
    case "numeric":{ 
      var charpos = strValidateStr.search("[^0-9]"); 
      if(strValidateStr.length > 0 &&  charpos >= 0){ 
          strError = fieldname+" : allows Only numbers ";                
          alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
          strError="";
          return false;} 
          break;} 
    case "alphabetic": 
    case "alpha":{ 
      var charpos = strValidateStr.search("[^A-Za-z ]"); 
      if(strValidateStr.length > 0 &&  charpos >= 0){ 
          strError = fieldname+" : allows Only alphabetic characters  "; 
          alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
          strError="";
          return false;} 
          break;} 
    case "email":{ 
      if(!checkmail(strValidateStr)){ 
          return false;} 
          break;} 
    case "lt": 
    case "lessthan":{ 
      if(isNaN(strValidateStr)){ 
          alert(fieldname+" : Should be a number "); 
          return false;} 
          if ((strValidateStr) >=  eval(cmdvalue)){ 
              strError = fieldname + " : value should be less than "+ cmdvalue;              
              alert(strError); 
              strError="";
              return false;}            
          break;}
    case "gt": 
    case "greaterthan":{ 
      if(isNaN(strValidateStr)){ 
          alert(objValue.name+" : Should be a number "); 
          return false;}
          if(strValidateStr <=  eval(cmdvalue)){ 
              strError = fieldname + " : value should be greater than "+ cmdvalue; 
              alert(strError);
              strError=""; 
              return false;}             
          break;} 
    case "regexp":{ 
      if(!strValidateStr.match(cmdvalue)){ 
          strError = fieldname +" : Invalid characters found "; 
          alert(strError); 
          return false;} 
          break;} 
    case "UT":{ 
      if(strValidateStr.search("UT") < 0 && strValidateStr.search("ut") < 0 && strValidateStr.search("uT") < 0 && strValidateStr.search("Ut") < 0){ 
          strError = fieldname +" : must start with UT"; 
          alert(strError); 
          return false;} 
          break;} 
   } 
 return true;} 
function messageval(str)
{
if(str!="")
{
return true
}
	
}	
function contactquery()
{
var val=false
var valnew
var str
		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)
   	{valnew=document.form1.fullname.value;
     valnew=valnew+'.;'+document.form1.qemail.value;
	 valnew=valnew+'.;'+document.form1.ordernumber.value;
	 valnew=valnew+'.;'+document.form1.message.value;
	  valnew=valnew+'.;'+document.form1.con_sub.value;
	 if(document.form1.concheck.checked==true)
	 {
	valnew=valnew+'.;'+'1';
     }
     else
     valnew=valnew+'.;'+'2';
	 centerWindow('http://www.utsavsarees.com/store/submit.aspx?val='+valnew+'&mode=contactquery'); 
     document.form1.reset();}
     else
		{document.form1.message.focus();
		alert("Message Can Not Blank")
		return false
		}}	
	
  else
		{document.form1.fullname.focus();}}
		
	
		   else
	
	{document.form1.qemail.focus();}}}
	
function centerWindow(fname) {
    if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 640, yMax=480;
    var xOffset = (xMax - 490)/2, yOffset = (yMax - 190)/2;	
    MM_openBrWindowX(fname,'info','width=400,height=150,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
}

function MM_openBrWindowX(theURL,winName,features) { //v2.0
  mywin=window.open(theURL,winName,features);  
  if (mywin.opener==null)
      mywin.opener=self;  
  self.close();
}

 




function NumericsOnly(obj)
{
if (!((event.keyCode > 47 && event.keyCode < 58)||(event.keyCode>96&&event.keyCode<123)||(event.keyCode>64&&event.keyCode<91)||(event.keyCode==45||event.keyCode==46||event.keyCode==110||event.KeyCode==190||event.keyCode==8||event.keyCode==9||event.keyCode==32)))
{
alert("Please Enter characters or Numbers only...");
event.returnValue = false;
}
else
event.returnValue=true;
}







function CheckSleeveStyle(front_neck_style){
		var myindex  = front_neck_style.selectedIndex
		var SelValue = front_neck_style.options[myindex].value
		if ((SelValue=="Halter neck 1") || (SelValue=="Halter neck 2") || (SelValue=="Halter neck 3") || (SelValue=="One-shoulder") || (SelValue=="Off-shoulder"))
		{
			document.measure.sleeve_type.selectedIndex=0;		
 			document.getElementById('sleeve_type').disabled=true;  
 			document.measure.sleeve_length.selectedIndex=0;		
 			document.getElementById('sleeve_length').disabled=true;  				
 		} 
 		
		else
		{
		document.getElementById('sleeve_type').disabled=false;
		document.getElementById('sleeve_type').disabled=false;

		}			
	}
	
function changebuttoncolor(e, mouse) // change button color
{
 var color="";
 if (mouse == "OVER")
 {
  color="#C13100";
 }
else
{
 color="#f58800";
}
 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 for special characters--------------
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 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 >=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;
    }
}

//----------------------end function for special characters----------------------------------------
function closediv(id) {document.getElementById(id).style.display = "none";}

function Reload() {var f = document.getElementById('iframe1'); f.contentWindow.location.reload(true); }
function Reload() {var f = document.getElementById('iframe2'); f.contentWindow.location.reload(true); }



