function OpenWindow(URL,W,H){
	if (!window.win2||win2.closed)
             win2=window.open(URL,"","left=100,top=100,width="+W+",height="+H+",resizable=no,scrollbars=no,status=no,location=no,menubar=no,titlebar=no")
         else{
             win2.location=URL
             win2.focus()
            }
  }
function OpenDialog(URL,W,H) {
    if (window.showModalDialog) {
        var ieFeatures = "dialogHeight:"+H+"px;"
                       + "dialogWidth:"+W+"px;"
                       + "edge:none;"
                       + "help:no;"
                       + "scroll:no;"
                       + "resizable:no;"
                       + "status:no;"
                       + "unadorned:no;";
        showModalDialog(URL, window, ieFeatures);
    } else {
        var windowName = "psDialog"
        var mozillaFeatures = "width="+W+","
                            + "height="+H+","
                            + "toolbar=no,"
                            + "location=no,"
                            + "directories=no,"
                            + "status=no,"
                            + "menubar=no,"
                            + "scrollbars=no,"
                            + "resizable=no,"
                            + "modal=yes";
        window.open(url, windowName, mozillaFeatures);
    }
    return false;
}

function Redirect(URL)
{
	window.location.href=(URL);
}

function RedirectIf(URL,msg)
{
var UserResponse=confirm(msg);

if (UserResponse==true)
Redirect(URL);
}

function RedirectParent(URL)
{
destination=window.parent;
	destination.location.href=(URL);
}

function ShowHide(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"none";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"none";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"none";
}
}

function ShowHideAll(){
var ids=new Array('d1','d2');
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		ShowHide(ids[i]);
	}		  
}