

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 ClearTextBox(obj)
{
    obj.value = "";
}

function ResetTextBox(obj, text)
{
    if(obj.value == "")
    {
        obj.value = text;
    }
}




//Added on apr 28, 2008
function searchreset(searchterm, searchfieldid)
{
    var obj = MM_findObj(searchfieldid);
    if ((obj.value == '') || (obj.value == null))
    {
        obj.value = searchterm;
    }       
}

function searchclear(searchterm, searchfieldid)
{
    var obj = MM_findObj(searchfieldid);
    if (obj.value == searchterm)
    {
        obj.value = '';
    }       
}
        
        
        
            
function trapEnter_IE()
{
if(window.event.keyCode==13)
    {
    return false;
    }
} 


function trapEnter_FF()
{
    var browserName=navigator.appName;
    if (browserName != 'Microsoft Internet Explorer')
    {
        document.onkeypress = function (evt) 
        {

            if(evt.keyCode == 13)
            { 
                return false; 
            }
            else
            {
                return evt.keyCode;
            }
 
        } 
    }
}



function VSM_SearchText(e,url)
{
 
    if (e.keyCode==13)
    {

        var SearchTextElement = document.getElementById('search-box');
        VSM_Search(SearchTextElement.id,url); 
    }
}

function VSM_Search(objName,url)
{
  var obj = MM_findObj(objName);
  if (obj != null)
  {
    var searchUrlParameter =  url + '?st='+ escape(obj.value); 
    self.location.href =searchUrlParameter;
    window.event.returnValue = false;
  }
}
 
	


/*************************************************************
 * Window Onload Manager (WOM) v1.0
 * Author: Justin Barlow - www.netlobo.com
 *
 * Description:
 * The WOM library of functions allows you to easily call
 * multiple javascript functions when your page loads.
 *
 * Usage:
 * Add functions to WOM using the womAdd() function. Pass the
 * name of your functions (with or without parameters) into
 * womAdd(). Then call womOn() like this:
 *     womAdd('hideDiv()');
 *     womAdd('changeBg("menuopts","#CCCCCC")');
 *     womOn();
 * WOM will now run when your page loads and run all of the
 * functions you have added using womAdd()
 *************************************************************/

/*************************************************************
 * The womOn() function will set the window.onload function to
 * be womGo() which will run all of your window.onload
 * functions.
 *************************************************************/
function womOn(){
	window.onload = womGo;
}

/*************************************************************
 * The womGo() function loops through the woms array and
 * runs each function in the array.
 *************************************************************/
function womGo(){
	for(var i = 0;i < woms.length;i++)
		eval(woms[i]);
}

/*************************************************************
 * The womAdd() function will add another function to the woms
 * array to be run when the page loads.
 *************************************************************/
function womAdd(func){
	woms[woms.length] = func;
}

/*************************************************************
 * The woms array holds all of the functions you wish to run
 * when the page loads.
 *************************************************************/
var woms = new Array();

