
function NewWindow(mypage, myname, w, h, scroll)
	{
		var winl = (screen.width - w) / 2;
        var wint = (screen.height - h) / 2;
        winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
        win = window.open(mypage, myname, winprops)
        if (parseInt(navigator.appVersion) >= 4) { win.window.focus();}
    }

function MM_reloadPage(init)
	{
		if (init==true)
			with (navigator)
				{
					if ((appName=="Netscape")&&(parseInt(appVersion)==4))
						{
							document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage;
						}
				}
		else
			if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
				location.reload();
	}


function checkSubmit()
	{
		if (submitcount == 0)
			{
				submitcount++;
				document.Surv.submit();
			}
	}

function wordCounter(field, countfield, maxlimit)
	{
		wordcounter=0;
		for (x=0;x<field.value.length;x++)
			{
				if (field.value.charAt(x) == " " && field.value.charAt(x-1) != " ")
					{wordcounter++};
				if (wordcounter > 250)
					field.value = field.value.substring(0, x)
				else
					countfield.value = maxlimit - wordcounter;
			}
	}

function textCounter(field, countfield, maxlimit)
	{
		if (field.value.length > maxlimit)
			field.value = field.value.substring(0, maxlimit)
		else
			countfield.value = maxlimit - field.value.length;
	}

function displayHTML(form)
	{
		var inf =	"<center>"+
					"<table width=150 border=0 cellspacing=0 cellpadding=0><tr><td>"					+
					"<p><font color=#454555 size=-2 face=Verdana, Arial, Helvetica, sans-serif>"		+
					"[+]--------------------------------------------------[+]"							+
					"<br><br>"																			+
					"<b>Name</b>:<br>  " + form.name.value												+
					"<br><br>"																			+
					"<b>Email</b>:<br> " + form.email.value												+
					"<br><br>"																			+
					"<b>Subject</b>:<br>  " + form.subject.value										+
					"<br><br>"
					"<b>Message</b>:<br>  " + form.message.value										+
					"<br><br>"																				+
					"[+]--------------------------------------------------[+]"							+
					"<br><br><br><br>"																	+
					"<center><a href=javascript:self.close()>Close Me</a></center>"						+
					"</font>"																			+
					"</td></tr></table>"																+
					"</center>";
		
		win = window.open("url", 'popup', 'height=300,width=350,scrollbars=auto,resizable=no,toolbar = no, status = no');
		win.document.write("" + inf + "");
		return false;
	}



function hoverItemOn(x) {
   x.style.backgroundColor = '#f2f2f2';
   x.style.color = '#f1f1f1';
}

function hoverItemOff(x) {
   x.style.backgroundColor = '#ffffff';
   x.style.color = '#f1f1f1';
}
