
function LTrim(sToTrim) 
{
    return sToTrim.replace(/^\s+/,'');
}
function RTrim(sToTrim) 
{
    return sToTrim.replace(/\s+$/,'');
}

function NumbersOnly( e )
{
    
    //alert('Test');
    var unicode = e.charCode ? e.charCode : e.keyCode;
    
    //backspace key
    if( unicode != 8 )
    { 
       //it is not a number
       if( unicode < 48 || unicode > 57 )
       {
          
          
          return false;
       }
       else
       {
        
          return true;
       }
    }
    else
    {
       
       return true;
    }
}

function IsDigit(num) {
   if (num.length>1){return false;}
   var string="1234567890";
   if (string.indexOf(num)!=-1){return true;}
   return false;
}
function IsInteger(val){
  if (IsBlank(val)){return false;}
     for(var i=0;i<val.length;i++){
	    if(!IsDigit(val.charAt(i))){return false;}
	 }
  return true;
}

function IsBlank(val){
   if(val==null){return true;}
     for(var i=0;i<val.length;i++) {
	     if ((val.charAt(i)!=' ')&&(val.charAt(i)!="\t")&&(val.charAt(i)!="\n")&&(val.charAt(i)!="\r")){return false;}
	 }
   return true;
}
	


function addOptions(htmlSelect, ArrayText, ArrayValue) 
{
    htmlSelect.options.length = 0;
    for (var i = 0; i < ArrayText.length; ++i) 
    {
        htmlSelect.options[htmlSelect.options.length] = new Option(ArrayText[i], ArrayValue[i]);
    }
}

	
function addOption(htmlSelect, theText, theValue)
{ 
   var newOpt = new Option(theText, theValue);
   var selLength = htmlSelect.length;
   htmlSelect.options[selLength] = newOpt;
}

function deleteOption(htmlSelect, theIndex)
{ 
  var selLength = htmlSelect.length;
  if(selLength > 0)
  {
    htmlSelect.options[theIndex] = null;
  }
}

function openFloatingPanel1() {
    var floatpnl = $find('FloatingPanel1');
    if (floatpnl != null) {
        floatpnl.expand();
    }
}

//function colorChosen(sender, color)
//{

//   alert(color);
//}




