﻿function fnFlash(strUrl, intLargura, intAltura)
{
	document.writeln('<object type="application/x-shockwave-flash" data="' + strUrl + '" width="' + intLargura + '" height="' + intAltura + '">');
	document.writeln('<param name="movie" value="' + strUrl + '">');
	document.writeln('<param name="quality" value="high">');
	document.writeln('<param name="wmode" value="transparent">');
	document.writeln('<embed wmode="transparent" src="' + strUrl + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + intLargura + '" height="' + intAltura + '"></embed></object>');
}
function getURL(){
	url = location.href;
	url = url.replace('http://','');
	
	var token = Array();
	token[0] = "http://";
	token[1] = url.substring(0,url.indexOf('/'));
	url = token[0]+token[1];
	return url;
}
//Prototype que simula o método trim alterado para atuar sobre html
String.prototype.trim = function(){
	//Aplica replace de espaços no início e no fim da string,após isto remove espaços html em branco;
	return this.replace(/^\s*/, "").replace(/\s*$/, "").replace("&nbsp;","");
}
function IsInDesignMode(){
	//Verifica dois hidden fields utilizados pelo sharepoint
	if(document.getElementById("MSOLayout_InDesignMode") != null){
	   if(document.getElementById("MSOLayout_InDesignMode").value == '1'){ 
			return true;
		}else{
			return false;
	   }
	}else{
		return false;
	}
   if(document.getElementById("MSOTlPn_SelectedWpId") != null){
	   if(document.getElementById("MSOTlPn_SelectedWpId").value != ""){ 
	   		return true;
	   }else{
			return false;
	   }
   	}else{
   		return false;
	}
}	

function Maxlength(oTxt, iLen, bInf) {
if (!bInf) {
	if (document.getElementById(oTxt).value.length >= iLen)
		return false;
	else 
		return true;
} 
else {
  if (document.getElementById(oTxt).value.length > iLen)
		document.getElementById(oTxt).value = document.getElementById(oTxt).value.substr(0, iLen);
  if (document.getElementById('contador'))
	  document.getElementById('contador').innerHTML = iLen - document.getElementById(oTxt).value.length;
	}
}

$(document).ready(function(){
	//Funcao de imprimir
	$.getScript("/Util/Javascript/jquery_jqprint_0_3_.js");
	$("#lnkImprimir").click(function(){
		$('#PrintArea').jqprint();
		return false;
	});
	//Funcao para indicar página
	$("#lnkIndicarPagina").click(function(){
			url = getURL();
			url += "/indicar-pagina/Paginas/default.aspx?ContentURL="+location.href+"&Title="+$("#PageTitle").text().trim();
			location.href = url;
			return false;
	});
	
	//Funcao para indicar página de Mulheres
	$("#lnkIndicarPaginaMulheres").click(function(){
			url = getURL();
			url += "/canais-exclusivos/mulheres-e-investimentos/indicar-pagina/Paginas/default.aspx?ContentURL="+location.href+"&Title="+$("#PageTitle").text().trim();
			location.href = url;
			return false;
	});
});
var gDomain="sdc.webtrendslive.com.br";
var gDcsId="dcsfh1994u6pm303kijxeyuaa_1l2c";
		  
// Code section for Use the new first-party cookie generated with this tag.
var gFpc="WT_FPC";
var gConvert=true;
		  
		  
if ((typeof(gConvert)!="undefined")&&gConvert&&(document.cookie.indexOf(gFpc+"=")==-1)&&(document.cookie.indexOf("WTLOPTOUT=")==-1)){
	  document.write("<SCR"+"IPT TYPE='text/javascript' SRC='"+"http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://"+gDomain+"/"+gDcsId+"/wtid.js"+"'><\/SCR"+"IPT>");
}

$(document).ready(function(){
	$.getScript('/util/highslide/botAssistenteVirtual.js');
});