// common.js

function changeCSSClass(id, newClass) {
	identity=document.getElementById(id);
	identity.className=newClass;
}

function toggleLayer(tid)
{
  if(document.getElementById(tid).style.display == "none") {
	 document.getElementById(tid).style.display = "";
 }
  else {
   document.getElementById(tid).style.display = "none";
  }
}

function showLayer(tid)
{
	document.getElementById(tid).style.display = "";
}

function hideLayer(tid)
{
	document.getElementById(tid).style.display = "none";
}

function highlight(tdID,evt)	{
	switch (evt)	{
		case "mouseover": 
			tdID.bgColor = '#e0e0e0';
			
		break;
		
		case "mouseout":
			tdID.bgColor = '#FFFFFF';
			
		break;
		}
	}
	
function customPromptBox(promptpicture, prompttitle, message, sendto) { 
		promptbox = document.createElement('div'); 
		promptbox.setAttribute ('id' , 'prompt') 
		document.getElementsByTagName('body')[0].appendChild(promptbox) 
		promptbox = eval("document.getElementById('prompt').style") 
		promptbox.position = 'absolute' 
		promptbox.top = 25 
		promptbox.left = 200 
		promptbox.width = 400 
		promptbox.border = 'outset 1 #bbbbbb' 
		document.getElementById('prompt').innerHTML = "<table cellspacing='0' cellpadding='0' border='0' width='100%'><tr valign='middle'><td width='22' height='22' style='text-indent:2;' class='titlebar'><img src='" + promptpicture + "' height='18' width='18'></td><td class='titlebar'>" + prompttitle + "</td></tr></table>" 
		document.getElementById('prompt').innerHTML = document.getElementById('prompt').innerHTML + "<table cellspacing='0' cellpadding='0' border='0' width='100%' class='promptbox'><tr><td>" + message + "</td></tr><tr><td><input type='text' id='promptbox' onblur='this.focus()' class='promptbox'></td></tr><tr><td align='right'><br><input type='button' class='prompt' value='OK' onMouseOver='this.style.border=\"1 outset #dddddd\"' onMouseOut='this.style.border=\"1 solid transparent\"' onClick='" + sendto + "(document.getElementById(\"promptbox\").value); document.getElementsByTagName(\"body\")[0].removeChild(document.getElementById(\"prompt\"))'> <input type='button' class='prompt' value='Cancel' onMouseOver='this.style.border=\"1 outset transparent\"' onMouseOut='this.style.border=\"1 solid transparent\"' onClick='" + sendto + "(\"\"); document.getElementsByTagName(\"body\")[0].removeChild(document.getElementById(\"prompt\"))'></td></tr></table>" 
		document.getElementById("promptbox").focus() 
} 	

//The first line assigns the MatchIgnoreCase function as an equalsIgnoreCase method of the String object

String.prototype.equalsIgnoreCase=MatchIgnoreCase;

function MatchIgnoreCase(strTerm){
var strToSearch = this.toLowerCase();
strTerm = strTerm.toLowerCase();
if(strToSearch==strTerm){
return true;
}else
{
return false;
}
} //End Function


