function formvalidation(obj)
{	var chek = false;
	for (var i=0; i<obj.getElementsByTagName("input").length; i++)
		{
			if (obj.getElementsByTagName("input")[i].type == "checkbox")
			{
				if (obj.getElementsByTagName("input")[i].checked)
					{	chek = true;	}
			}
		}
  if(chek == true)
	{
	  return true;
	}
	else {
		alert("Atleast one Specified Size should be checked.");
		return false;
		}
}


function enabledisabledqty(indexid)
{
	if(document.getElementById("pro_size_"+indexid).checked==true)
	{
		document.getElementById("pro_quantity_"+indexid).value="1";
		document.getElementById("pro_quantity_"+indexid).disabled=false;
		document.getElementById("pro_cost_per_"+indexid).disabled=false;
		settotalcost(document.getElementById("pro_cost_per_"+indexid).value,"1",indexid);
	}
	else
	{
		document.getElementById("pro_quantity_"+indexid).value="0";
		document.getElementById("pro_quantity_"+indexid).disabled=true;
		document.getElementById("pro_cost_per_"+indexid).disabled=true;
		settotalcost(document.getElementById("pro_cost_per_"+indexid).value,"0",indexid);
	}
	settotal();
}
function gettotalcost(cost,quantity)
{
	return "$"+(cost*quantity).toFixed(2);
}
function settotalcost(cost,quantity,indexid)
{
	document.getElementById("pro_total_cost_"+indexid).innerHTML=gettotalcost(cost,quantity);
}
function settotalcostonkeyup(cost,quantity,indexid)
{
	if(isNaN(document.getElementById("pro_quantity_"+indexid).value) || document.getElementById("pro_quantity_"+indexid).value < 1)
	{
		alert("Quantity should be a number and greater than 0");
		document.getElementById("pro_quantity_"+indexid).value="1";
		settotalcost(cost,"1",indexid)
	}
	else
	{
		settotalcost(cost,quantity,indexid)
	}
	settotal()
}
function settotal()
{
	var total=0.00;
	var cost=0.00;
	var quantity=0;
	for(var i = 0; i< document.getElementsByName("pro_size[]").length;i++)
	{
		cost = parseFloat(document.getElementById("pro_cost_per_"+i).value);
		quantity = parseFloat(document.getElementById("pro_quantity_"+i).value);
		total	=	total +(cost*quantity);
	}
	document.getElementById("pro_total").innerHTML="Total: $"+total.toFixed(2);
}
function setsubtotal(cindexid)
{
	var total=0.00;
	var cost=0.00;
	var quantity=0;
	for(var i = 0; i< document.getElementsByName("pro_quantity"+cindexid+"[]").length;i++)
	{
		if(document.getElementById("hidetr"+cindexid+i).style.display	!=	'none')
		{
			cost = parseFloat(document.getElementById("pro_cost_per_"+cindexid+i).value);
			quantity = parseFloat(document.getElementById("pro_quantity_"+cindexid+i).value);
			total	=	total +(cost*quantity);
		}
	}
	document.getElementById("pro_sub_total_"+cindexid).innerHTML="$"+total.toFixed(2);
	document.getElementById("sub_total_"+cindexid).value=total.toFixed(2);
	if(total.toFixed(2)	==	0.00)
	{
		document.getElementById("hidetr"+cindexid).style.display="none";
		document.getElementById("showtr"+cindexid).style.display="block";
		document.getElementById("showtr"+cindexid).style.display="none";
	}
}
function setgrandtotal(cname)
{
	var total=0.00;
	var pro_sub_total=0.00;
	elObj	=	document.getElementsByName(cname+"[]");
	for(var i = 0; i< elObj.length;i++)
	{
		if(document.getElementById("hidetr"+i).style.display	!=	'none')
		{
			pro_sub_total = parseFloat(document.getElementById("sub_total_"+i).value);
			total	=	total + pro_sub_total;
		}
	}
	document.getElementById("pro_grand_total").innerHTML="$"+total.toFixed(2);
}
function updatecartonkeyup(url,loadpageId,overlaystyle,cost,quantity,indexid,cindexid)
{

	url =	url	+	"&quantity="	+	quantity;
	//getLoadPage(url,loadpageId,overlaystyle);
	updateCart(url,loadpageId,overlaystyle,cost,quantity,indexid,cindexid)
	//settotalcost(cost,quantity,indexid)
	//setsubtotal(cindexid)
	//setgrandtotal("sub_total")
}
function setsn(cartitem)
{
	var j	=	0;
	for(var i = 0; i < cartitem;i++)
	{
		if(document.getElementById("hidetr"+i).style.display != "none")
		{
			j++;
			document.getElementById("sno_"+i).innerHTML=j;
		}
	}
}
function deletecart(url,loadpageId,overlaystyle,rowindex,cindexid,cartitem)
{
	document.getElementById("hidetr"+rowindex).style.display="none";
	document.getElementById("showtr"+rowindex).style.display="block";
	deleteCartItem(url,loadpageId,overlaystyle,rowindex,cindexid,cartitem)

	//getLoadPage(url,loadpageId,overlaystyle);
	//setTimeout("deleteclientsidecart('"+rowindex+"','"+cindexid+"','"+cartitem+"');",4000);

}
function deleteclientsidecart(rowindex,cindexid,cartitem)
{
	setsubtotal(cindexid)
	setgrandtotal("sub_total")
	document.getElementById("showtr"+rowindex).style.display="none";
	setsn(cartitem);
}
function CloseDiv(divid)
{
	document.getElementById(divid).innerHTML="";
}
function getQueryString(obj)
{
	var getstr = "";
	for (i=0; i<obj.getElementsByTagName("input").length; i++) {
		if (obj.getElementsByTagName("input")[i].type == "text") {
		   getstr += obj.getElementsByTagName("input")[i].name + "=" +
				   obj.getElementsByTagName("input")[i].value + "&";
		}
		if (obj.getElementsByTagName("input")[i].type == "hidden") {
		   getstr += obj.getElementsByTagName("input")[i].name + "=" +
				   obj.getElementsByTagName("input")[i].value + "&";
		}
		if (obj.getElementsByTagName("input")[i].type == "checkbox") {
		   if (obj.getElementsByTagName("input")[i].checked) {
			  getstr += obj.getElementsByTagName("input")[i].name + "=" +
				   obj.getElementsByTagName("input")[i].value + "&";
		   } else {
			  getstr += obj.getElementsByTagName("input")[i].name + "=&";
		   }
		}
		if (obj.getElementsByTagName("input")[i].type == "radio") {
		   if (obj.getElementsByTagName("input")[i].checked) {
			  getstr += obj.getElementsByTagName("input")[i].name + "=" +
				   obj.getElementsByTagName("input")[i].value + "&";
		   }
	 }
	 if (obj.getElementsByTagName("input")[i].tagName == "SELECT") {
		var sel = obj.getElementsByTagName("input")[i];
		getstr += sel.name + "=" + sel.options[sel.selectedIndex].value + "&";
	 }

	}
  return getstr;
 }
