//++++++++++++++++++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('back_neck_style').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_type').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 ((SelValue=="Churidar") || (SelValue=="Churidar with shirring") || (SelValue=="Heavy Churidar"))
		{
		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 ((SelValue=="Semi Patiala") || (SelValue=="Salwar / Punjabi"))
		{
		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
		{
		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; 









