

function ITN(title) {

	value = HTTPGetRequest(false , "/private/news/ajax/" + title );

	if (value != "error") {
		document.getElementById("dyncontent").innerHTML = value;
	}

	return false;
}



function ValidateContest(){
	form = document.forms['contestForm'];

	txt = document.getElementsByTagName("textarea");

	var sub = true;
	for (var i = 1 ; i <= txt.length ; i++ ) {
		if (!eval("form.answer_a" + i + ".value")) {
			sub = false;
		}
	}

	if (!sub) {
		alert("Please answer all " + txt.length + " questions!");
	} else {

		if (!form.photo.value) {
			alert("Please upload a photo with you.");
		} else {
			if (!form.tos_1.checked) {
				alert("In order to be eligible to be a spokesperson for Nature's Cure, you must use at least one Nature's Cure acne treatment product. Use the $2 coupon on the contest homepage to get Nature's Cure today!");
			} else {
				if (!form.tos_2.checked) {
					alert("You need to accept the terms and conditions of the contest.");
				} else {
					form.action="/contest/apply";
					form.submit();
				}
			}
		}
	}
}

function SendEmail(){

	var w = 400;
	var h = 280;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,toolbar=no,menubar=no,statusbar=no,status=no,resizable=no'

	var url = "/email.html";


	popup = window.open(url, "email", winprops);	

	if (typeof(popup) == "undefined") {
		if (navigator.userAgent.indexOf("Safari") != "-1") {
			alert("We cant open a popup. Please disable your popup filter or press CTRL+SHIFT+K.");
		} else {
			alert("We cant open a popup. Please disable your popup filter.");
		}
	}
}

function ForgotPassword(){

	var w = 400;
	var h = 190;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,toolbar=no,menubar=no,statusbar=no,status=no,resizable=no'

	var url = "/forgot";


	popup = window.open(url, "forgot", winprops);	

	if (typeof(popup) == "undefined") {
		if (navigator.userAgent.indexOf("Safari") != "-1") {
			alert("We cant open a popup. Please disable your popup filter or press CTRL+SHIFT+K.");
		} else {
			alert("We cant open a popup. Please disable your popup filter.");
		}
	}
}

function SendCoupon(){

	var w = 400;
	var h = 415;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,toolbar=no,menubar=no,statusbar=no,status=no,resizable=no'

	var url = "/email/coupon";


	popup = window.open(url, "coupon", winprops);	

	if (typeof(popup) == "undefined") {
		if (navigator.userAgent.indexOf("Safari") != "-1") {
			alert("We cant open a popup. Please disable your popup filter or press CTRL+SHIFT+K.");
		} else {
			alert("We cant open a popup. Please disable your popup filter.");
		}
	}
}



function  LinkPage(){

	var w = 550;
	var h = 300;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,toolbar=no,menubar=no,statusbar=no,status=no,resizable=no'

	var url = "/link-page";


	popup = window.open(url, "link", winprops);	

	if (typeof(popup) == "undefined") {
		if (navigator.userAgent.indexOf("Safari") != "-1") {
			alert("We cant open a popup. Please disable your popup filter or press CTRL+SHIFT+K.");
		} else {
			alert("We cant open a popup. Please disable your popup filter.");
		}
	}
}