function AddToCart(url,loadpageId,overlaystyle,fornObj)
{
	if(formvalidation(fornObj)==true)
	{
		url	=	url + getQueryString(fornObj);
		getLoadPage(url,loadpageId,overlaystyle);
		setTimeout('CloseDiv("overlaydiv");',4000);
	}
}
function getCityByCounty(url,loadpageId,overlaystyle)
{
	//alert(url);
	getLoadPage(url,loadpageId,overlaystyle);
}
function ShowSubCategory(url,loadpageId,overlaystyle)
{
	document.getElementById("getsubcategory").innerHTML="";
	document.getElementById("gettype").innerHTML="";
	//document.getElementById("getproductcharacteristicsdiv").innerHTML="";

	//document.frmsearch.Action.value=document.frmsearch.CAction1.value;
	document.frmsearch.Action.value=document.getElementById("caction1").value;

	document.frmsearch.Action1.value=document.getElementById("caction1").value;
	document.frmsearch.Action2.value="";
	document.frmsearch.Action3.value="";

	getLoadPage(url,loadpageId,overlaystyle);
}
function ShowType(url,loadpageId,overlaystyle)
{
	document.getElementById("gettype").innerHTML="";

	//document.getElementById("getproductcharacteristicsdiv").innerHTML="";
	if(document.getElementById("caction2").value != '0')
	{
		document.frmsearch.Action.value=document.getElementById("caction2").value;
	}
	else
	{
		document.frmsearch.Action.value=document.getElementById("caction2").value;
	}

	document.frmsearch.Action2.value=document.getElementById("caction2").value;
	document.frmsearch.Action3.value="";
	getLoadPage(url,loadpageId,overlaystyle);

}
function OnlyForValues()
{
document.frmsearch.Action3.value=document.getElementById("caction3").value;
}
function ShowOnlyFilter(url,loadpageId,overlaystyle)
{
	/*
	if(document.frmsearch.Action3 != null && document.frmsearch.Action3.value !=0)
	{
		document.frmsearch.Action.value=document.frmsearch.Action3.value
	}
	else if(document.frmsearch.Action2 != null && document.frmsearch.Action2.value !=0)
	{
		document.frmsearch.Action.value=document.frmsearch.Action2.value
	}
	else
	{
		document.frmsearch.Action.value=document.frmsearch.Action1.value
	}
	//document.getElementById("getproductcharacteristicsdiv").innerHTML="";
	*/
	getLoadPage(url,loadpageId,overlaystyle);
}
function getlargeimage(imageid,imagepath)
{
	var myElement = document.getElementById(imageid);
    if (myElement != null) {
        myElement.src = imagepath;
		//alert(imagepath);
    } else {
        alert('Request to getlargeimage() function failed. Element id undefined = ' + imageid);
    }
}
function sameasbilling(url,loadpageId,overlaystyle)
{
	if(document.frmcheckout.chksameasbilling.checked == true)
	{
		getLoadPage(url,loadpageId,overlaystyle);

		document.frmcheckout.shipTo_firstName.value		=	document.frmcheckout.billTo_firstName.value;
		document.frmcheckout.shipTo_lastName.value		=	document.frmcheckout.billTo_lastName.value;
		document.frmcheckout.shipTo_country.value		=	document.frmcheckout.billTo_country.value;
		document.frmcheckout.shipTo_state.value			=	document.frmcheckout.billTo_state.value;
		document.frmcheckout.shipTo_county.value		=	document.frmcheckout.billTo_county.value;
		document.frmcheckout.shipTo_city.value			=	document.frmcheckout.billTo_city.value;
		document.frmcheckout.shipTo_postalCode.value	=	document.frmcheckout.billTo_postalCode.value;
		document.frmcheckout.shipTo_street1.value		=	document.frmcheckout.billTo_street1.value;
		document.frmcheckout.shipTo_street2.value		=	document.frmcheckout.billTo_street2.value;
		document.frmcheckout.shipTo_phoneNumber.value	=	document.frmcheckout.billTo_phoneNumber.value;
	}
	else
	{
		document.frmcheckout.shipTo_firstName.value		=	"";
		document.frmcheckout.shipTo_lastName.value		=	"";
		document.frmcheckout.shipTo_country.value		=	"US";
		document.frmcheckout.shipTo_state.value			=	"CA";
		document.frmcheckout.shipTo_county.value		=	"0";
		document.frmcheckout.shipTo_city.value			=	"0";
		document.frmcheckout.shipTo_postalCode.value	=	"";
		document.frmcheckout.shipTo_street1.value		=	"";
		document.frmcheckout.shipTo_street2.value		=	"";
		document.frmcheckout.shipTo_phoneNumber.value	=	"";
	}
}
function calwidth(url,loadpageId,overlaystyle,containertype)
{



	var wid =document.getElementById("WidthInches2").value;
	var ht =document.getElementById("HeightInches2").value;
	

if (document.getElementById("hliftid").value>0)
	
{

	if(document.getElementById("Lift98") != null)
	{
		if(document.getElementById("Lift98").checked == true)
		{
							if(wid > 72)
							{
								//document.getElementById("Upgrades"+id).checked = false;
								alert("Cordless is not compatible with Width more then 72!");
								return false;
							}
							if(ht > 72)
							{
								//document.getElementById("Upgrades"+id).checked = false;
								alert("Cordless is not compatible with Height more then 72!");
								return false;
							}

		}
	}
}


if ((document.getElementById("hliftid").value >0) ||  (document.getElementById("hliftid").value == ""))
	{

		if(document.getElementById("Upgrades67") != null)
		{
				if(document.getElementById("Upgrades67").checked == true)
				{
					if(wid > 72)
					{
						//document.getElementById("Upgrades"+id).checked = false;
						alert("Cordless is not compatible with Width more then 72!");
						return false;
					}
					if(ht > 72)
					{
						//document.getElementById("Upgrades"+id).checked = false;
						alert("Cordless is not compatible with Height more then 72!");
						return false;
					}
				}
		}
	}
		


		var newhalfwid = Math.floor(wid/2)		
		
		if(document.getElementById("2in1left") != null)
		{
			document.getElementById("2in1left").value=newhalfwid;
			document.getElementById("2in1right").value=newhalfwid;
		}
			

			
		//alert(newhalfwid);
		//alert(halfht);
		//alert(document.getElementById("pid").value);
		//alert(url);
		//alert(loadpageId);
		//alert(overlaystyle);
		//alert(containertype);
		
		

		url=url+"&wid="+wid+"&ht="+ht+"&producttype="+document.getElementById("pid").value;
		
		//alert(url);
		
		getLoadPage(url,loadpageId,overlaystyle,containertype);

}
function calcolorfab(url,loadpageId,overlaystyle,containertype,fabid,fabname)
{


	    document.getElementById("fabricid").value=fabid;
		document.getElementById("hfabricname").value=fabname;
		var fid =document.getElementById("fabricid").value;

		
	
		if(document.getElementById("Upgrades67") != null)
		{
				if(document.getElementById("Upgrades67").checked == true)
				{

					    if(fid ==406 || fid == 407)
						{
							//return true;
						}
						else if(fid <393 || fid > 460)
						{
							//document.getElementById("Upgrades"+id).checked = false;
							alert("Cordless is not compatible with other then Cordless fabric Category!");
							return false;
						}
				}
		}

		

		url=url+"&fabricid="+fid+"&producttype="+document.getElementById("pid").value;
		getLoadPage(url,loadpageId,overlaystyle,containertype);
	

}
function calcolor(url,loadpageId,overlaystyle,containertype)
{

		var fid =document.getElementById("fabricid").value;


		url=url+"&fabricid="+fid;
		//alert(url);
		getLoadPage(url,loadpageId,overlaystyle,containertype);

}
function topcartsummery(url,loadpageId,overlaystyle,containertype)
{
		getLoadPage(url,loadpageId,overlaystyle,containertype);
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function setcolor(val,id,pricetype,mname,fabid,path)
{
	//alert(document.getElementById("hbaseprice").value);
	
	//alert("val = "+ val +" id= "+ id +" pricetype= "+ pricetype +" mname= "+ mname + " fabid= " + fabid + " path= " + path);
	if(pricetype=='D')
	{
	document.getElementById("hcolorprice").value=val;
	}
	if(pricetype=='P')
	{
		var price=(val*document.getElementById("hbaseprice").value)/100;
		document.getElementById("hcolorprice").value=price;
	}

	
	document.getElementById("hcolorid").value=id;
	document.getElementById("selectedcolorname").innerHTML=mname;
	
	document.getElementById("hfabricid").value=fabid;
	//alert("Set color:" + path);
	document.getElementById("imgselectedcolor").src=path;
	document.getElementById("hcolorprice_type").value=pricetype;
	document.getElementById("hcolorprice_value").value=val;
	
	calTotalPrice();
	return false;
}
function setcoloronload(val,id,pricetype,mname,fabid,path)
{
	//alert(document.getElementById("hbaseprice").value));
	//alert("val = "+ val +" id= "+ id +" pricetype= "+ pricetype +" mname= "+ mname + " fabid= " + fabid + " path= " + path);
	if(pricetype=='D')
	{
	document.getElementById("hcolorprice").value=val;
	}
	if(pricetype=='P')
	{
		var price=(val*document.getElementById("hbaseprice").value)/100;
		document.getElementById("hcolorprice").value=price;
	}
	document.getElementById("hcolorid").value=id;
	document.getElementById("selectedcolorname").innerHTML=mname;
	document.getElementById("hfabricid").value=fabid;
	//	alert("Set coloronload:" + path);
	document.getElementById("imgselectedcolor").src=path;
	document.getElementById("hcolorprice_type").value=pricetype;
	document.getElementById("hcolorprice_value").value=val;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function calTotalPrice()
{
	var totalprice=0;
	var a="<?php echo $baseprice;?>";
	
	//alert(a);
	
	if(isNaN(a))
	{
		a=0;
	}

	if(a=="")
	{
		a=0;
	}

	if(isNaN(document.getElementById("hbaseprice").value))
	{
		document.getElementById("hbaseprice").value=0;
	}
	if(isNaN(document.getElementById("hliningprice").value))
	{
		document.getElementById("hliningprice").value=0;
	}
	if(isNaN(document.getElementById("hupgradeprice").value))
	{
		document.getElementById("hupgradeprice").value=0;
	}
	if(isNaN(document.getElementById("hmountprice").value))
	{
		document.getElementById("hmountprice").value=0;
	}
	if(isNaN(document.getElementById("hcontrolprice").value))
	{
		document.getElementById("hcontrolprice").value=0;
	}
	if(isNaN(document.getElementById("hcolorprice").value))
	{
		document.getElementById("hcolorprice").value=0;
	}
	if(isNaN(document.getElementById("hpinningprice").value))
	{
		document.getElementById("hpinningprice").value=0;
	}
	if(isNaN(document.getElementById("hfinishprice").value))
	{
		document.getElementById("hfinishprice").value=0;
	}
	if(isNaN(document.getElementById("hfringeandcordprice").value))
	{
		document.getElementById("hfringeandcordprice").value=0;
	}
	if(isNaN(document.getElementById("hpleatsprice").value))
	{
		document.getElementById("hpleatsprice").value=0;
	}
		if(isNaN(document.getElementById("hliftprice").value))
	{
		document.getElementById("hliftprice").value=0;
	}
	
	


	var wid =document.getElementById("WidthInches2").value;
	var ht =document.getElementById("HeightInches2").value;
	
	document.getElementById("hwidth").value=wid;
	document.getElementById("hheight").value=ht;

	document.getElementById("hwidthdegree").value=document.getElementById("Width8ths2").value;
	document.getElementById("hheightdegree").value=document.getElementById("Height8ths2").value;

	totalprice=		(parseFloat(document.getElementById("hwandprice").value) + 	
					parseFloat(document.getElementById("hcordprice").value) + 
					parseFloat(document.getElementById("hgrommetcolorsprice").value) + 
					parseFloat(document.getElementById("hpockectsheaderprice").value) + 
					parseFloat(document.getElementById("hpleatsprice").value) + 
					parseFloat(document.getElementById("hbaseprice").value) + 
					parseFloat(document.getElementById("hliningprice").value) + 
					parseFloat(document.getElementById("hupgradeprice").value) +	
					parseFloat(document.getElementById("hmountprice").value) + 
					parseFloat(document.getElementById("hcontrolprice").value) + 
					parseFloat(document.getElementById("hfinishprice").value) + 
					parseFloat(document.getElementById("hcolorprice").value) + 
					parseFloat(document.getElementById("hpinningprice").value)+ 
					parseFloat(document.getElementById("hfringeandcordprice").value) + 
					parseFloat(document.getElementById("hreturnsizeprice").value)+ 
					parseFloat(document.getElementById("hliftprice").value));
	
	
		//alert("C " + parseFloat(document.getElementById("hbaseprice").value));
		//alert(parseFloat(document.getElementById("hcolorprice").value))
	
		//alert(totalprice);
	var databaseprice = parseFloat(document.getElementById("hbaseprice").value);
	var mDefaultDiscountPercent = parseFloat(document.getElementById("defaultDiscountPercent").value);
	var comp =parseFloat(document.getElementById("hiddencompprice").value);

	//var compprice=totalprice+((comp*totalprice)/100);
	var compprice=databaseprice+((comp*databaseprice)/100);
	
	//var listprice=totalprice+((100*totalprice)/100);
	var listprice=databaseprice+((100*databaseprice)/100);
	
	
	var listyousave=listprice - databaseprice;
	
	var listyousavepercent=(listyousave*100)/listprice;
	
	var mDiscountPrice = totalprice - (totalprice * mDefaultDiscountPercent);
	
	
	compprice=compprice.toFixed(2);
	
	listprice=listprice.toFixed(2);
	
	listyousave=listyousave.toFixed(2);
	
	totalprice=totalprice.toFixed(2);
	mDiscountPrice = mDiscountPrice.toFixed(2);
	listyousavepercent = listyousavepercent.toFixed(2);

	document.getElementById("labelcompprice").innerHTML		=compprice;
	document.getElementById("listyousavepercent").innerHTML	=listyousavepercent;
	document.getElementById("labellistprice").innerHTML		=listprice;
	document.getElementById("labelprice").innerHTML			=totalprice;
	document.getElementById("listyousave").innerHTML		=listyousave;
	document.getElementById("htotalprice").value			=totalprice;
	document.getElementById("discountprice").innerHTML		=mDiscountPrice;

	//alert(mDiscountPrice);

	setProductSummary();

}
function setProductSummary()
{
	
	
	document.getElementById("spanprice").innerHTML=	document.getElementById("htotalprice").value;
	
	if(document.getElementById("hfringeandcordname") != null)
	{
			var fringecolor = "Black Carmel";
			var cordcolor = "Black Carmel";
			var setcandf = document.getElementById("hfringeandcordname").value;
			if(document.getElementById("hfringecolorname").value != 0 )
			{
				fringecolor = document.getElementById("hfringecolorname").value;
			}
			if(document.getElementById("hcordcolorname").value != 0 )
			{
				cordcolor = document.getElementById("hcordcolorname").value;
			}
			if((document.getElementById("hfringeandcordname").value) == "Cord")
			{
				 setcandf = "Cord ("+cordcolor+")";
			}
			if((document.getElementById("hfringeandcordname").value) == "Fringe")
			{
				 setcandf = "Fringe ("+fringecolor+")";
			}
			document.getElementById("spancord").innerHTML=setcandf;
	}
	
	if(document.getElementById("hreturnsizename") != null)
	{
	document.getElementById("spanreturnsize").innerHTML=	document.getElementById("hreturnsizename").value;
	}
	
	if(document.getElementById("hpleatsname") != null)
	{
	document.getElementById("spanpleats").innerHTML=document.getElementById("hpleatsname").value;
	}
	
	if(document.getElementById("hgrommetcolorsname") != null)
	{
	document.getElementById("spangrommetcolors").innerHTML=	document.getElementById("hgrommetcolorsname").value;
	}
	
	if(document.getElementById("hfinishname") != null)
	{
	document.getElementById("spanfinish").innerHTML=	document.getElementById("hfinishname").value;
	}
	
	if(document.getElementById("hliningname") != null)
	{
	document.getElementById("spanlining").innerHTML=	document.getElementById("hliningname").value;
	}
	
	if(document.getElementById("hmountname") != null)
	{
	document.getElementById("spanmount").innerHTML=	document.getElementById("hmountname").value;
	}
	
	if(document.getElementById("hcontrolname") != null)
	{
	document.getElementById("spancontrol").innerHTML=	document.getElementById("hcontrolname").value;
	}
	
	if(document.getElementById("hupgradename") != null)
	{


	document.getElementById("spanupgrade").innerHTML =	document.getElementById("hupgradename").value;
	}
	
	
	if(document.getElementById("hgrommetcolorsname") != null)
	{
	document.getElementById("spangrommetcolors").innerHTML=	document.getElementById("hgrommetcolorsname").value;
	}
	
	if(document.getElementById("hpockectsheadertname") != null)
	{
	document.getElementById("spanpocketsheader").innerHTML=	document.getElementById("hpockectsheadertname").value;
	}
	
	if(document.getElementById("hpinningname") != null)
	{
	document.getElementById("spanpinning").innerHTML=	document.getElementById("hpinningname").value;
	}
	if(document.getElementById("hliftname") != null)
	{
	document.getElementById("spanlift").innerHTML=	document.getElementById("hliftname").value;
	}
	
	if(document.getElementById("hfringename") != null)
	{
	document.getElementById("spanfringecolor").innerHTML=	document.getElementById("hfringename").value;
	}
	
	document.getElementById("spansize").innerHTML=document.getElementById("WidthInches2").value + "(" +document.getElementById("hwidthdegree").value+")x" + document.getElementById("HeightInches2").value + "("+document.getElementById("hheightdegree").value+")";
	
	//var fabric_name = document.getElementById("fabricid").options[document.getElementById("fabricid").selectedIndex].text;
	var fabric_name=document.getElementById("hfabricname").value;
	
	document.getElementById("fabcolor").innerHTML=	(document.getElementById("selectedcolorname").innerHTML) + " - " + fabric_name;
	
}



function calTotalPriceOnBasePriceChange()
{
	
	//alert('#################');
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*COLOR PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	if(document.getElementById("hcolorprice_type").value=='D')
	{
	document.getElementById("hcolorprice").value=parseFloat(document.getElementById("hcolorprice_value").value);
	
	}
	if(document.getElementById("hcolorprice_type").value=='P')
	{
		var price=((parseFloat(document.getElementById("hcolorprice_value").value))*(parseFloat(document.getElementById("hbaseprice").value)))/100;
		document.getElementById("hcolorprice").value=price;
	}
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*COLOR PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*LINING PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	if(document.getElementById("hliningprice_type").value=='D')
	{
	document.getElementById("hliningprice").value=parseFloat(document.getElementById("hliningprice_value").value);
	}
	if(document.getElementById("hliningprice_type").value=='P')
	{
		var price=((parseFloat(document.getElementById("hliningprice_value").value))*(parseFloat(document.getElementById("hbaseprice").value)))/100;
		document.getElementById("hliningprice").value=price;
	}
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*LINING PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*CONTROL PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	if(document.getElementById("hcontrolprice_type").value=='D')
	{
	document.getElementById("hcontrolprice").value=parseFloat(document.getElementById("hcontrolprice_value").value);
	}
	if(document.getElementById("hcontrolprice_type").value=='P')
	{
		var price=((parseFloat(document.getElementById("hcontrolprice_value").value))*(parseFloat(document.getElementById("hbaseprice").value)))/100;
		document.getElementById("hcontrolprice").value=price;
	}
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*CONTROL PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	
	
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*MOUNT PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	if(document.getElementById("hmountprice_type").value=='D')
	{
	document.getElementById("hmountprice").value=parseFloat(document.getElementById("hmountprice_value").value);
	}
	if(document.getElementById("hmountprice_type").value=='P')
	{
		var price=((parseFloat(document.getElementById("hmountprice_value").value))*(parseFloat(document.getElementById("hbaseprice").value)))/100;
		document.getElementById("hmountprice").value=price;
	}
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*MOUNT PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	
	
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*UPGRADE PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	if(document.getElementById("hupgradeprice_type").value=='D')
	{
	document.getElementById("hupgradeprice").value=parseFloat(document.getElementById("hupgradeprice_value").value);
	}
	if(document.getElementById("hupgradeprice_type").value=='P')
	{
		var price=((parseFloat(document.getElementById("hupgradeprice_value").value))*(parseFloat(document.getElementById("hbaseprice").value)))/100;
		document.getElementById("hupgradeprice").value=price;
	}
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*UPGRADE PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*PLEATES PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	if(document.getElementById("hpleatsprice_type").value=='D')
	{
	document.getElementById("hpleatsprice").value=parseFloat(document.getElementById("hpleatsprice_value").value);
	}
	if(document.getElementById("hpleatsprice_type").value=='P')
	{
		var price=((parseFloat(document.getElementById("hpleatsprice_value").value))*(parseFloat(document.getElementById("hbaseprice").value)))/100;
		document.getElementById("hpleatsprice").value=price;
	}
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*PLEATES PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*POCKET SHEADE PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	if(document.getElementById("hpockectsheaderprice_type").value=='D')
	{
	document.getElementById("hpockectsheaderprice").value=parseFloat(document.getElementById("hpockectsheaderprice_value").value);
	}
	if(document.getElementById("hpockectsheaderprice_type").value=='P')
	{
		var price=((parseFloat(document.getElementById("hpockectsheaderprice_value").value))*(parseFloat(document.getElementById("hbaseprice").value)))/100;
		document.getElementById("hpockectsheaderprice").value=price;
	}
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*POCKET SHEADE PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*GROMMET COLOR PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	if(document.getElementById("hgrommetcolorsprice_type").value=='D')
	{
	document.getElementById("hgrommetcolorsprice").value=parseFloat(document.getElementById("hgrommetcolorsprice_value").value);
	}
	if(document.getElementById("hgrommetcolorsprice_type").value=='P')
	{
		var price=((parseFloat(document.getElementById("hgrommetcolorsprice_value").value))*(parseFloat(document.getElementById("hbaseprice").value)))/100;
		document.getElementById("hgrommetcolorsprice").value=price;
	}
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*GROMMET COLOR PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	
	
	
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*WAND PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	if(document.getElementById("hwandprice_type").value=='D')
	{
	document.getElementById("hwandprice").value=parseFloat(document.getElementById("hwandprice_value").value);
	}
	if(document.getElementById("hwandprice_type").value=='P')
	{
		var price=((parseFloat(document.getElementById("hcordprice_value").value))*(parseFloat(document.getElementById("hbaseprice").value)))/100;
		document.getElementById("hwandprice").value=price;
	}
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*WAND PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	
	
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*PINNING PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	if(document.getElementById("hpinningprice_type").value=='D')
	{
	document.getElementById("hpinningprice").value=parseFloat(document.getElementById("hpinningprice_value").value);
	}
	if(document.getElementById("hpinningprice_type").value=='P')
	{
		var price=((parseFloat(document.getElementById("hpinningprice_value").value))*(parseFloat(document.getElementById("hbaseprice").value)))/100;
		document.getElementById("hpinningprice").value=price;
	}
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*PANNING PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*FINISH PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	if(document.getElementById("hfinishprice_type").value=='D')
	{
	document.getElementById("hfinishprice").value=parseFloat(document.getElementById("hfinishprice_value").value);
	}
	if(document.getElementById("hfinishprice_type").value=='P')
	{
		var price=((parseFloat(document.getElementById("hfinishprice_value").value))*(parseFloat(document.getElementById("hbaseprice").value)))/100;
		document.getElementById("hfinishprice").value=price;
	}
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*FINISH PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*FRINGE & CORD PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	if(document.getElementById("hfringeandcordprice_type").value=='D')
	{
	document.getElementById("hfringeandcordprice").value=parseFloat(document.getElementById("hfringeandcordprice_value").value);
	}
	if(document.getElementById("hfringeandcordprice_type").value=='P')
	{
		var price=((parseFloat(document.getElementById("hfringeandcordprice_value").value))*(parseFloat(document.getElementById("hbaseprice").value)))/100;
		document.getElementById("hfringeandcordprice").value=price;
	}
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*LIFT  PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	if(document.getElementById("hliftprice_type").value=='D')
	{
	document.getElementById("hliftprice").value=parseFloat(document.getElementById("hliftprice_value").value);
	}
	if(document.getElementById("hliftprice_type").value=='P')
	{
		var price=((parseFloat(document.getElementById("hliftprice_value").value))*(parseFloat(document.getElementById("hbaseprice").value)))/100;
		document.getElementById("hliftprice").value=price;
	}
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*LIFT=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*RETURN SIZE  PRICE=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	if(document.getElementById("hreturnsizeprice_type").value=='D')
	{
	document.getElementById("hreturnsizeprice").value=parseFloat(document.getElementById("hreturnsizeprice_value").value);
	}
	if(document.getElementById("hreturnsizeprice_type").value=='P')
	{
		var price=((parseFloat(document.getElementById("hreturnsizeprice_value").value))*(parseFloat(document.getElementById("hbaseprice").value)))/100;
		document.getElementById("hreturnsizeprice").value=price;
	}
	/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*RETURN SIZE PRICE =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
	
	
	calTotalPrice();
	
	
}

