//var urlEstatico = 'http://emidia-server2/cyberdiet'
//var urlCf = 'http://tecnologia/encantar'
//var urlPhp = 'http://tecnologia/encantar'
//var urlPhp2 = 'http://emidia-server/cdiet_braslink'

var urlEstatico = 'http://cyberdiet.terra.com.br/cyberdiet'
var urlCf = 'http://cyberdiet.terra.com.br/assinante'
var urlPhp = 'http://cyberdiet2.terra.com.br/cyberdiet'
var urlPhp2 = 'www2.cyberdiet.com.br'

var netscape4 = (navigator.appName == 'Netscape' && navigator.userAgent.indexOf('Netscape') == -1) ? true : false
var netscape7 = (navigator.userAgent.indexOf('Netscape') > -1) ? true : false
var netscape  = (navigator.appName == 'Netscape') ? true : false
var explorer  = (navigator.appName != 'Netscape') ? true : false

if (netscape4)  document.write('<style type="text/css">.caixa { color: CD3000;  font-family: verdana;  font-size: 10px;} .caixabotoes { color: 4191a4;  font-family: Verdana;  font-size: 10px;  } </style>'); 
else document.write('<style type="text/css">.caixabotoes_vd { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; font-weight: bold; color: #FFFFFF; background-color: #669933; border: 1px outset #669933; } .caixa { color: 4191a4;  font-family: verdana;  font-size: 10px; border: 1px solid #4191a4;} .caixabotoes { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; font-weight: bold; color: #FFFFFF; background-color: 4191a4; border: 1px outset #4191a4; } </style>');

function vai (para) {
	var path
	if (para.indexOf('.php') > -1) { path =  urlCf; }
	else if (para.indexOf('chat/') > -1) { path =  urlPhp2; }
	else if (para.indexOf('.php') > -1) { path =  urlPhp; }
	else if (para.indexOf('.htm') > -1) { path =  urlEstatico; }

	if (path != urlEstatico) {
		var cData = new Date()
		var nCache = cData.getSeconds()
		var c_par_sinal  = (para.indexOf('?') > -1) ? '&' : '?'
		var c_par =  c_par_sinal + 'noch=' + nCache; }
	else var c_par = '';	
	window.open(path+para+c_par,"_top")
}


function ve_enquete() {
	for (i=0;i<document.fEnq.enq.length;++i) {
		if (document.fEnq.enq[i].checked) return true
	} 
	alert('Você deve escolher uma das opções disponíveis!')
	return false
}

function clique_indique(nomePagina) {
	if (nomePagina == null) window.open(urlCf+"/aberto/indique_amigo.php","indique",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=420,height=430');
	else window.open(urlCf+"/aberto/indique_amigo.php?pagina="+nomePagina+"","indique",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=420,height=430');
}

function pop_ajuda() {
	vaiAjuda = urlEstatico+'/ajuda/ajuda.htm';
	jan1 = window.open(vaiAjuda,'tajuda',"width=560,height=430,resizeable=no,menubar=no,scrollbars=no,top=10,left=10")
	jan1.focus()
	
}

function takeatour() {
	jan1 = window.open(urlEstatico+'/tour/tour_01_conheca.htm','ttour',"width=560,height=430,resizeable=no,menubar=no,scrollbars=no,top=10,left=10")
	jan1.focus()
}

function add_favorito() {
    var url      = "http://www.cyberdiet.com.br";
    var title    = "CyberDiet - Programa de apoio ao Emagrecimento";
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if(window.opera && window.print){
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',url);
        mbm.setAttribute('title',title);
        mbm.click();
    }
    else if(document.all){window.external.AddFavorite(url, title);}
}
function Get_Cookie( name ) {

	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
		return null;
	}
	if ( start == -1 )
		return null;
	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 )
		end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}
