// SNS:
function doSubmit() {
	document.cookie = "cookietest=yes; path=/; domain=.aol.com.br";
	var testCookie = document.cookie;
	if (testCookie.indexOf("cookietest=yes") == -1) {
		alert('Por favor ative os cookies');
	} else {
		if(document.loginform.siteState.value == ""){
			document.loginform.siteState.value = "OrigUrl="+escape(window.location);
		}
		var sn = document.loginform.screenname.value;
		var isEmail = sn.indexOf('@');
		if (isEmail > -1) {
			makeSN= sn.substring(0,isEmail);
			document.loginform.screenname.value=makeSN;
		}
		document.forms.loginform.submit();
	}
}
// fim sns

// AOL Brasil - Constantes de deteção de Browser:
var myuseragent = navigator.userAgent.toLowerCase();
var ns7 = myuseragent.indexOf('netscape/7')>-1;
var ns6 = myuseragent.indexOf('netscape6')>-1;
var ns4 = (myuseragent.indexOf('mozilla/4')>-1 && myuseragent.indexOf('msie')==-1);
var ie = myuseragent.indexOf('msie')>-1;

// AOL Brasil - Função de espaçamento com controle fino::
function space(w,h){
 if (arguments.length==2){
  if ((ns6 || ns7) && h==1){document.write('<img name="shim" width="'+w+'" height="'+h+'" border="0">')}
  else {document.write('<table name="shim" width="'+w+'" height="'+h+'" border="0" cellspacing="0" cellpadding="0"><tr><td></td></tr></table>')}
 }
 else if (arguments.length==3){document.write('<table name="shim" width="'+w+'" height="'+h+'" border="0" cellspacing="0" cellpadding="0"><tr><td bgcolor="'+arguments[2]+'"><table width="1" height="1" border="0" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr></table>')}
}

// AOL Brasil - Função de Bullets em HTML-Javascript:
function mybullet(color1, color2,size,vspace,hspace){
 if (ns4){spc='<table border=0 width=1 border=1 cellspacing=0 cellpadding=0><tr><td></td></tr></table>'} else {spc=''}
 a='';
 a=a+'<table align="left" width="'+(size+hspace)+'" border="0" cellspacing="0" cellpadding="0">';
 a=a+'<tr><td height="'+vspace+'" width="'+(size-1)+'"></td><td width="1"></td><td rowspan="3" width="'+hspace+'"></td></tr>';
 a=a+'<tr><td bgcolor="'+color1+'" height="'+(size-1)+'">'+spc+'</td><td rowspan="2" bgcolor="'+color2+'">'+spc+'</td></tr>';
 a=a+'<tr><td bgcolor="'+color2+'" height="1">'+spc+'</td></tr></table>';
 document.write(a);
}
function mybullet2(color1, color2,size,vspace,hspace){
 if (ns4){spc='<table border=0 width=1 border=1 cellspacing=0 cellpadding=0><tr><td></td></tr></table>'} else {spc=''}
 a="<table border=0 cellspacing=0 cellpadding=0>"
 a+="<tr><td colspan=4 height="+vspace+"> </td><td rowspan=5 width="+hspace+"></td></tr>"
 a+="<tr><td width=1>"+spc+"</td><td width="+(size-3)+" bgcolor='"+color1+"'>"+spc+"</td><td width=1 bgcolor='"+color2+"'>"+spc+"</td><td width=1>"+spc+"</td></tr>"
 a+="<tr><td colspan=3 height="+(size-3)+" bgcolor='"+color1+"'>"+spc+"</td><td bgcolor="+color2+">"+spc+"</td></tr>"
 a+="<tr><td>"+spc+"</td><td bgcolor='"+color1+"'>"+spc+"</td><td bgcolor="+color2+">"+spc+"</td><td>"+spc+"</td></tr>"
 a+="</table>"
 document.write(a);	
}

// Hiperlógica - Função para abrir urls no dropbox:
function MM_jumpMenu(targ,selObj,restore)
{ //v3.0
    eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
    if (restore) selObj.selectedIndex=0;
}

function abrejanela_select(formulario){
	if (document.forms[formulario].capas.selectedIndex > 0){
	destino = document.forms[formulario].capas[document.forms[formulario].capas.selectedIndex].value;
//	document.location=destino;
	window.open(destino,'','');
	}
}
//usado em galeria de fotos
function abrir_galeria(pagina){
	config="toolbar=no,location=no,width=592,height=400,status=no,menubar=no,scrollbars=no,resible=no,top=161,left=300";
	pop=window.open(pagina,"newwindow",config);
}
//usado em galeria de fotos
function manda_galeria(){
	var manda = document.galerias.fotos.value;
	if(manda==""){
		return(false);
	} else {
		eval(manda);
		window.location = document.galerias.fotos.value;
	}
}

