// ----------------------------------------------------------------------
// Detect DOM capabilities and set global DOM variables
// ----------------------------------------------------------------------

var isNS4 = false;
var isIE4 = false;
var isW3C = false;
var displayNav = "";
var toggle = false;
	
if (document.layers) {  // NS 4 proprietary DOM
	isNS4 = true;
	docObj = "document.";
	styleObj = "";
	valueObj = "";
	}
else if (document.all && !document.getElementById) { // IE 4 proprietary DOM
	isIE4 = true;
	docObj = "document.all.";
	styleObj = ".style";
	valueObj = "').value";
	}
else if (document.getElementById && document.all) { // W3C standards-compliant DOM
	isW3C = true;
	docObj = "document.getElementById('";
	styleObj = "').style";
	valueObj = "').value";
	}
else if (document.getElementById) { // W3C standards-compliant DOM
	isW3C = true;
	docObj = "document.getElementById('";
	styleObj = "').style";
	valueObj = "').value";
	}


function SubmitSearch()
{ 
   var searchtext = eval(docObj + "txtSearch" + valueObj);
   if (searchtext != "")
   {
    //   var url = "http://192.168.1.228/search?q=" + searchtext + "&output=xml_no_dtd&client=idsociety&proxystylesheet=idsociety";
       var url = "http://" + document.location.hostname + "/search.aspx?q=" + searchtext;
    //   alert(url);
       window.location.href = url;
    }
}


function SubmitSearchUC(searchbox)
{ 

var searchtextbox = searchbox.id;
   searchtextbox = docObj + searchtextbox.replace(/_goimage/,"_txtSearch") + valueObj
   
   var searchtext = eval(searchtextbox);
//   var url = "http://192.168.1.228/search?q=" + searchtext + "&output=xml_no_dtd&client=idsociety&proxystylesheet=idsociety";

   if (searchtext != "")
   {
       var url = "http://" + document.location.hostname + "/GlobalHealthSearch.aspx?q=" + searchtext;
    //   alert(url);
       window.location.href = url;
   }
}

function PopUpEditor() 
{
    var x = eval(docObj + "FolderSelection')");
    var item = x.options[x.selectedIndex].value;
    if (item != "")
    {
        EkTbWebMenuPopUpWindow('WorkArea/editarea.aspx?LangType=1033&amp;id=' + item + '&amp;type=add&pullapproval=', 'Add',780,500, 1, 1);
    }
    else
    {
        alert("Please select a folder from the list.");
    }
    return false;
}

