var newwin;

function wait(){
setTimeout("document.body.disabled=true;",100);
window.showModelessDialog('/wait.htm','pick', 'dialogWidth=305px; dialogHeight=117px; center=yes; resizable=no; scroll=no; status=no; help=no; edge=raised;');
}

function modalwindow(url,width,height,control)
{		
    document.body.disabled=true;
	var r=window.showModalDialog('/modal.aspx?ur='+url,'modal', 'dialogWidth='+width+'px; dialogHeight='+height+'px; center=yes; resizable=yes; scroll=yes; status=no; help=no; ');
	document.body.disabled=false;
	if(r==undefined)r='';
	if(r!=''){
	    if(control!=null)control.value=r;
	    return true;
	}else{
	     return false;
	}
}

function modalwindowWreviever(url,width,height,command_)
{		
    document.body.disabled=true;
	var r=window.showModalDialog('/modal.aspx?ur='+url,'modal', 'dialogWidth='+width+'px; dialogHeight='+height+'px; center=yes; resizable=yes; scroll=yes; status=no; help=no; ');
	document.body.disabled=false;
	if(r==undefined)r='';
	if(r!=''){
	    eval(command_);
	    return false;
	}
}


function popupwindow(url,width,height)
{
    var top;
    top=Math.round((self.screen.availHeight-height)/2);
    var left;
    left=Math.round((self.screen.availWidth-width)/2);
	newwin=window.open(url,
		'', 'left='+left+',top='+top+',WIDTH='+width+',HEIGHT='+height+',RESIZABLE=no,SCROLLBARS=yes,STATUS=0');
	if (newwin != null)
	{
		if (newwin.opener == null)newwin.opener = self;
	}
	modal=true;
	newwin.focus();
}

function _getScroll(div, bm){
		bm.value=div.scrollTop;
	}
	
function _setScroll(div,bm){
	div.scrollTop=bm.value;
	}

//grid select
var selRow;
selRow='regatas_ctl02';
function selecc(r){
if(selRow!=null)eval(selRow).style.backgroundColor='';
selRow=r;
eval(selRow).style.backgroundColor='#000000';//selected
}

function hoveron(r){
var rr;
rr=document.getElementById(r);
if(r!=selRow)rr.style.backgroundColor='#FFCC00';//hover
}
function hoveroff(r){
var rr;
rr=document.getElementById(r);
if(r!=selRow)rr.style.backgroundColor='';
}

function pup(url,width,height){
var top, left;
top=Math.round((self.screen.availHeight-height)/2);
left=Math.round((self.screen.availWidth-width)/2);
var rand;
rand=Math.round(Math.random()*100);
var win=window.open(url,'win'+rand,'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+width+',height='+height+',top='+top+',left='+left);
win.blur();
win.focus();
}

function oneclick(){
if (typeof(Page_ClientValidate)   ==   'function')   
if(Page_ClientValidate()) {
document.getElementById('protect').style.display='';
return true;
//return   confirm('Are   you   sure   to   submit   ?');
}
else {alert('Please check all tabs for required fields to complete before submitting.');return false;}
}