function openlink(url) {
	window.location.href=url;
}

function OpenWin(url, w, h) {
	props=window.open(url, 'poppage', 'toolbars=0, scrollbars=1, location=0, statusbars=0, menubars=0, resizable=0, width='+ w +', height='+ h +', left = 150, top = 50');
}

/* Ajax code */
var http = createRequestObject();
function createRequestObject()
{
	if (window.XMLHttpRequest) 
	{ // Mozilla, Safari,...
		http = new XMLHttpRequest();
	} 
	else if (window.ActiveXObject) 
	{ // IE
		try 
		{
			http = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (error) 
		{
			try 
			{
				http = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (error) 
			{
				http = null; 
				return false;
			}
		}
	}
	return http;
}

function send_poll_vote(pid, opid){
	http.open('get', 'index_lite.php?show=poll&action=addvote&id='+ pid +'&opid='+ opid);
	http.onreadystatechange = poll_handle;
	http.send(null);
}
function poll_result(pid){
	http.open('get', 'index_lite.php?show=poll&action=view&id='+ pid );
	http.onreadystatechange = poll_handle;
	http.send(null);
}
function poll_handle(){
	if(http.readyState == 1){
		document.getElementById('poll').innerHTML = '<div align="center"><br /><img src="'+ imgsPath +'images/ajax_load.gif" border="0" /></div>';
	}
	if(http.readyState == 4){
		var response = http.responseText;
		document.getElementById('poll').innerHTML = response;
	}
}
function play_video(link, image) {
	$(".vplayer").html("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='360' height='260' id='single1' name='single1'><param name='movie' value='" + siteUrl + "/player/player.swf'><param name='allowfullscreen' value='true'><param name='allowscriptaccess' value='always'><param name='wmode' value='transparent'><param id='flashvars' name='flashvars' value='file="+link+"&image="+image+"'><embed type='application/x-shockwave-flash' id='single2' name='single2' src='" + siteUrl + "/player/player.swf' width='360' height='280' bgcolor='undefined' allowscriptaccess='always' allowfullscreen='true' wmode='transparent' flashvars='file="+ link +"&image="+ image +"' /></object>");
}
function show_writer_articles(id){
	if (id != 00) {
	http.open('get', 'index_lite.php?show=news&action=writers&op=show_writer_articles&id='+id);
	http.onreadystatechange = swa_handle;
	http.send(null);
	}
}
function swa_handle(){
	if(http.readyState == 1){
		document.getElementById('swa').innerHTML = '<div align="center"><br /><img src="'+ imgsPath +'images/ajax_load.gif" border="0" /></div>';
	}
	if(http.readyState == 4){
		var response = http.responseText;
		document.getElementById('swa').innerHTML = response;
	}
}
