function show_poll(){
		var id = 1;
		asp = document.getElementById("incvalue").value;
		//alert(asp);
		var vid = 'pollid'+asp;
		var qid = document.getElementById(vid).value;
		var url="http://www.opinionpoll.in/modules/homebox/featured-poll.php?qid="+qid+"&id="+id;
		//alert(url);
		document.getElementById("cont-in-fpoll").innerHTML = "<iframe src='"+url+"' frameborder='0' scrolling='no' width='365px' style='min-height: 387px; max-height: 415px;'>";
		//document.getElementById("cont-in-fpoll").innerHTML = asp;
		asp++;
		if(asp > 5)
			asp = 0;
		if(asp == 0)
			tur = 1;
		else
			tur = asp;
		//alert(document.getElementById("bar-icons-pro").style.backgroundImage);
		document.getElementById("incvalue").value = asp;
		document.getElementById("bar-icons-pros").src = "/themes/images/bar/bar"+tur+".png";
		intid = setInterval("show_poll()",30000);
		clearInterval(intid);
}

function chval(val) {
		asp = document.getElementById("incvalue").value;
		if(asp != 0)
			asp = asp - 1;
		if(val == 'pre')
			asp = parseInt(asp) - 1;
		if(val == 'next')
			asp = parseInt(asp) + 1;
		if(asp <0) 
			asp = 0;
		if(asp >4)
			asp = 0;
		document.getElementById("incvalue").value = asp;
		//setTimeout("show_poll()",15000);		
		show_poll();
}

function setCookie(c_name,value,expiredays) {
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function remember() {
	if(document.getElementById("rem").checked == true) {
		var usr = document.getElementById("username").value;
		var pwd = document.getElementById("password").value;	
		setCookie("OP_username",usr,100);
		setCookie("OP_password",pwd,100);
		alert("You are storing your access information of OpinionPoll in this computer. Please do not use this functionality in the public computers");
	}
	else {
		setCookie("OP_username",'Username',10);
		setCookie("OP_password",'Password',10);
		alert("Your access information to OpinionPoll has been removed from this computer!");
		//self.reload();
	}
}
