var xmlHttp;



function pollresult()

{ 

	   // var count=document.form2.voteid.length;

	  

		var contact= document.getElementById('contactno').value;

		var email=document.getElementById('useremail').value;
		
		var state=document.getElementById('userstate').value;
		
		var country=document.getElementById('usercountry').value;

		var name=document.getElementById('name').value;

		var articleid=document.getElementById('articleid').value;

		var itemid=document.getElementById('itemid').value;

		var mess=document.getElementById('comment').value;

		

		 if(name==""){

			alert("Please enter Your Name.");

			 document.getElementById('name').focus();

			 return false;

		}

		if(contact==""){

			alert("Please enter Your Contact No.");

			 document.getElementById('contactno').focus();

			 return false;

		}

		var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;

	if(email.match(emailExp)==null){

		alert("Please enter Your Email Address.");

		 document.getElementById('useremail').focus();

		return false;

	}

	

xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)

 {

 alert ("Browser does not support HTTP Request");

 return;

 } 

var url="submit/submit.php";

url=url+"?name="+name;

url=url+"&email="+email

url=url+"&userstate="+state

url=url+"&usercountry="+country

url=url+"&contactno="+contact

url=url+"&mess="+mess

url=url+"&articleid="+articleid

url=url+"&itemid="+itemid

url=url+"&sid="+Math.random();

xmlHttp.onreadystatechange=stateChanged4;

xmlHttp.open("GET",url,true);

xmlHttp.send(null);

}



function isEmptyAddress(elem, helperMsg){

	if(elem== "Your Contact No"){

		alert(helperMsg);

		return false;

	}else{

	  return true;

	}

}



function stateChanged4() 

{ 

 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

 { 

	 

 document.getElementById("pollresult").innerHTML=xmlHttp.responseText;

 } 

}



function GetXmlHttpObject()

{

var xmlHttp=null;



try

 {

 // Firefox, Opera 8.0+, Safari

 xmlHttp=new XMLHttpRequest();

 }

catch (e)

 {

 // Internet Explorer

 try

  {

  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");

  }

 catch (e)

  {

  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");

  }

 }

return xmlHttp;

}



//=====================================================================================

 

var ini_start1 = -500;

var final_end1 = 15;

var t1;



function move_in1()

{	

	var el = document.getElementById('res_slider');

	ini_start1 = ini_start1 + 15;

	if (ini_start1 >= 15){stop_count1();}else{el.style.top = (ini_start1) + 'px';t1 = setTimeout("move_in1()",1);}

   // window.location.href = "#";



}



function move_out1()

{

	var el = document.getElementById('res_slider');

	final_end1 = final_end1 - 20;

	if (final_end1 <= -1000){

		stop_count1();

	}

	else

	{//alert(ini_start1+'acca'+final_end1);

		el.style.top = (final_end1) + 'px';

		t1 = setTimeout("move_out1()",1);	

	}



}





function set_intial1()

{

	var el = document.getElementById('res_slider');

	final_end1 = -1000;

	el.style.top = (final_end1) + 'px';

	

	stop_count1();

	//alert(ini_start1 +'set'+final_end1)

}



function stop_count1()

{

	clearTimeout(t1);

	ini_start1 = -500;

	final_end1 = 15;

	//alert(ini_start1 +'clear'+final_end1)

}



function slider_left1()

{

	var el = document.getElementById('res_slider');

	my_width = 510;

	scr_width = screen.width;	

	my_left = (scr_width/2) - (my_width/2);

	el.style.left = (my_left) + 'px';

}



function showhidenews(no)

{

	

	if(document.getElementById('content' + no).style.display=="block")

	{

		document.getElementById('content' + no).style.display="none";

	}

	else

	if(document.getElementById('content' + no).style.display=="none")

	{

		document.getElementById('content' + no).style.display="block";

	}	

}




