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 checkemail(str){
	//Advanced Email Check credit-
	//By JavaScript Kit (http://www.javascriptkit.com)
	//Over 200+ free scripts here!
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(str)) {
		return true	
	} else{
		return false
	}
}
function email_check(str) {
/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
		return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		return false
	}

	if (str.indexOf(at,(lat+1))!=-1){
		return false
	}

	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		return false
	}

	if (str.indexOf(dot,(lat+2))==-1){
		return false
	}
		
	if (str.indexOf(" ")!=-1){
		return false
	}

 	return true					
}

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;
	}
}