function ModalBoxClose(redirect_url) {
	location.href = redirect_url;
}

function ModalBoxOpen() {
	tb_show("Contractor Login","Login.asp?t=contract?height=250&width=290&TB_iframe=1");	
}


function DoSearch() {
	var val = document.getElementById("searchtext").value;
	if(trim11(val) != "") 
	{
		var text = URL.encode(trim11(val))
		window.location.href = "UASearch.asp?search=" + text;
	}
}

function trim11 (str) {
	str = str.replace(/^\s+/, '');
	for (var i = str.length - 1; i >= 0; i--) {
		if (/\S/.test(str.charAt(i))) {
			str = str.substring(0, i + 1);
			break;
		}
	}
	return str;
}

function PreselectMyItem(itemToSelect, myDropdownList)
  {   
    // Loop through all the items
    for (iLoop = 0; iLoop< myDropdownList.options.length; iLoop++)
    {    
      if (myDropdownList.options[iLoop].value == itemToSelect)
      {
        // Item is found. Set its selected property, and exit the loop
        myDropdownList.options[iLoop].selected = true;
        break;
      }
    }  
}
