
/*
document.getElementById('login_links').style.display = '';
document.getElementById('pagecontent').innerHTML = '';
document.commentForm.comment_body.value = '';

var d = c.replace(/\n/g, "<br>");

new Ajax.Request('/ax/comment_submit',
{
	method: 'post',
	postBody: 'c='+d+'&s='+s,
	onSuccess: function(transport){
		var response = transport.responseText;
		document.getElementById('comment_listing').innerHTML = response;
		document.commentForm.comment_body.value = '';
	},
	onFailure: function(){ alert('Error code: 412. Something went wrong.'); }
});

*/

function check_voter_ic(){

	ic = document.voter_verify.voter_verify_ic.value;

	if(ic){
//		Modalbox.show('/ax/check_voter/'+ic, {title: this.title});
		Modalbox.show('/ax/check_voter/'+ic, {'height':500, 'title':'UNDI.INFO'});
	}else{
		alert('Please type your IC number.');
	}

}

function searchForm(){

	t = document.search_state_header.select_state.value;
	q = document.search_state_header.search_header.value;

	if(q){
		Modalbox.show('/ax/search/'+t+'/'+q, {'height':500, 'title': 'UNDI.INFO'});
	}else{
		alert('Please type your search.');
	}

}




function SetCookie(name, value){
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	//var path = (argc > 3) ? argv[3] : null;
	var path = '/';
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	document.cookie = name + "=" + escape (value) +
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
	((path == null) ? "" : ("; path=" + path)) +
	((domain == null) ? "" : ("; domain=" + domain)) +
	((secure == true) ? "; secure" : "");
}

function GetCookie(sName){
	var docCookie = document.cookie
	if(docCookie.length>0){
		var begin = docCookie.indexOf(sName+'=')
		if(begin!=-1){
			end=docCookie.indexOf(';', begin)
			if(end==-1)end=docCookie.length
			return unescape(docCookie.substring(begin+sName.length+1, end))
		}
	}
	//a cookie with the requested name does not exist
	return null
}

function DelCookie(name) {
	document.cookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT" + "; path=/";
}
