// JavaScript Document

function vote() {
	var w = 800, h = 600;
	

	
	if (self.innerWidth)
	{
		w = self.innerWidth;
		h = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientWidth)
	{
		w = document.documentElement.clientWidth;
		h = document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		w = document.body.clientWidth;
		h = document.body.clientHeight;
	}
	
	w = screen.width;
	h = screen.height;
	
	var popW = 250, popH = 300;
	
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;
	
	//alert (w + ' ' + h);
	//alert (leftPos + ' ' + topPos);
	
	var sCmd = 'toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + popW + ',height='+popH+',top='+topPos+',left='+leftPos;
	
	window.open("","rateresult",sCmd);
}

function toggle(id, cssClass)
{
	menulist = document.getElementById(id);
	if (menulist.getAttribute('class')==cssClass)
	{
		menulist.setAttribute('class', "hide");
	}
	else
	{
		menulist.setAttribute('class', cssClass);
	}
}

function mouseover(id)
{
	heading = document.getElementById(id);
	heading.setAttribute('class', "bold");
}

function mouseout(id)
{
	heading = document.getElementById(id);
	heading.setAttribute('class', "");
}

function openWin(url,name,w,h,features) {
	if(screen.width){
		var x = (screen.width-w)/2;
		var y = (screen.height-h)/2;
	} else{x = 0;y =0;}
	var settings = 'height=' + h + ',width=' + w + ',top=' + y + ',left=' + x + ',' + features;
	win = window.open(url,name,settings);
	win.window.focus();
	return false;
}

function verify(form) {
	var j = new RegExp();
    j.compile("<");
    if (j.test(form["message"].value)) {
            alert("Pun contains invalid characters");
            return false;
    }
    if (j.test(form["Email"].value)) {
            alert("Email address contains invalid characters");
            return false;
    }
    if (j.test(form["Name"].value)) {
            alert("Your name contains invalid characters");
            return false;
    }
    if (j.test(form["Location"].value)) {
            alert("The location contains invalid characters");
            return false;
    }
}
