var hide  = true;
var listPos = new Array();


//--Hover Image Functions by Fireworks...
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

///--End of Fireworks functions...

//  Object Show hide methods ==================

function setDisplay(objid, disptype){
	//alert("What "+ MM_findObj(objid));
	MM_findObj(objid).style.display = disptype;
}

//============================================
function showhide(obj)
{
	var x = document.getElementById('testP');
	hide = !hide;
	x.style.visibility = (hide) ? 'hidden' : 'visible';
	setLyr(obj,'testP');
}

function setLyr(obj,lyr)
{
	var coors = findPos(obj);
	if (lyr == 'testP') coors[1] -= 50;
	var x = document.getElementById(lyr);
	x.style.top = coors[1] + 'px';
	x.style.left = coors[0] + 'px';
}

function findPos(obj)
{
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function showList(obj,lyr, txt, listofvalues, listwidth, funcname)
{
	var listLayer = document.getElementById(lyr);
	var coors = findPos(obj);	
	var innerHTMLContent="";
	var txtobj = document.getElementById(txt);
	
	listLayer.style.visibility = "hidden";
	
	innerHTMLContent = "<table border=0 width=100% cellpadding='0' cellspacing='0'>";
	
	for(i=0; i<listofvalues.length; i++){
		innerHTMLContent = innerHTMLContent + "<tr>";	
			value = listofvalues[i];
			innerHTMLContent = innerHTMLContent + "<td onmouseover=\"this.className=\'mouseover\';\" onmouseout=\"this.className='';\" onclick=\" document.getElementById(\'"+txt+"\').value='"+value+"';  "+funcname+"('"+value+"');\">";
			innerHTMLContent = innerHTMLContent + listofvalues[i]+"</td>";
		innerHTMLContent = innerHTMLContent + "</tr>";				
	}

	innerHTMLContent = innerHTMLContent + "</table>";	
	
	listLayer.innerHTML = innerHTMLContent;

	listLayer.style.width = listwidth;
	listLayer.style.top = coors[1] + 20 + 'px';
	listLayer.style.left = (coors[0] - listwidth + 20)+ 'px';

	listLayer.style.visibility = "visible";
}


// ====================== Tooltip =========================
	function showTooltip(obj){
		//document.getElementById(obj).style.display = "inline";
	}
	function hideTooltip(obj){
		//document.getElementById(obj).style.display = "none";
	}
//onmouseover="setDisplay('tooltipitemalert','inline');" onmouseout="setDisplay('tooltipitemalert','none');"
	function prepareInputsForHints() {
		var inputs = document.getElementsByTagName("input");
		  for (var i=0; i<inputs.length; i++){
			inputs[i].onmouseover= function () {
							//this.parentNode.getElementsByTagName("span")[i].style.display = "inline";				

				// detect if there is a tooltip
				for(i=0; i< this.parentNode.getElementsByTagName("span").length; i++){
					if(this.parentNode.getElementsByTagName("span")[i].className=='tooltip')
						this.parentNode.getElementsByTagName("span")[i].style.display = "inline";
				}
			}
			inputs[i].onmouseout = function () {
			  				//this.parentNode.getElementsByTagName("span")[0].style.display = "none";

				// detect if there is a tooltip
				for(i=0; i< this.parentNode.getElementsByTagName("span").length; i++){
					if(this.parentNode.getElementsByTagName("span")[i].className=='tooltip')
						this.parentNode.getElementsByTagName("span")[i].style.display = "none";
				}
							
			}
			
			inputs[i].onfocus = function () {
							//this.parentNode.getElementsByTagName("span")[i].style.display = "inline";				

				// detect if there is a tooltip
				for(i=0; i< this.parentNode.getElementsByTagName("span").length; i++){
					if(this.parentNode.getElementsByTagName("span")[i].className=='tooltip')
						this.parentNode.getElementsByTagName("span")[i].style.display = "inline";
				}
			}
			inputs[i].onblur = function () {
			  				//this.parentNode.getElementsByTagName("span")[0].style.display = "none";

				// detect if there is a tooltip
				for(i=0; i< this.parentNode.getElementsByTagName("span").length; i++){
					if(this.parentNode.getElementsByTagName("span")[i].className=='tooltip')
						this.parentNode.getElementsByTagName("span")[i].style.display = "none";
				}
							
			}
		  }
/*	
		var selects = document.getElementsByTagName("select");
		  for (var k=0; k<selects.length; k++){
			selects[i].onmouseover= function () {
							//this.parentNode.getElementsByTagName("span")[i].style.display = "inline";				

				// detect if there is a tooltip
				for(i=0; i< this.parentNode.getElementsByTagName("span").length; i++){
					if(this.parentNode.getElementsByTagName("span")[i].className=='tooltip')
						this.parentNode.getElementsByTagName("span")[i].style.display = "inline";
				}
			}
			selects[i].onmouseout = function () {
			  				//this.parentNode.getElementsByTagName("span")[0].style.display = "none";

				// detect if there is a tooltip
				for(i=0; i< this.parentNode.getElementsByTagName("span").length; i++){
					if(this.parentNode.getElementsByTagName("span")[i].className=='tooltip')
						this.parentNode.getElementsByTagName("span")[i].style.display = "none";
				}
							
			}
			  
			selects[i].onfocus = function () {
							//this.parentNode.getElementsByTagName("span")[i].style.display = "inline";				

				// detect if there is a tooltip
				for(i=0; i< this.parentNode.getElementsByTagName("span").length; i++){
					if(this.parentNode.getElementsByTagName("span")[i].className=='tooltip')
						this.parentNode.getElementsByTagName("span")[i].style.display = "inline";
				}
			}
			selects[i].onblur = function () {
			  				//this.parentNode.getElementsByTagName("span")[0].style.display = "none";

				// detect if there is a tooltip
				for(i=0; i< this.parentNode.getElementsByTagName("span").length; i++){
					if(this.parentNode.getElementsByTagName("span")[i].className=='tooltip')
						this.parentNode.getElementsByTagName("span")[i].style.display = "none";
				}
							
			}
		  }*/
	}

	
//document.onmousedown=selectmouse;
//document.onmouseup=new Function("document.getElementById('testlayer').style.visibility='hidden';");