	arr=new Array(	
	"gowns_start.html",
	"gowns_new_collection1.html",
	"gowns_new_collection2.html",
	"gowns_new_collection3.html",
	"gowns_new_collection4.html",
	"gowns_new_collection5.html",
	"gowns_new_collection6.html",
	"gowns_new_collection7.html",
	"gowns_new_collection8.html",
	"gowns_2005_collection1.html",
	"gowns_2005_collection2.html",
	"gowns_2005_collection3.html");

function ck(form){
        for (i=0; i<arr.length; i++){
		if(form.gowns[i].selected)
        break;
	}
    ckvalue=i;
if(ckvalue!=0){
	window.location=arr[i-1];
	}			
}
		
 function forword(){
	for(i=0; i<arr.length; i++)
		if(window.location.href.indexOf(arr[i])!=-1)
			window.location=arr[i+1]
}

function backword(){
	for(i=0; i<arr.length; i++)
		if(window.location.href.indexOf(arr[i])!=-1)			
			window.location=arr[i-1]
}

function dropdown_menu(){
	var menu="";
	menu+="<FORM name=form1><SELECT name=gowns onChange=ck(this.form)>"
	menu+="<OPTION selected>Select your wedding gown&nbsp;";
	menu+="<OPTION>Best seller";
	menu+="<OPTION>New collection 1";
	menu+="<OPTION>New collection 2";
	menu+="<OPTION>New collection 3";
	menu+="<OPTION>New Collection 4";
	menu+="<OPTION>New Collection 5";
	menu+="<OPTION>New Collection 6";
	menu+="<OPTION>New Collection 7";
	menu+="<OPTION>New Collection 8";
	menu+="<OPTION>Spring 2005 Collection 1";
	menu+="<OPTION>Spring 2005 Collection 2";
	menu+="<OPTION>Spring 2005 Collection 3";
	menu+="</SELECT></FORM>"


	document.write(menu);
	for(i=1; i<arr.length; i++)
		if(window.location.href.indexOf(arr[i])!=-1)
			document.form1.gowns.options[i+1].selected=true;
}

//SIZE AND LENGTH ARRAY OF THE DRESS (ALL BUT 2005 SPRING)
SizeArray=new Array();
SizeArray[1]=new Array(2,33.0,23.5,36.0);
SizeArray[2]=new Array(4,34.0,24.5,37.0);                                      
SizeArray[3]=new Array(6,35.0,25.5,38.0);
SizeArray[4]=new Array(8,36.0, 26.5,39.0);
SizeArray[5]=new Array(10,37.0,27.5,40.0);
SizeArray[6]=new Array(12,38.0,28.5,41.0);
SizeArray[7]=new Array(14,39.5,30.0,42.5);
SizeArray[8]=new Array(16,41,31.5,44.0); 
SizeArray[9]=new Array(18,43,33.5,46.0);
SizeArray[10]=new Array(20,45,35.5,48.0);
SizeArray[11]=new Array(22,47.5,38.0,50);
SizeArray[12]=new Array(24,50,41.0,52.5);
SizeArray[13]=new Array(26,52.5,43.8,55.0);
SizeArray[14]=new Array(28,55,46.6,57.5);
SizeArray[15]=new Array(30,57.5,49,60.0);

LengthArray=new Array();
	for(newArr=0; newArr<SizeArray.length; newArr++){
		LengthArray[newArr]=new Array();
	}
LengthArray[0]="Length";
LengthArray[1]=new Array(61.25,54.3)
LengthArray[2]=new Array(61.25,54.4) 
LengthArray[3]=new Array(61.25,54.5) 
LengthArray[4]=new Array(61.25,54.6) 
LengthArray[5]=new Array(61.75,54.9) 
LengthArray[6]=new Array(61.75,55.0) 
LengthArray[7]=new Array(62.0,55.3) 
LengthArray[8]=new Array(62.25,55.5)
LengthArray[9]=new Array(62.5,55.8)
LengthArray[10]=new Array(62.75,56.0)
LengthArray[11]=new Array(63.0,56.3) 
LengthArray[12]=new Array(63.25,56.5) 
LengthArray[13]=new Array(63.5,56.8)
LengthArray[14]=new Array(63.75,57.0)
LengthArray[14]=new Array(64.0,57.0)



