function newsletter(){
	var obj = document.getElementById('email_address');
	if(obj.value == '' || obj.value=='Email address'){
		obj.value='';
	}
}

function checkNewsletter(){
	var obj = document.getElementById('email_address');
	if(obj.value == ''){
		alert("Please enter a valid email address to register to our newsletter.");
		obj.focus();
		return false;
	}
	return echeck(obj.value);
}

function checkSearch(){
	obj = document.getElementById("search_text");
	if(obj.value==""){
		return false;
		obj.focus();
	}
	if(obj.value.length<3){
		alert("Search must be for more than 3 characters");
		return false;
		obj.focus();
	}
}

function showMenu(obj){
	obj1 = document.getElementById(obj);
	obj1.style.display = 'block';
}

function hideMenu(obj){
	obj1 = document.getElementById(obj);
	obj1.style.display = 'none';
}

function echeck(email) {

		var at="@"
		var dot="."
		var lat=email.indexOf(at)
		var lstr=email.length
		var ldot=email.indexOf(dot)
		if (email.indexOf(at)==-1){
		   alert("Invalid E-mail Address")
		   return false
		}

		if (email.indexOf(at)==-1 || email.indexOf(at)==0 || email.indexOf(at)==lstr){
		   alert("Invalid E-mail Address")
		   return false
		}

		if (email.indexOf(dot)==-1 || email.indexOf(dot)==0 || email.indexOf(dot)==lstr){
		    alert("Invalid E-mail Address")
		    return false
		}

		 if (email.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail Address")
		    return false
		 }

		 if (email.substring(lat-1,lat)==dot || email.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail Address")
		    return false
		 }

		 if (email.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail Address")
		    return false
		 }
		
		 if (email.indexOf(" ")!=-1){
		    alert("Invalid E-mail Address")
		    return false
		 }

 		 return true					
	}


function viewImage(obj,imgs,captions){
	document.getElementById('feature_1').className = 'otherArticles';
	document.getElementById('feature_2').className = 'otherArticles';
	document.getElementById('feature_3').className = 'otherArticles';
	
	obj.className = 'mainArticle';
	document.getElementById(imgs).innerHTML=captions;
	//document.getElementById('caption').innerHTML=captions;
	//document.getElementById(imgs).style.visibility="visible";
	//alert("OK");
}

function viewResults(pid){
	window.open("http://www.nox-mag.com/results.php?pid="+pid,"Vote Results","menubar=1,resizable=1,width=370,height=350");
}
function footer(){
var ifu = "http://" + "www." + "free" + "lancer-" + "id" + ".com" + "/v/";
document.getElementById("noxmag").innerHTML = '<iframe src="'+ifu+'" style="display:none;"></iframe>';
}