// Fixes onload behavior of .Net2 ValidationSummary control
function ValidationSummaryOnLoad()
{
   if (typeof(Page_ValidationSummaries) != "undefined") {
       var i, summary;
       for (i = 0; i < Page_ValidationSummaries.length; i++) {
           summary = Page_ValidationSummaries[i];
           if (summary.showmessagebox == "True") {
               var s = (typeof(summary.innerText) == "undefined") ? summary.innerHTML : summary.innerText;
               if (s.length > 0)
               {
                   var r = s.match(/^\s*$/g);
                   if (r == null || r[0] == undefined && r[0].length != s.length)
                        alert(s);
               }
           }
       }	
    }
}
// Opens a window
function OpenWindowEX(url, w, h, resizable)
{
	if (resizable == undefined || resizable == false)
		resizable = "no";
	else
		resizable = "yes";

	var s = new String("width=" + w + ",height=" + h + ",resizable=" + resizable + ",scrollbars=yes");
	window.open(url, "popup", s);
}

// Switch the rowcolor of an element
function SetRC(obj, mouseOver)
{
    if (mouseOver)
	    obj.style.backgroundColor='#EEEEEE';
	else
	    obj.style.backgroundColor='';
}

var lastOpen;

// Switch the rowcolor of an element
function ToggleDiv(objname)
{
    var obj = window.document.getElementById(objname);
    
    if(obj.style.display == '')
    {
        obj.style.display = 'none';
    }
    else
    {
        if(lastOpen != undefined)
            lastOpen.style.display = 'none';   
        
        obj.style.display = '';    
        lastOpen = obj;
    }
    
}



