function PopupWindow(url,width,height,windowName)
{
	_PopupWindow(url,width,height,150,windowName);
}

function popup(url,width,height,windowName)
{
	_PopupWindow(url, 510, height,150,windowName);
}

function _PopupWindow(url,width,height,top,windowName)
{
	var center_x = (screen.width - width)/2;
	var center_y = (screen.height - height)/2;	
//    var num = Math.round(Math.random()*10000000);
//    var str = new String(num);
    var win = window.open(url,windowName,"toolbar=no,location=no,directories=no,"+
      "status=no,menubar=no,scrollbars=yes,resizable=no,"+
      "copyhistory=no,left="+center_x+",top="+center_y+",width="+width+",height="+height);
}

function getPageElement(id)
{
//"NN4";
    if(document.layers)
    {
		return document.layers[id];
    }
//"ie"    
    if(document.all)
    {
		return document.all[id];
    }
//"NN6";    
    if(!document.all && document.getElementById)
    {
		return document.getElementById(id);
    }
    
    return false;
}


function checkSearchForm(form)
{
	return checkInput(form["search-clause"],"Please enter what you are looking for");
}

function toggleAll(sender, input)
{
	if (!input || !sender)
  		return false;
  		
  	if (sender.checked)
  	{
  		for (var i = 0; i < input.length; i++)
  		{
  			input[i].checked = true;
  		}
  	}
  	else
  	{
	  	for (var i = 0; i < input.length; i++)
  		{
  			input[i].checked = false;
  		}
  	}
  	return true;
}