function abrebox(w,corL,corD){			
	if (ns4){spc='<table border=0 width=1 border=1 cellspacing=0 cellpadding=0><tr><td></td></tr></table>'} else {spc=''}	
	if(corD!=null)corD="bgcolor='"+corD+"'"
	else corD=""
	a="<table width="+w+" border=0 cellspacing=0 cellpadding=0>"
	a+="<tr><td colspan=3 width=1 height=1>"+spc+"</td><td  bgcolor='"+corL+"' height=1>"+spc+"</td><td colspan=3 width=1 height=1>"+spc+"</td></tr>"		
	a+="<tr><td width=1 height=1 rowspan=2>"+spc+"</td><td>"+spc+"</td><td bgcolor='"+corL+"' width=1 height=1>"+spc+"</td><td width="+(w-6)+" height=2 rowspan=2 "+corD+">"+spc+"</td><td bgcolor='"+corL+"' width=1 height=1>"+spc+"</td><td>"+spc+"</td><td width=1 height=1 rowspan=2>"+spc+"</td></tr>"
	a+="<tr><td width=1 height=1 bgcolor='"+corL+"'>"+spc+"</td><td width=1 height=1 "+corD+">"+spc+"</td><td width=1 height=1 "+corD+">"+spc+"</td><td width=1 height=1 bgcolor='"+corL+"'>"+spc+"</td></tr></table>"		
	document.write(a)
}

function fechabox(w,corL,corD){			
	if (ns4){spc='<table border=1 width=1 border=1 cellspacing=0 cellpadding=0><tr><td></td></tr></table>'} else {spc=''}	
	if(corD!=null)corD="bgcolor='"+corD+"'"
	else corD=""
	spc='<spacer type=block height=1 width=1>'
	a="<table width="+w+" border=0 cellspacing=0 cellpadding=0>"
	a+="<tr><td width=1 height=1 rowspan=2>"+spc+"</td><td width=1 height=1 bgcolor='"+corL+"'>"+spc+"</td><td width=1 height=1 "+corD+">"+spc+"</td><td width="+(w-6)+" height=2 rowspan=2 "+corD+">"+spc+"</td><td width=1 height=1 "+corD+">"+spc+"</td><td width=1 height=1 bgcolor='"+corL+"'>"+spc+"</td><td width=1 height=1 rowspan=2>"+spc+"</td></tr>"
	a+="<tr><td width=1 height=1>"+spc+"</td><td bgcolor='"+corL+"' width=1 height=1>"+spc+"</td><td bgcolor='"+corL+"' width=1 height=1>"+spc+"</td><td>"+spc+"</td></tr>"
	a+="<tr><td colspan=3 width=1 height=1>"+spc+"</td><td  bgcolor='"+corL+"' height=1>"+spc+"</td><td colspan=3 width=1 height=1>"+spc+"</td></tr></table>"
	document.write(a)
}

function divider(w,c1,c2,h1,h2){
	a="<table cellspacing=0 cellpadding=0 border=0>"
	if(h1!=null)a+="<tr><td height="+h1+"><spacer type=block height="+h1+"></td></tr>"
	a+="<tr><td bgcolor='"+c1+"' height=1 width="+w+"><spacer type=block height=1 width="+w+"></spacer></td></tr><tr><td bgcolor='"+c2+"' height=1><spacer type=block height=1></spacer></td></tr>"
	if(h2!=null)a+="<tr><td height="+h2+"><spacer type=block height="+h2+"></td></tr>"	
	a+="</table>"
	document.write(a)
}


