////*************************************************************************************************************
//Program Name : Accessories.js
//Description  : Additional JS functions
//Company Name : Element K Middle East
//Developer    : Toji Abraham Mathew
//Date Created : 30 August 2006
//Revised On   : 
//*************************************************************************************************************


//used to trim spaces from both sides of a string value.
//strVal parameter is the string which we need to trim.
function trim(strVal) 
{
    //does left trim
    while (strVal.substring(0,1) == ' ')
    {
        strVal = strVal.substring(1, strVal.length);
    }
    //does right trim
    while (strVal.substring(strVal.length-1, strVal.length) == ' ')
    {
        strVal = strVal.substring(0,strVal.length-1);
    }
    return strVal;
}


//This function gives us all the client informations about a control.
//thisId is the id of the control of which we shouold get the information.
//for better use display the informations to a alert box or textarea control.
//eg: document.getElementById('TextArea1').value = getControlInfo(<Id_Of_Your_Control>)
function getControlInfo(thisId) 
{
    var strVal = '';
    for(cnt=0;cnt<=thisId.attributes.length-1;cnt++)
    {
       strVal += cnt + '. ' + thisId.attributes.item(cnt).name + ' = '+ thisId.attributes.item(cnt).value + '\n'
    }
    return (strVal)
}



function DrpVisTooltip ( idObject ) 
{ 		
//alert(idObject)	
	var obj = document.getElementById( idObject ); 
	//alert(obj)
	//document.getElementById("tooltip").innerHTML = obj.options[obj.selectedIndex].text;
	//document.getElementById("tooltip").innerHTML = obj.options[obj.selectedIndex].value;
	try
	{
	    window.status=obj.options[obj.selectedIndex].text ;
	}
	catch (err)
	{}
	
	/*if(obj.options[obj.selectedIndex].value !="") 
	{
		//document.getElementById("tooltip").style.zIndex = 9999999; 
 		document.getElementById("tooltip").style.zIndex = 0; 
  		document.getElementById("tooltip").style.display = "inline"; 
  		document.getElementById("tooltip").style.position = "absolute"; 
 		document.getElementById("tooltip").style.border =  "ActiveBorder  1px	solid"  ; 
		document.getElementById("tooltip").style.padding =   "3px";  
		document.getElementById("tooltip").style.fontSize =  "10px"; 
		document.getElementById("tooltip").style.fontFamily = "Verdana"; 
		document.getElementById("tooltip").style.backgroundColor = "LemonChiffon"; 
		document.getElementById("tooltip").style.top = document.getElementById(idObject).style.top + 250
		document.getElementById(idObject).offsetTop + document.getElementById(idObject).offsetHeight + "px";   
		document.getElementById("tooltip").style.left =	5 + event.x;
	}*/      
} 

function DrpHidTooltip ( )
{ 
  //document.getElementById("tooltip").style.display = "none"; 
  window.status = '';
}
