function gotoPage(item) { window.location = "http://www.micronutra.com/"+document.conditions.condition.value+".html"; }
function hide_show( id_1, id_2 ) {
	d = document;
	//alert( d.getElementById(id_2).style.visibility );
	if( d.getElementById(id_1).style.visibility == 'hidden' || d.getElementById(id_1).style.visibility == '' ) {
		d.getElementById(id_1).style.visibility = 'visible';
		d.getElementById(id_2).style.visibility = 'visible';
		d.getElementById(id_1).style.zIndex = '1';
		d.getElementById(id_2).style.zIndex = '1';
	} else {
		d.getElementById(id_1).style.visibility = 'hidden';
		d.getElementById(id_2).style.visibility = 'hidden';
		d.getElementById(id_1).style.zIndex = '-1';
		d.getElementById(id_2).style.zIndex = '-1';
	}
}
function toggle(holder,extend) {
	document.getElementById(holder).innerHTML = document.getElementById(holder).innerHTML == "" ? document.getElementById(extend).innerHTML : "";
	document.getElementById(holder).style.zIndex = document.getElementById(holder).innerHTML == "" ? '1' : '-1';
	document.getElementById(holder).style.visibility = document.getElementById(holder).innerHTML == "" ? 'hidden' : 'visible';
}
function addBookmark() {
	if (window.sidebar) {
		window.sidebar.addPanel( document.title, document.location.href,"" );
	}
	else if( document.all ) {
		window.external.AddFavorite( document.location.href, document.title );
	} else {
		return true;
	}
}
function check_newsletter_form() {
	d = document.newsletter;

	if( d.name.value == "" ) {
		alert( "Please enter your name" );
		return false;
	}
	if( d.from.value == "" ) {
		alert( "Please enter your email" );
		return false;
	}

	return true;
}

function check_contact_form() {
	d = document.contact;

	if( d["c[name]"].value == "" ) {
		alert( "Please enter your name" );
		return false;
	}
	if( d["c[email1]"].value != d["c[email2]"].value ) {
		alert( "Your email addresses must match" );
		return false;
	}
	if( d["c[email1]"].value == "" ) {
		alert( "Please enter your email address" );
		return false;
	}
	if( d["c[category]"].value == "" ) {
		alert( "Please enter your choose a category" );
		return false;
	}
	if( d["c[comments]"].value == "" ) {
		alert( "Please enter your comments" );
		return false;
	}

	return true;
}

function popUpLabel(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=250,height=250,left = 340,top = 0');");
}

function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=515,left = 472.5,top = 150');");
}

function email_friend_check() {
	d = document.email_friend;

	if( d["mail[s_name]"].value == "" ) {
		alert( "Please enter your name" );
		return false;
	}
	if( d["mail[s_email]"].value == "" ) {
		alert( "Please enter your email address" );
		return false;
	}
	if( d["mail[r_name]"].value == "" ) {
		alert( "Please enter your friend's name" );
		return false;
	}
	if( d["mail[r_email]"].value == "" ) {
		alert( "Please enter your friend's email address" );
		return false;
	}

	// Check email addresses!
	// Check for @
	at_symbol = d["mail[s_email]"].value.match("[/@]");
	if( at_symbol == null ) {
		alert( "Please make sure you entered your email address correctly" );
		return false;
	}
	at_symbol = d["mail[r_email]"].value.match("[/@]");
	if( at_symbol == null ) {
		alert( "Please make sure you entered your friend's email address correctly" );
		return false;
	}
	urchinTracker('/emailfriend/sent/' + d["mail[page]"]);
	return true;
}
