/* Code by PHPPat @ www.php-tools.net & W-agora @ www.w-agora.com*/

var displaystates = new Array();
function toggleMenu( nr )
{
  var d  = document.getElementById( "details"+nr );
   if( displaystates[nr] == "open" )
  {
    d.style.display  = "none";
    displaystates[nr] = "closed";
  }
  else if( displaystates[nr] == "closed" )
  {
    d.style.display  = "block";
    displaystates[nr] = "open";
  }
  else
  {
    d.style.display  = "block";
    displaystates[nr] = "open";
  }
window.focus(); 
}

var newWindow = null;
    function OpenWindow (Url,Title,Width,Height) {
    var win_opt= 'toolbar=0,location=0,directories=0,status=0,menubar=0,';
    win_opt += 'scrollbars=1,resizable=1,copyhistory=0,';
    win_opt += 'width=' + Width + ',height=' + Height;
    var windowX = (screen.width/2)-(Width/2);
    var windowY = (screen.height/2)-(Height/2); 
    window.name = 'MainWindow';    
    newWindow = window.open('',Title,win_opt);
     if (newWindow != null) {
     if (newWindow.opener == null)
     newWindow.opener = self;
     newWindow.location.href = Url;
     newWindow.moveTo(windowX,windowY);     
     if (newWindow.focus) newWindow.focus();
  }
}

function isReady() {
	var _ret=false;
	if (validate_form())
	  _ret=true;
	else
	  _ret=false;
	if(_ret)
	  if(counter++)
	  {
	    _ret=false;
	    alert('The Form Is Already Being Submitted'); 
	  }
	  else
	    _ret=true;
	alert(_ret);
	return _ret; 
} 
