function print_article(id){
	
	if (id!="")
	{
		window.open ("print_article.php?id="+id,null,"width=570,height=600,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes")
	}

}

function text_size(sign){
	newsize=parseFloat((document.getElementById('text').style.fontSize).replace("px",""))+parseFloat((sign));
	if (newsize<1)
	{
		newsize=1;
	}
	newsize=newsize+"px";
	document.getElementById('text').style.fontSize=newsize
}

	function mail_article(id,cat){
		if (id!="")
			{
				window.open ("email_article.php?id="+id+"&c_id="+cat,null,"width=410,height=487,menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=no")
			}
	}

function checkEmail(email) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)){
return (true)
}
return (false)
}

function emailArticel_fr(){
//check send to email
//check from email
	from=document.forms['mail_fr'].email2.value;
	to=document.forms['mail_fr'].email1.value;

	if (checkEmail(to)==false)
	{
		alert("Recipient email is not valid");
		return;
	}

	if (checkEmail(from)==false)
	{
		alert("Sender email is not valid");
		return;
	}

	document.mail_fr.submit()



}

function tlkbck_article(id){
	window.open ("article_tlkbck.php?id="+id,null,"width=410,height=417,menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=no")
}

function talkArticel_fr(){
	if (document.forms['talk_fr'].subject.value=="")
	{
		alert("Subject field is required!");
		return;
	}	
	
	if ((document.forms['talk_fr'].subject.value).length>254)
	{
		alert("Subject field can be up to 255 charecters");
		return;
	}	

	if (document.forms['talk_fr'].privacy.checked==false)
	{
		alert("Please agree to the terms of use");
		return;
	}

	document.talk_fr.submit()
}



function load_comments(page,div_str){
	div_ID=div_str
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	}
	
	var url=page
	//url=url+"?id="+document.getElementById("quest").value
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function show_comments(id){
	if (document.getElementById('comment_'+id).style.display=="block")
	{
		document.getElementById('comment_'+id).style.display="none";
	}else{
		document.getElementById('comment_'+id).style.display="block";
	}
}

function recommend(num){
	for (i=1;i<(num+1) ;i++ )
	{
		
		document.getElementById('star_'+i).src="/images/star_yellow.gif";
	}
}

function recommend_out(num){
	for (i=1;i<6 ;i++ )
	{
		document.getElementById("star_"+i).src="/images/star_blank.gif";
	}
}