function setSize(){
	if(document.getElementById("ctl00_main").offsetHeight<500){
		document.getElementById("ctl00_main").style.height = "500px";
		document.getElementById("content").style.height = "200px";
	}
}

function repositionDiv(){
    var obj = document.getElementById('ctl00_updateProgress');
    obj.style.top = (document.documentElement.scrollTop/1) + 'px';
    obj.style.left = getWidth(document.body) + 'px';
}
function setEvents(){
    if(document.all){
        document.getElementById('ctl00_updateProgress').style.position='absolute';
        window.onscroll=repositionDiv;
        window.onresize=repositionDiv;
    }
}
function getWidth(someObject){
    var w;
    if (someObject.style.width){
        w=someObject.style.width;
    }else if(someObject.style.pixelWidth){
        w=someObject.style.pixelWidth;
    }else if(someObject.offsetWidth){
        w=someObject.offsetWidth;
    }else if(document.defaultView && document.defaultView.getComputedStyle) {
        w=document.defaultView.getComputedStyle(someObject ,'').getPropertyValue('width');
    }
    if(typeof w=="string") w=parseInt(w);
    return w;
}

//---------------------------------------------------------------------------------------------
//Verifica se é email
// onblur="emailTest(this);"
function emailTest(pStr){
	reg=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
	if (!reg.test(pStr) ){
		//alert('Endereço de Email inválido')
		//obj.focus()
		return false;
	}else{
		return true;
	}
}
//---------------------------------------------------------------------------------------------
// Verifica se é numérico
function isNumeric(pStr){
	var reFloat = /^[+-]?((\d+|\d{1,3}(\.\d{3})+)(\,\d*)?|\,\d+)$/;
	if (reFloat.test(pStr)){
		return true;
	}else{
		return false;
	}
}
//---------------------------------------------------------------------------------------------
//Verifica se eh data
function isDate(pStr){
	//var reDate = /^((0?[1-9]|[12]\d)\/(0?[1-9]|1[0-2])|30\/(0?[13-9]|1[0-2])|31\/(0?[13578]|1[02]))\/(19|20)?\d{2}$/;
	var reDate = /^((0?[1-9]|[12]\d)\/(0?[1-9]|1[0-2])|30\/(0?[13-9]|1[0-2])|31\/(0?[13578]|1[02]))\/(19|20)?\d{2}$/;
	if (reDate.test(pStr)){
		return true;
	}else{
		return false;
	}
}

function wOpen(pURL,pName,w,h,scroll){
	xLeft=(screen.width)?(screen.width-w)/2:0;
	xTop=(screen.height)?(screen.height-h)/2:0;
	xSettings = 'statusbar=no,height='+h+',width='+w+',top='+xTop+',left='+xLeft+',scrollbars='+scroll+',resizable'
	wcomments = window.open(pURL,pName,xSettings);
	if(wcomments.window.focus){wcomments.window.focus();}      
	wLoaded = true;
}

function calendario(){
	wOpen("","wcomments",800,600,"yes");
	wcomments.document.write("<html><head><title>Calendário</title></head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0><center><img src='images/calendario.jpg'></center></body></html>");
	wcomments.document.close();
}
//----------------------------------------------------------------------------------------------
function OpenJnlDialog(sPage,iWidth,iHeight){
	if (window.showModalDialog)
		window.showModalDialog(sPage, window, "dialogWidth:" + iWidth + "px;dialogHeight:" + iHeight + "px; status:no; help:no; resizable:yes; scroll:no");
	else
		window.open(sPage,"Dialog", "height=" + iHeight + ",width=" + iWidth + ",toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=yes,modal=yes");
}
//----------------------------------------------------------------------------------------------

window.onload = function(){
	setSize();
}