function setsukhi()
{
	
	if (document.frmproduct.product_cat.value=='n')
	{
		alert ("Please select Category");
		return false;
	}
	else if(document.frmproduct.product_cat.value=="2211")
	{
		document.frmproduct.action="member_add_product_digital_music.php";
		document.frmproduct.method="post";
		document.frmproduct.submit();
	}
	else if(document.frmproduct.product_cat.value=="23")
	{
		/*document.frmproduct.action="member_add_product_digital_download.php";
		document.frmproduct.method="post";
		document.frmproduct.submit();
		window.location.href='member_add_product_step3.php';*/
		var catID=document.frmproduct.product_cat.value;
		var subcatID=document.frmproduct.product_subcat.value;
		if(catID!='' && subcatID!='' )
		{
		window.location.href='member_add_product_step3.php?cat_id='+catID+'&subcat_id='+subcatID;
		}
		else
		{
			alert("Please select sub category");
			document.frmproduct.product_subcat.focus();
			return false;	
		}
	}
	else if(document.frmproduct.product_cat.value=="22")
	{
		var catID=document.frmproduct.product_cat.value;
		var subcatID=document.frmproduct.product_subcat.value;
		if(catID!='' && subcatID!='' )
		{
			window.location.href='member_add_product_step2.php?cat_id='+catID+'&subcat_id='+subcatID;
		}
		else
		{
			alert("Please select sub category");
			document.frmproduct.product_subcat.focus();
			return false;	
		}
	}
	else{
		document.frmproduct.action="member_add_product.php";
		document.frmproduct.method="post";
		document.frmproduct.submit();
	}
//	alert(document.frmproduct.product_cat.value);

//alert ("sukhi");
}

function showhide(id1) {
	if(document.getElementById(id1).style.display=='none') {
		document.getElementById(id1).style.display='block';
	} else {
		document.getElementById(id1).style.display='none';
	}
}

function showdiv(id1) {
	if(document.getElementById(id1))
	{	
		document.getElementById(id1).style.display='block';
	}
}

function hidediv(id1) {
	if(document.getElementById(id1))
	document.getElementById(id1).style.display='none';
}

function ShowHideSelectDeps(field_id) {
  var elem = "field_"+field_id;
  var show = document.getElementById(elem).options[document.getElementById(elem).options.selectedIndex].value;
  var possible_options = document.getElementById(elem).options.length-1;
  for(x=0; x<possible_options; x++) {
    if(x != show | show == "") {
      hidediv(elem+"_option"+x);
    } else {
      showdiv(elem+"_option"+x);
    }
  }
}

function ShowHideRadioDeps(field_id, show, dep_field, total_options) {
  var elem = "field_"+field_id;
  for(x=0; x<total_options; x++) {
    if(x != show) {
      hidediv(elem+"_radio"+x);
    } else {
      showdiv(elem+"_radio"+x);
      if(document.getElementById(dep_field)) {
        document.getElementById(dep_field).focus()
	document.getElementById(dep_field).value = document.getElementById(dep_field).value;
      }
    }
  }
}

function validatepolicyfield()
{
	if(document.terms.chk.checked==false)
	{
		alert("Please check privacy policy");
		document.terms.chk.focus();
		return false;
	}
}