//
// AOL Event Handlers API:
// added at 2003/10/16
//
aol_loadfunctions = [];
aol_scrollfunctions = [];
aol_resizefunctions = [];
aol_mousemovefunctions = [];
function aol_onLoad(){
	if (arguments.length == 0 || (typeof(arguments[0])!='string' && typeof(arguments[0])!='function')){
		for (func=0; func<aol_loadfunctions.length; func++){
			aol_loadfunctions[func]();
		}
	} else {
		if (typeof(arguments[0])=='string' && arguments[0]=='clear'){
			aol_loadfunctions = [];
		} else if (typeof(arguments[0])=='function'){
			aol_loadfunctions[aol_loadfunctions.length]=arguments[0];
		}
	}
}
onload = aol_onLoad;
function aol_onScroll(){
	if (arguments.length == 0 || (typeof(arguments[0])!='string' && typeof(arguments[0])!='function')){
		for (func=0; func<aol_scrollfunctions.length; func++){
			aol_scrollfunctions[func]();
		}
	} else {
		if (typeof(arguments[0])=='string' && arguments[0]=='clear'){
			aol_scrollfunctions = [];
		} else if (typeof(arguments[0])=='function'){
			aol_scrollfunctions[aol_scrollfunctions.length]=arguments[0];
			aol_onScroll();
		}
	}
}
function aol_onResize(){
	if (arguments.length == 0 || (typeof(arguments[0])!='string' && typeof(arguments[0])!='function')){
		for (func=0; func<aol_resizefunctions.length; func++){
			aol_resizefunctions[func]();
		}
	} else {
		if (typeof(arguments[0])=='string' && arguments[0]=='clear'){
			aol_resizefunctions = [];
		} else if (typeof(arguments[0])=='function'){
			aol_resizefunctions[aol_resizefunctions.length]=arguments[0];
			aol_onResize();
		}
	}
}
function aol_onMouseMove(){
	if (arguments.length == 0){
		for (func=0; func<aol_mousemovefunctions.length; func++){
			aol_mousemovefunctions[func]();
		}
	} else {
		if (typeof(arguments[0])=='string' && arguments[0]=='clear'){
			aol_mousemovefunctions = [];
		} else if (typeof(arguments[0])=='function'){
			aol_mousemovefunctions[aol_mousemovefunctions.length]=arguments[0];
		}
	}
}
aol_mouseX = null;
aol_mouseY = null;
function aol_mouseCapture(e){
	if (typeof(document.onmousemove)!='undefined') {
		aol_mouseX=window.event.clientX;
		aol_mouseY=window.event.clientY;
	} else if (typeof(addEventListener)!='undefined') {
		aol_mouseX=e.pageX;
		aol_mouseY=e.pageY - aol_getPageOffset(); 
	} else if (typeof(window.captureEvents)!='undefined') {
		aol_mouseX=e.pageX;
		aol_mouseY=e.pageY - aol_getPageOffset(); 
	}
	aol_onMouseMove();
}
function aol_startHandlers(modes){
	// "+scroll +resize +mouse" turns on all handlers.
	// "-scroll -resize -mouse" disables all handlers.
	modes = modes.toLowerCase();
	if (modes.indexOf('+scroll')>-1){
		if (typeof(onscroll)!='undefined'){
			document.body.onscroll = aol_onScroll;
		} else if (typeof(addEventListener)!='undefined'){
			document.addEventListener("scroll",aol_onScroll,false);
		} else if (typeof(window.captureEvents)!='undefined') { 
			window.captureEvents(Event.SCROLL); 
			window.onscroll = aol_onScroll;
		}
	} else if (modes.indexOf('-scroll')>-1){
		if (typeof(onscroll)!='undefined'){
			document.body.onscroll = null;
		} else if (typeof(addEventListener)!='undefined'){
			document.removeEventListener("scroll",aol_onScroll,false);
		} else if (typeof(window.captureEvents)!='undefined') { 
			window.captureEvents(Event.SCROLL); 
			window.onscroll = null;
		}
	}
	if (modes.indexOf('+resize')>-1){
		if (typeof(onresize)!='undefined') {
			document.body.onresize = aol_onResize;
		} else if (typeof(addEventListener)!='undefined'){
			window.addEventListener("resize",aol_onResize,false);
		} else if (typeof(window.captureEvents)!='undefined') { 
			window.captureEvents(Event.RESIZE); 
			window.onresize = aol_onResize;
		}
	} else if (modes.indexOf('-resize')>-1){
		if (typeof(onresize)!='undefined') {
			document.body.onresize = null;
		} else if (typeof(addEventListener)!='undefined'){
			window.removeEventListener("resize",aol_onResize,false);
		} else if (typeof(window.captureEvents)!='undefined') { 
			window.captureEvents(Event.RESIZE); 
			window.onresize = null;
		}
	}
	if (modes.indexOf('+mouse')>-1){
		if (typeof(document.onmousemove)!='undefined') {
			document.onmousemove = aol_mouseCapture;
		} else if (typeof(addEventListener)!='undefined'){
			window.addEventListener("mousemove",aol_mouseCapture,false);
		} else if (typeof(window.captureEvents)!='undefined') { 
			window.captureEvents(Event.MOUSEMOVE); 
			window.onmousemove = aol_mouseCapture;
		}
	} else if (modes.indexOf('-mouse')>-1){
		if (typeof(document.onmousemove)!='undefined') {
			document.onmousemove = null;
		} else if (typeof(addEventListener)!='undefined'){
			window.removeEventListener("mousemove",aol_mouseCapture,false);
		} else if (typeof(window.captureEvents)!='undefined') { 
			window.captureEvents(Event.MOUSEMOVE); 
			window.onmousemove = null;
		}
	}
}
function aol_getPageOffset(){
	if (typeof(window.pageYOffset)!='undefined'){
		return window.pageYOffset;
	} else if (typeof(document.body.scrollTop)!='undefined'){
		return document.body.scrollTop;
	} else {
		return 0;
	}
}
// End of AOL Event Handlers API