SizeArray2005=new Array();  //NEW GOWNS SPRING 2005                                                                                                                  
SizeArray2005[1]=new Array(2,33.5,24,35.5);                                   
SizeArray2005[2]=new Array(4,34.5,24,36);
SizeArray2005[3]=new Array(6,35.5,26,37.5);
SizeArray2005[4]=new Array(8,36.5,27,38.5);
SizeArray2005[5]=new Array(10,37.5,28,39.5);
SizeArray2005[6]=new Array(12,39,29.5,41);
SizeArray2005[7]=new Array(14,40.5,31,42.5);
SizeArray2005[8]=new Array(16,42,32.5,44);
SizeArray2005[9]=new Array(18,44,34.5,46);
SizeArray2005[10]=new Array(20,46,36.5,48);
SizeArray2005[11]=new Array(22,48,38.5,50);
SizeArray2005[12]=new Array(24,50.3,40.8,52.3);
SizeArray2005[13]=new Array(26,52.3,43,54.5);
SizeArray2005[14]=new Array(28,54.8,45.3,56.8);

//STRING NAMES OF GOWNS 2005 SPRING
gowns2005="#2580,#2581,#2590,#2592,#2594,#2595,#2596,#2599,#2602,#2603,#2609,#2610,#2611,#2612,#2613,#2614,#2615,#2616 New,#2617,#2618,#2619,#2620,#2621,#2622a,#2622b,#2623,#c211";

function item(product,style,description,color,price){
	this.product=product;
	this.style=style;
	this.description=description;
	this.color=color;
	this.price=price;
	if(item.arguments!=null)
		this.picture=item.arguments[5];
}

