	function change(id, newClass) {
		identity=document.getElementById(id);
		if (identity != null)
			identity.className=newClass;
	}
	function changeO(id, newClass) {
		//identity=document.getElementById(id);
		if (id != null)
			id.className=newClass;
	}
	function win_popup(file, name, attribs) {
		window.open (file, name, attribs); 
	}
	
	var WinNum=0;
	function WindowOpen(Url,x,y) {
		var String;
		String =  "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=0,copyhistory=0,";
		String += ",width=";
		String += x;
		String += ",height=";
		String += y;
		WinPic=window.open(Url,WinNum++,String);
	}
	
	function hide_sub(name, cell, i) {
		var b = document.getElementById(name);
		if (b != null) {
			b.style.display = 'none';	
		}
	}
	
	function show_sub(name, cell, i) {
		var b = document.getElementById(name);
		if (b != null) {
			b.style.display = '';	
		}
	}
	
	function addToCart(prod_id, page_id, security)
	{
		var el = document.getElementById('amount_'+prod_id);
		if (!el) return;
		if (isNaN(el.value)) 
		{
			alert("Please enter a number.");
			return;
		}
		
		var am = parseInt(el.value);
		if (am <= 0) 
		{
			alert("Please enter a positive number greater than 0.");
			return;
		}
		
		// shopping_cart.php?cmd=add_to_cart&product_id=". $e["product_id"] ."&security=". $security ."&page_id=". $page_id 
		document.location = 'shopping_cart.php?cmd=add_to_cart&quantity='+am+'&product_id='+prod_id+'&security='+security+'&page_id='+page_id;
	}	
