var highlightcolor="#FFFFFF"

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 getFocus(){
	Login_Form.username.focus();
}

function showFulltaskVersion(version){
	try{
		verionID.innerHTML = version
	}catch(E){}
}

function hideFulltaskVersion(VName){
	try{
		verionID.innerHTML = VName
	}catch(E){}
}

function setCookie(NameOfCookie, value, expiredays) 
{
        var ExpireDate = new Date(); 
        ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000)); 

        document.cookie = NameOfCookie + "=" + escape(value) + 
                ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString()); 
} 
