
function fnAddCart(varProID) {
	//alert("features not implemented yet");
	//alert("Item has been added to inquiry basket");
	document.cart.submit();
	//AddCart.location = 'add_item.html?item=' + varProID;
}

function fnDelItem(pid) {

	document.cart.delItem.value = pid;
	document.cart.Action.value = "delete";
	document.cart.submit();
} 
function fnUpdate_cart(pid) {

	document.cart.Action.value = "update";
	document.cart.submit();
} 
function fnSubmit() {
	if((document.forms[1].emailAddress.value == '') ||
	(document.forms[1].contactName.value == '') ||
	(document.forms[1].companyName.value == '')) {
		alert('Please fill out the fields that marked with a (*). \nThen, resubmit the form. \nThank You.');
		return false;
	}

}
function fnLoadProduct(id) {
	url = "product.html?product_id="+id;
	document.location = url;
	//myWin = window.open(url, "winImg", "width=520,height=528,resizable=yes,scrollbars=yes,status=yes");
        //myWin.focus();
}
function fnLoadCatProduct(id) {
	url = "cata_product.html?product_id="+id;
	document.location = url;
	//myWin = window.open(url, "winImg", "width=520,height=528,resizable=yes,scrollbars=yes,status=yes");
        //myWin.focus();
}

function fnLoadSearchProduct(id, search, intPage) {
	//if(intPage != 0) {
		url = "product.html?product_id="+id + "&search=" + search + "&intPage=" + intPage;
	//}
	
	//url = "product.html?product_id="+id + "&search=" + search;
	document.location = url;
}
function fnLoadPage(page, intPage, varNum) {
	url = page + "?intPage=" + intPage + "&varNum=" + varNum;
	document.location = url;

}

function fnLoadPromote(id) {
	url = "http://www.toyswholesale.net/product.html?product_id="+id;
	document.location = url;
	
}

function makePopup(no_pop_site)
{ // USAGE: initialize on page load using an attachEvent action
	d=document.getElementsByTagName('a');
	var popfun;
	regexp = new RegExp(no_pop_site);
	var windowAttributes='width=750,height=500,left=0,top=0,resizable=yes,scrollbars=yes,toolbar=yes';
	if (d.length > 0) { // links are modifiable
		
		for (var i=0; i < d.length; i++) {
				if(!d[i].href.match(regexp)) {
					popfun=function(){ 
       					var awin = window.open(this.href,'mywin', windowAttributes); 
       					awin.focus();
       					return false; 
     				};
					d[i].onclick=popfun; 
     				d[i].onkeypress=popfun;
				}
     		
		}
	}
}