function writeItems(){
	var str="";

	returnValue="";
	for(arri=0; arri<arr.length; arri++){
		if(window.location.href.indexOf(arr[arri])!=-1){
			returnValue=arr[arri];
		}
	}
	
	

	str+='<FORM method="POST" action="http://www.mikawed.com">';
	str+="<input type=hidden name=sh value='4.316'>"
	str+="<input type=hidden name=return value='http://www.mikawed.com/" + returnValue +"'>"
	for(itemsLength=0; itemsLength<arguments.length; itemsLength++){
	itemI=arguments[itemsLength]
		str+="<SPAN style='width:350'>"
		str+="<B>" + itemI.product
		str+=" " + itemI.style +"</B>"
		str+=" - " + itemI.description
		str+="</SPAN>"
	
	}
	
	str+="<P><SELECT NAME=name onChange='priceChange(this.form)'>";
	for(itemsLength=0; itemsLength<arguments.length; itemsLength++){
		itemI=arguments[itemsLength]
		str+="<OPTION value='"+itemI.product +" "+ itemI.style+"'>"+itemI.product +" "+ itemI.style;
	}
	str+="</SELECT>";
	for(itemsLength=0; itemsLength<arguments.length; itemsLength++){
		itemI=arguments[itemsLength]
			str+="<input type=hidden name=price"+itemsLength+ " value='$"+itemI.price+".00'>"
	}
	itemI=arguments[0]
	str+=" &nbsp;Price: <input type=text readonly size=10 name=price value='$" + itemI.price +".00' style='text-align=center'></center></p>"
	str+="<TABLE border=0 cellpadding=0>"
	if(itemI.color!=""){
	str+="<TR><TD>"
	var splitArrItem=itemI.color.split(",")
	str+="Color: </TD><TD>"
	if (splitArrItem.length==1){
		str+="<input type=hidden name=custom2 value='" + splitArrItem[0] +"'>";
		str+=splitArrItem[0];
	}
	else{
		str+="<SELECT name=custom2>"
		str+="<OPTION>Select color"		
		for(s=0; s<splitArrItem.length; s++){
			str+="<option>"+splitArrItem[s]
		}
	str+="</select>"
	}
	if(itemI.style=="#2623"){
	str+=" (<A href='javascript:void(0)'"
	str+="onclick=window.open('gown_2623_colors.html','Colors','width=260,height=355,top=0,left=0')>Color chart</A>)"
	}
	str+="</TD>";
}

	if(itemI.product=="Gown"){
	str+="<TR><TD>"
	
	addPrice="";
	
	if(gowns2005.indexOf(itemI.style)!=-1  && itemI.style!="#2616"){
			str+="Size: </TD><TD><Select name=custom3>";
			addPriceZise=18;
			addPriceValue=" +$50.00";
			SizeArrayTable=SizeArray2005;
	}else{		
			str+="Size: </TD><TD><Select name=custom3 onChange='sizeChange(this.form)'>";
			addPriceZise=24;
			addPriceValue=" +$50.00";
			SizeArrayTable=SizeArray;
	}
	

	addPrice="";
	for(i=1; i<SizeArrayTable.length; i++){
			if(SizeArrayTable[i][0]==addPriceZise)
					addPrice=addPriceValue;
				str+="<option  value='Size:" +SizeArrayTable[i][0]+addPrice+"'>"+ SizeArrayTable[i][0] 
				+" (Bust-"+SizeArrayTable[i][1]
				+"\" Waist-"+SizeArrayTable[i][2]
				+"\" Hips-"+SizeArrayTable[i][3]+"\")" +addPrice
			}
	
	addPrice="";
	
	/*if(itemI.style.indexOf("1")!=1 && itemI.style.indexOf("2")!=1  && gowns2005.indexOf(itemI.style)==-1){
	for(i=1;i<SizeArray.length;i++){
				if(SizeArray[i][4]=="21 Petite")
					addPrice=" +$50.00";
				str+="<option  value='Size:" +SizeArray[i][4]+addPrice+"'>"+ SizeArray[i][4] 
				+" (Bust-"+SizeArray[i][1]
				+"\" Waist-"+SizeArray[i][2]
				+"\" Hips-"+SizeArray[i][3]+"\")" +addPrice
			}
	}*/
	str+="</select></TD>"

	 if(gowns2005.indexOf(itemI.style)==-1 || itemI.style=="#2616"){
	 str+="<TR><TD>Length: <TD><Select name=custom4>";
			str+="<option value='Length: "+LengthArray[1][0]+"\"'>"+ LengthArray[1][0]+"\"";
			str+="</select>"
		/*new*/	str+="<A HREF='javascript:void(0)' onClick=size_chart_win('gnewsize_chart.html')><IMG SRC='http://www.mikawed.com/pic/size.gif' BORDER=0 align=top><A/></TD></TR>"

			/*old* str+=" <A HREF='http://www.mikawed.com/gsize_chart.html'><IMG SRC='http://www.mikawed.com/pic/size.gif' BORDER=0 align=top><A/></TD></TR>"*/
		}
	else{
		str+="<TR><TD></TD><TD>";
			/*new*/str+="<A HREF='javascript:void(0)' onClick=size_chart_win('gsize_chart2005.html')><IMG SRC='http://www.mikawed.com/pic/size.gif' BORDER=0 align=top><A/></TD></TR>";
			//str+="<INPUT TYPE='BUTTON' VALUE='Close Window' onClick='window.close()'>";

		/*old*	str+="<A HREF='http://www.mikawed.com/gsize_chart2005.html'><IMG SRC='http://www.mikawed.com/pic/size.gif' BORDER=0 align=top><A/></TD></TR>";*/
	}


	}
	str+="</TABLE>"
	
	str+="<center><BR><input type=hidden name=add value=1'>"
	//str+="<input type=image name=Order src='http://www.mikawed.com/cart/cart_add.gif' border=0>"

//	str+="<a href='http://www.mikawed.com'><img src='http://www.mikawed.com/cart/cart_view.gif' border=0></a>"
	str+="</center>"//</TD>"
	str+="</form>"

	document.write(str);
}

function size_chart_win(pageName){
	window.open(pageName,"size","width=550,height=350,top=0,left=0,scrollbars=yes")
		
}

function sizeChange(form){ //on zise change, change the select length text.
		placeCol=form.custom3.options.selectedIndex;
		placeRow=0;
		if(form.custom3.options[placeCol].text.indexOf("P")!=-1){
					placeCol=placeCol-LengthArray.length+1
			 placeRow=1; 
		}
		form.custom4.options[0].value=""+LengthArray[0]+": " + LengthArray[placeCol+1][placeRow]+'"';
		form.custom4.options[0].text=""+LengthArray[placeCol+1][placeRow]+'"';
}

function priceChange(form){ //on style change, put the right price.
		placeCol=form.name.options.selectedIndex;
		rightPrice=eval("form.price"+placeCol)
		form.price.value=rightPrice.value
}


function printPicture(pictureName){
	PictureStr1="";
	PictureStr1+="<A HREF='http://www.weddinginvitations411.com/mikawed/gowns/"+pictureName+"' target='_blank'>";
	PictureStr1+="<IMG src='http://www.weddinginvitations411.com/mikawed/gowns/"+pictureName+"' width=200>";
	PictureStr1+="</A>";
	document.write(PictureStr1);
}

