	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 addItem(page_id, id)
	{
		var e = document.getElementById('cb_products_'+id);
		if (!e) return;
		
		var qty = e.value;
		if (isNaN(qty))
		{
			alert('Please enter a numeric value.');
			e.select();
			return;
		}
		
		document.location = 'cookbook.php?cmd=additem&product_id='+id+'&page_id='+page_id+'&qty='+qty;
	}
	
	function verifyComments(f)
	{
		if (f.elements['f[Last-Meal-Had]'].value == '') 
		{
			alert('Please specify the last meal you had from dinner factory');
			return false;
		}
		if (f.elements['f[Comments]'].value == '') 
		{
			alert('Please specify your comments or suggestions');
			return false;
		}
		var checked = false;
		for(var i=0; i<f.elements['f[Meal-Rating]'].length; ++i)
		{
			if (f.elements['f[Meal-Rating]'][i].checked) 
			{
				checked = true;
				break;
			}
		}
		
		if (!checked)
		{
			alert('Please specify a rating');
			return false;
		}
		
		if (f.elements['captcha_code'].value == '') 
		{
			alert('Please specify the text displayed in the image above the submit button');
			return false;
		}
		return true;
	}
	
	
	
	
	