/*
Programmer A.Md.Azath
Date: 25:04:07
Client: Mahendra Jewellery
*/
var arr,str;
arr = new Array();

arr[1] = "Chains,Earrings,Gifts,Pendants,Rings,Watches,Watch Straps,Wedding Sets,Bangles,Necklaces,Bracelets,Diety Pendants,All";

arr[2] = "Rings";

arr[3] = "Chains,Earrings,Pendants,Rings,Watches,Wedding Sets,All";

arr[4] = "Chains,Earrings,Gifts,Pendants,Rings,Watches,Watch Straps,Wedding Sets,Bangles,Necklaces,Bracelets,Diety Pendants,All";

function chgitem()
{
catid = document.mahendra.catid[document.mahendra.catid.selectedIndex].value
	if(catid != 0)
	{
	str = arr[catid].split(",");
	document.mahendra.subcat.length=1;
		if(str == "")
		{
		document.mahendra.subcat.options[0] = new Option("----Not available----");
		document.mahendra.subcat.options[0].value = 0;
		}
		else
		{
		document.mahendra.subcat.options[0] = new Option("---- Select ----");
		document.mahendra.subcat.options[0].value = 0;
			for(i=0;i<str.length;i++)
			{
			document.mahendra.subcat.options[i+1] = new Option(str[i])
			document.mahendra.subcat.options[i+1].value = str[i];
			}
		}
	}
	//else
	//{
	//document.mahendra.subcat.length=1;
	//document.mahendra.subcat.options[0] = new Option("---- Select ----");
	//document.mahendra.subcat.options[0].value = 0;
	//}
}
function send()
{
	if(document.mahendra.catid[document.mahendra.catid.selectedIndex].value == 0)
	{
	alert("Please select a metal type")
	return false;
	}
	else if(document.mahendra.subcat[document.mahendra.subcat.selectedIndex].value == 0)
	{
	alert("Please select a jewellery type")
	return false;
	}
	else if(document.mahendra.price[document.mahendra.price.selectedIndex].value == 0)
	{
	alert("Please select a Price")
	return false;
	}
	catid = document.mahendra.catid[document.mahendra.catid.selectedIndex].innerText;
	subcat = document.mahendra.subcat[document.mahendra.subcat.selectedIndex].innerText;
	price=document.mahendra.price[document.mahendra.price.selectedIndex].innerText;
	if(document.all.male.checked==true && document.all.female.checked==false)
	{
		var sex = "Male";
	}
	else if(document.all.female.checked==true && document.all.male.checked==false)
	{
		var sex = "Female";
	}
	else if(document.all.female.checked==true && document.all.male.checked==true)
	{
		var sex = "Male/Female";
	}
	else if(document.all.female.checked!=true && document.all.male.checked!=true)
	{
		var sex = "Male/Female";
	}
	else
	{
		if(subcat!="Gifts")
		{
		alert("Please select a gender");
		return false;
		}
	}
	if(document.mahendra.catid[document.mahendra.catid.selectedIndex].value != 0 || document.mahendra.subcat[document.mahendra.subcat.selectedIndex].value != 0)
	{
//gold bangles lesserthan 10000
		window.open("collections.aspx?cid="+catid+"&jid="+subcat+"&sex="+sex+"&rng="+price+"&pgno=1","_self");
	}
	
else
	{
	alert("Not Available")
	}
}
