
function updateSub(formName)
{
	//alert('in updateSub');
	var main=document.forms[formName].main.value;
	if (main!='')
	{
		self.location='add-products.php?main=' +main; 
	}
}

function updateSub2(formName)
{
	//alert('in updateSub2');
	var main=document.forms[formName].main.value;
	var sub1=document.forms[formName].sub1.value;
	if (sub1!='')
	{
		self.location='add-products.php?main=' +main+'&sub1='+sub1; 
	}
}


function updateSub3(formName)
{
	//alert('in updateSub3');
	var main=document.forms[formName].main.value;
	var sub1=document.forms[formName].sub1.value;
	var sub2=document.forms[formName].sub2.value;
	if (sub2!='')
	{
		self.location='add-products.php?main=' +main+'&sub1='+sub1+'&sub2='+sub2; 
	}
	
}

function showForm()
{
	val = document.getElementById('special').checked;
	if (val) {
		  document.getElementById('Specialrows').style.display	= "";
	} else {
		  document.getElementById('Specialrows').style.display	= "none";
	}
}

function showFormNew()
{
	val = document.getElementById('newspecial').checked;
	if (val) {
		  document.getElementById('SpecialNew').style.display	= "";
	} else {
		  document.getElementById('SpecialNew').style.display	= "none";
	}
}

function showFormNew1()
{
	val = document.getElementById('newspecial1').checked;
	if (val) {
		  document.getElementById('SpecialNew1').style.display	= "";
	} else {
		  document.getElementById('SpecialNew1').style.display	= "none";
	}
}

function orderprocess(){
	alert('hello');
	//document.getElementById('ordernow').value=true;	
	//document.orderform.submit();
}

function listingOrder(){
	orderby=document.getElementById('orderby').value;
	catid=document.getElementById('catid').value;
	
	self.location='product-listing.php?catid='+catid+'&orderby='+orderby;
}

function listingOrderCMS(){
	orderby=document.getElementById('orderby').value;
	
	self.location='all-order.php?orderby='+orderby;
}


function DoTheCheck() {

	if(document.myform.displayimage.checked == true) {
		self.location='view-all-products.php?displayimage=1';
	} else {
		self.location='view-all-products.php?displayimage=0';
	}

}

function DoTheCheckCat(main) {

	if(document.myform.displayimage.checked == true) {
		self.location='view-all-products-cat.php?displayimage=1&main='+main;
	} else {
		self.location='view-all-products-cat.php?displayimage=0&main='+main;
	}

}


function DoTheCheckSpecials() {

	if(document.myform.displayimage.checked == true) {
		self.location='view-specials.php?displayimage=1';
	} else {
		self.location='view-specials.php?displayimage=0';
	}

}

function DoTheCheckSpecialsCat(main) {

	if(document.myform.displayimage.checked == true) {
		self.location='view-specials-cat.php?displayimage=1&main='+main;
	} else {
		self.location='view-specials-cat.php?displayimage=0&main='+main;
	}

}

DoTheCheckSpecialsCat

function undoDisableForm() {

	if(document.myform.sameshipping.checked == true) {
		document.myform.name.disabled=true;
		document.myform.company.disabled=true;
		document.myform.phone.disabled=true;
		document.myform.street.disabled=true;
		document.myform.suburb.disabled=true;
		document.myform.state.disabled=true;
		document.myform.postcode.disabled=true;
		document.myform.country.disabled=true;
	} else {
		document.myform.name.disabled='';
		document.myform.company.disabled='';
		document.myform.phone.disabled='';
		document.myform.street.disabled='';
		document.myform.suburb.disabled='';
		document.myform.state.disabled='';
		document.myform.postcode.disabled='';
		document.myform.country.disabled='';
	}

}

