function startclock()
{
var thetime=new Date();

var nhours=thetime.getHours();
var nmins=thetime.getMinutes();
var nsecn=thetime.getSeconds();
var AorP=" ";

if (nhours>=12)
    AorP="P.M.";
else
    AorP="A.M.";

if (nhours>=13)
    nhours-=12;

if (nhours==0)
 nhours=12;

if (nsecn<10)
 nsecn="0"+nsecn;

if (nmins<10)
 nmins="0"+nmins;
var theclock = document.getElementById('theclock');
theclock.innerHTML=nhours+":"+nmins+":"+nsecn+" "+AorP;

setTimeout('startclock()',1000);
} 
function DoLogout()
{
	document.location = "../logout.aspx";
}
function showdate()
{
    var thisdate = new Date();
    var thedate = document.getElementById('thedate');
    var themonth = thisdate.getMonth() + 1;
    var theday = thisdate.getDate();
    var theyear = thisdate.getFullYear().toString();
    thedate.innerHTML = themonth + "/" + theday + "/" + theyear.substring(2,4);        
}
function sm(id)
{
    //window.status = "sm";
   	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';		
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}
function hm(id)
{
    //window.status = "hm";
  	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}
function setDivHide(id,btnId,show,hide)
{
    var img = document.getElementById(btnId);
   	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		if(document.getElementById(id).style.display=='none')
		{
		    sm(id);
		    img.src = hide;
		}
		else
		{
		    hm(id);
		    img.src = show;
		}
	}
	else {
		if (document.layers) {
		     // Netscape 4
			if(document.id.display == 'none')
			{
			    sm(id);
			    img.src = hide;
		    }
		    else
		    {
		        hm(id);
		        img.src = show;
		    }			
		}
		else { // IE 4
			if(document.all.id.style.display == 'none')
			{
			    sm(id);
			    img.src = hide;
		    }
		    else
		    {
		        hm(id);
		        img.src = show;
		    }
		}
	}
}
function setDivHidden(id,btnId,show,hide)
{
    var img = document.getElementById(btnId);
   	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		if(document.getElementById(id).style.display=='none')
		{
		}
		else
		{
		    hm(id);
		    img.src = show;
		}
	}
	else {
		if (document.layers) {
		     // Netscape 4
			if(document.id.display == 'none')
			{
		    }
		    else
		    {
		        hm(id);
		        img.src = show;
		    }			
		}
		else { // IE 4
			if(document.all.id.style.display == 'none')
			{
		    }
		    else
		    {
		        hm(id);
		        img.src = show;
		    }
		}
	}
}
function setDivVisible(id,btnId,show,hide)
{
    var img = document.getElementById(btnId);
   	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		if(document.getElementById(id).style.display=='none')
		{
		    sm(id);
		    img.src = hide;
		}
		else
		{
		}
	}
	else {
		if (document.layers) {
		     // Netscape 4
			if(document.id.display == 'none')
			{
			    sm(id);
			    img.src = hide;
		    }
		    else
		    {
		    }			
		}
		else { // IE 4
			if(document.all.id.style.display == 'none')
			{
			    sm(id);
			    img.src = hide;
		    }
		    else
		    {
		    }
		}
	}
}
function setImageSrc(id,source)
{
    var img = document.getElementById(id);
   	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		img.src = source;
	}
	else {
		if (document.layers) {
		     // Netscape 4
		    img.src = source;		
		}
		else { // IE 4
		    img.src = source;
		}
	}
}
function setDivInner(id,text1,text2)
{
    if(document.getElementById)
    {
        if(document.getElementById(id).innerHTML==text1)
        {
            document.getElementById(id).innerHTML = text2;
        }
        else
        {
            document.getElementById(id).innerHTML = text1;
        }
    }
}
function Border(id)
{
    if(document.getElementById)
    {
        if(document.getElementById(id) != null)
        {
            document.getElementById(id).className = "hightlightTable";
        }
    }
}
function UnBorder(id)
{
    if(document.getElementById)
    {
        if(document.getElementById(id) != null)
        {
            document.getElementById(id).className = "";
        }
    }
}
function setInputValue(id,text1,text2)
{
    if(document.getElementById)
    {
        if(document.getElementById(id).value == text1)
        {
            document.getElementById(id).value = text2;
        }
        else
        {
            document.getElementById(id).value = text1;
        }
    }
}
function setDivHide_old(menuid)
{
     var id1="divLeftContent";
     var id2="divMainContent";
     var id3="divRightContent";
  	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
	    
		//document.getElementById(id1).onmouseover = new Function("hm('" + menuid + "');");
		document.getElementById(id2).onmouseover = new Function("hm('" + menuid + "');");
		document.getElementById(id3).onmouseover = new Function("hm('" + menuid + "');");
		//new Function("Flyover('My text here');");

	}
	else {
		if (document.layers) { // Netscape 4
			//document.id1.onmouseover = new Function("hm('" + menuid + "');");
			document.id2.onmouseover = new Function("hm('" + menuid + "');");
			document.id3.onmouseover = new Function("hm('" + menuid + "');");
		}
		else { // IE 4
			//document.all.id1.style.onmouseover = new Function("hm('" + menuid + "');");
			document.all.id2.style.onmouseover = new Function("hm('" + menuid + "');");
			document.all.id3.style.onmouseover = new Function("hm('" + menuid + "');");
		}
	}
}
function showFavoritesAdd2(id)
{//divFavoriteAdd
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';	
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';			
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}
function hideFavoritesAdd2(id)
{//divFavoriteAdd
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';	
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';			
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}
function showFavoritesAdd(id,id2)
{
    showFavoritesAdd2(id);
    showFavoritesAdd2(id2);
}
function hideFavoritesAdd(id,id2)
{
    hideFavoritesAdd2(id);
    hideFavoritesAdd2(id2);
}
function calculateTotal(field1, field2, totalField)
{
    if(document.getElementById)
    {
        var f1 = document.getElementById(field1);
        var f2 = document.getElementById(field2);
        var ft = document.getElementById(totalField);
        if(f1.value != '' && f2.value != '')
        {
            ft.innerHTML = parseFloat(f1.value.replace("$","")) * parseFloat(f2.value.replace("$",""));
            ft.innerHTML = "$" + ft.innerHTML;
        }
    }
}
function multiplyFields(field1, field2, totalField)
{
    if(document.getElementById)
    {
        var f1 = document.getElementById(field1);
        var f2 = document.getElementById(field2);
        var ft = document.getElementById(totalField);
        if(f1.value != '' && f2.value != '')
        {
            ft.innerHTML = parseFloat(f1.value.replace("$","")) * parseFloat(f2.value.replace("$",""));
            ft.innerHTML = "$" + ft.innerHTML;
        }
    }
} 
function doClear(theText) 
{
    if (theText.value == theText.defaultValue)
    {
        theText.value = ""
    }
}