function $(id){
	return document.getElementById(id);
}

function Jid(id){
	return document.getElementById(id);
}

function MouseOverBarTop(obj){
  //obj.className = 'bgBarra2';
}

function MouseOutBarTop(obj){
  //obj.className = 'bgBarra1';	
}

function fcs1(obj){
  if(obj.value == obj.title){
    obj.value = '';
  }
}

function blr1(obj){
  if(obj.value == ''){
    obj.value = obj.title;
  }
}

function toLink(url){
  document.location.href = url;
  //alert(url);
  return false;
}

function IMGpre(){
  var d=document;if(d.images){if(!d.MM_p) d.IMG_p=new Array();
    var i,j=d.IMG_p.length,a=IMGpre.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.IMG_p[j]=new Image; d.IMG_p[j++].src=a[i];}}
}

function Confirmar(txt){
  txt = txt.replace('<br>', '\n');
  var conf = confirm(txt);
  if(conf){
    return true;
  }else{
	return false;
  }
}

//************************* E-MAIL CHECK
function echeck(str) {
var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)

  if (str.indexOf(at)==-1) return false
  if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr) return false
  if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr) return false
  if (str.indexOf(at,(lat+1))!=-1) return false
  if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot) return false
  if (str.indexOf(dot,(lat+2))==-1) return false
  if (str.indexOf(" ")!=-1) return false

  return true					
}

//************************* SWF PLAYER
function pswf(movie, largura, altura, id, params, write){
  if(params == undefined){ params = ''; }
  if(write == undefined){ write = true; }
  HTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+largura+'"height="'+altura+'" id="'+id+'"><param name="FlashVars" value="'+params+'"/><param name="movie"value="'+movie+'"/><param name="scale"value="noScale"/><param name="quality"value="high"/><param name="wmode"value="transparent"/><embed src="'+movie+'?'+params+'"quality="high"pluginspage="http://www.macromedia.com/go/getflashplayer"type="application/x-shockwave-flash"width="'+largura+'"height="'+altura+'"swLiveConnect="true"name="'+id+'"wmode="transparent"scale="noScale"></embed></object>'
  
  if(write==true){
    document.write(HTML);
  }else{
    return HTML;	
  }
  
}

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

function setCheckedValue(radioObj, newValue){
	if(!radioObj)
		return;
	var radioLength = radioObj.length;
	if(radioLength == undefined) {
		radioObj.checked = (radioObj.value == newValue.toString());
		return;
	}
	for(var i = 0; i < radioLength; i++) {
		radioObj[i].checked = false;
		if(radioObj[i].value == newValue.toString()) {
			radioObj[i].checked = true;
		}
	}
}

function WindowSize(){
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ){
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }

  return {width:myWidth, height:myHeight};
}

function DocSize() {
  var scrOfX = 0, scrOfY = 0;
  scrW = document.body.scrollWidth;
  scrH = document.body.scrollHeight;
  
  //
  
  return {width:scrW, height:scrH};
}
