
/* 
Function: openWindow
Purpose: Opens a popup window
Inputs: url, width, height
*/

function openWindow(url,windowWidth,windowHeight)
{
	var newwindow;

	newwindow = window.open(url, "",'location=no, toolbar=no, menubar=no, directories=no, status=no, resizable=no, scrollbars=yes, height='+windowHeight+',width='+windowWidth+',left=100,top=100,screenX=300,screenY=30', false);

	if (window.focus) {newwindow.focus()}
}

var highlightcolor="#ebfdb5"
var ns6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA|SELECT|OPTION/

//Function to check whether element clicked is form element
function checkel(which){
	if (which.style&&intended.test(which.tagName)){
		if (ns6&&eventobj.nodeType==3)
		eventobj=eventobj.parentNode.parentNode
		return true
	}
	else
	return false
}

//Function to highlight form element
function highlight(e){
	eventobj=ns6? e.target : event.srcElement
	if (previous!=''){
		if (checkel(previous))
		previous.style.backgroundColor=''
		previous=eventobj
		if (checkel(eventobj))
		eventobj.style.backgroundColor=highlightcolor
	}
	else{
		if (checkel(eventobj))
		eventobj.style.backgroundColor=highlightcolor
		previous=eventobj
	}
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		checkmail_01_over = newImage("/images/checkmail_01-over.jpg");
		preloadFlag = true;
	}
}

function confirmation()
{
	input_box=alert("Your message has been sent!");
}

function setFocus() { document.form1.user.focus() }
