jQuery(function () {
jQuery(".upload").change(function(){
campo_atual = jQuery(this);
campo_attr = campo_atual.attr('name');
campo_attr_max_width = campo_atual.attr('data-max-width');
campo_attr_max_height = campo_atual.attr('data-max-height');
if (this.files && this.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
if(campo_attr_max_width){
var maxWidth = "max-width:" + campo_attr_max_width + ";";
}
if(campo_attr_max_height){
var maxHeight = "max-height:" + campo_attr_max_height + ";";
}
htmlInserir = "
";
if (jQuery("." + campo_attr + "-campoupload").length > 0){
jQuery("." + campo_attr + "-campoupload").html(htmlInserir);
}else{
campo_atual.after("
" + htmlInserir + "
");
}
jQuery("." + campo_attr + "-campoupload-img").attr('src', ""+e.target.result+"");
}
reader.readAsDataURL(this.files[0]);
}
});
});
function linkCapitulosFanfics(){
$("#listaDeCapitulos").mouseover(function () {$(this).css('cursor','pointer');}).mouseout(function () {$(this).css('cursor','auto');}).click(function () {window.location = $(this).find('a').attr('href');});
}
function registrarAcompanhamento(ops,objetoAtual,id){
$('.situacao-' + id + ' .seletorOp').css("font-weight","normal");
$('.situacao-' + id + ' a').removeClass('opselecionado');
$('.situacao-' + id + ' a').addClass('opnaoselecionado');
objetoAtual.className='opselecionado';
$.ajax({url: "exibir.php?name=conta&file=acompanhando&id=" + id + "&ops=" + ops + ""});
}
function isArray(obj) {
if (obj.constructor.toString().indexOf("Array") == -1)
return false;
else
return true;
}
var initialtab=[1, "sc1"]
function cascadedstyle(el, cssproperty, csspropertyNS){
if (el.currentStyle)
return el.currentStyle[cssproperty]
else if (window.getComputedStyle){
var elstyle=window.getComputedStyle(el, "")
return elstyle.getPropertyValue(csspropertyNS)
}
}
var previoustab=""
function expandcontent(cid, aobject){
if (document.getElementById){
highlighttab(aobject)
detectSourceindex(aobject)
if (previoustab!="")
document.getElementById(previoustab).style.display="none"
document.getElementById(cid).style.display="block"
previoustab=cid
if (aobject.blur)
aobject.blur()
return false
}
else
return true
}
function adicionar_busca(url) {
window.external.AddSearchProvider(url);
}
function highlighttab(aobject){
if (typeof tabobjlinks=="undefined")
collecttablinks()
for (i=0; i";
sss.value = tanto-1;
}else if(funcao == "adicionar"){
imagem_trocar = base_url + funcao + id2;
ss.innerHTML = "
";
sss.value = tanto+1;
}
}
////////////////////////////////////////////////////////////////
// Abrir o Painel da Minha Conta
////////////////////////////////////////////////////////////////
function abrir_no_painel(URL) {
window.open(URL , 'conta', 'width=600, height=580, top=0, left=0, scrollbars=yes, status=yes, toolbar=yes, location=yes, directories=yes, menubar=yes, resizable=yes, fullscreen=no');
}
function DoVotar(URL) {
window.open(URL , 'votar', 'width=300, height=100, top=0, left=0, scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}
function DoDenunciar(URL) {
URL = escape(URL);
URL = URL.replace(/\//g,"%2F");
URL = URL.replace(/\?/g,"%3F");
URL = URL.replace(/=/g,"%3D");
URL = URL.replace(/&/g,"%26");
URL = URL.replace(/@/g,"%40");
URL2 = "exibir.php?name=oang&file=denunciar&referer=" +URL;
window.open(URL2, 'denunciar', 'width=500, height=300, top=0, left=0, scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}
function pegarURL()
{
document.write(document.URL);
}
////////////////////////////////////////////////////////
// Limitar Letras
// Colocar sempre antes da caixa de testo. (50)
//
// E "" onkeydown="me_checkLim(this)" onblur="me_checkLim(this)" onkeyup="me_checkLim(this)" "" no formul�rio
////////////////////////////////////////////////////////
function me_checkLim(obj){
intLng=obj.value.length;
if(intLng>intLim){
obj.value=obj.value.substring(0,intLim)
}
else{
document.getElementById('carRest').innerHTML=(intLim-obj.value.length);
}
}
////////////////////////////////////////////////////////
// ADS Google
////////////////////////////////////////////////////////
function ads_google() {
google_ad_client = "pub-2134791625552118";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="5040815287";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "333333";
google_color_url = "333333";
google_color_text = "999999";
document.write('');
}
////////////////////////////////////////////////////////////////
//Abrir Janela no centro da p�gina
////////////////////////////////////////////////////////////////
function openCentered(theURL,winName,winWidth,winHeight,features) {
var w = (screen.width - winWidth)/2;
var h = (screen.height - winHeight)/2 - 60;
features = features+',width='+winWidth+',height='+winHeight+',top='+h+',left='+w;
window.open(theURL,winName,features);
}
////////////////////////////////////////////////////////////////
//Abrir a janela ao confirmar pedido
////////////////////////////////////////////////////////////////
function DoConfirm2(mensagem, url) {
if(confirm(mensagem,url)){
window.location = url;
}
}
////////////////////////////////////////////////////////////////
// Confirma��o Padr�o
////////////////////////////////////////////////////////////////
function DoConfirm(mensagem,redirecionar) {
confirm(mensagem,redirecionar);
}
function verificar_existe()
{
var xmlhttp=false;
var imagem_veriricar = document.getElementById('url_avatar_verificar').value;
if(!xmlhttp) { xmlhttp=new XMLHttpRequest(); }
xmlhttp.open('GET','exibir.php?name=conta&file=avatar_verificar&url='+ imagem_veriricar, true);
xmlhttp.onreadystatechange = function() {
if(xmlhttp.readyState==4) { document.getElementById('saida_status').innerHTML = xmlhttp.responseText; }
}
xmlhttp.send(null);
}
////////////////////////////////////////////////////////////////
//Adicionar Bandeira
////////////////////////////////////////////////////////////////
function adicionar_bandeira(addSmilie) {
var addSmilie;
var revisedMessage;
var currentMessage = document.download.version.value;
revisedMessage = currentMessage+addSmilie;
document.download.version.focus();
document.download.version.value=revisedMessage;
return;
}
////////////////////////////////////////////////////////////////
//Modificar o tamanho da letra
////////////////////////////////////////////////////////////////
var vetFonte = new Array ();
vetFonte[0] = "10px";
vetFonte[1] = "11px";
vetFonte[2] = "13px";
TAMANHOFONTE = 0
function padrao_fontes()
{
document.all.AREA.style.fontSize = vetFonte[TAMANHOFONTE];
}
function Maior(){
if (TAMANHOFONTE<2) {
if (TAMANHOFONTE<0)
TAMANHOFONTE=0;
TAMANHOFONTE++;
document.all.AREA.style.fontSize = vetFonte[TAMANHOFONTE];
}
}
function Menor(){
if (TAMANHOFONTE>2)
TAMANHOFONTE=2;
TAMANHOFONTE--;
if (TAMANHOFONTE>=0) {
document.all.AREA.style.fontSize = vetFonte[TAMANHOFONTE];
}
}
////////////////////////////////////////////////////////////////
//Modificar o tamanho da letra
////////////////////////////////////////////////////////////////
var marked_row = new Array;
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
var theCells = null;
if ((thePointerColor == '' && theMarkColor == '') || typeof(theRow.style) == 'undefined') {
return false;
}
if (typeof(document.getElementsByTagName) != 'undefined') {
theCells = theRow.getElementsByTagName('td');
}
else if (typeof(theRow.cells) != 'undefined') {
theCells = theRow.cells;
}
else {
return false;
}
var rowCellsCnt = theCells.length;
var domDetect = null;
var currentColor = null;
var newColor = null;
if (typeof(window.opera) == 'undefined'
&& typeof(theCells[0].getAttribute) != 'undefined') {
currentColor = theCells[0].getAttribute('bgcolor');
domDetect = true;
}
else {
currentColor = theCells[0].style.backgroundColor;
domDetect = false;
}
if (currentColor == '' || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
if (theAction == 'over' && thePointerColor != '') {
newColor = thePointerColor;
}
else if (theAction == 'click' && theMarkColor != '') {
newColor = theMarkColor;
marked_row[theRowNum] = true;
}
}
else if (currentColor.toLowerCase() == thePointerColor.toLowerCase() && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
if (theAction == 'out') {
newColor = theDefaultColor;
}
else if (theAction == 'click' && theMarkColor != '') {
newColor = theMarkColor;
marked_row[theRowNum] = true;
}
}
else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
if (theAction == 'click') {
newColor = (thePointerColor != '')
? thePointerColor
: theDefaultColor;
marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
? true
: null;
}
}
if (newColor) {
var c = null;
if (domDetect) {
for (c = 0; c < rowCellsCnt; c++) {
theCells[c].setAttribute('bgcolor', newColor, 0);
}
}
else {
for (c = 0; c < rowCellsCnt; c++) {
theCells[c].style.backgroundColor = newColor;
}
}
}
return true;
}
////////////////////////////////////////////////////////////////
//Fade
////////////////////////////////////////////////////////////////
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
if (object != "[object]"){
setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
return;
}
clearTimeout(nereidFadeTimers[object.sourceIndex]);
diff = destOp-object.filters.alpha.opacity;
direction = 1;
if (object.filters.alpha.opacity > destOp){
direction = -1;}
delta=Math.min(direction*diff,delta);
object.filters.alpha.opacity+=direction*delta;
if (object.filters.alpha.opacity != destOp){
nereidFadeObjects[object.sourceIndex]=object;
nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
}
}
////////////////////////////////////////////////////////////////
//Eliminar mensagens de erro no Javascript do site
////////////////////////////////////////////////////////////////
function semerro(){
return true;
}
window.onerror=semerro;
//////////////////////////////////////////////////////////////////
// Selecionar Tudo
//////////////////////////////////////////////////////////////////
function selecionar_tudo(field, myselection)
{
var fieldid;
var pos;
var criteria;
var strng;
strng = myselection.value;
for (i=0; i= 0; i--) {
x = i; x *= 10; mnAnim[mnAnim.length] = "document.all['Fade"+id+"'].style.cssText = 'filter:alpha(opacity="+x+"); width:100%; '; ";
}
mnAnim[mnAnim.length] = "document.all['Fade"+id+"'].style.display = 'none'; ";
if (loc) {
mnAnim[mnAnim.length] = "location.href = '"+ loc +"'; ";
}
menuStat[id] = 'hidden'; mnDoAnim();
}
function mnDoAnim() {
for (i = 0; i < mnAnim.length; i++) {
window.setTimeout(mnAnim[i], 70*i);
}
mnAnim = new Array();
}
function Exibir_Tabela(id) {
if (document.all) {
var obj = document.all[id]; if (!obj) {
return false;
}
if (!menuStat[id] || menuStat[id] == "hidden") {
Tabela_Exibir(id);
} else {
Tabela_Esconder(id);
}
}
return false;
}
function getXmlHttpRequestObject() {
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
} else if(window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
} else {
alert("Your Browser Sucks!\nIt's about time to upgrade don't you think?");
}
}
function incluir(url, containerid, loading_id){
var page_request = false
if (window.XMLHttpRequest)
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{ page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){
}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid, loading_id);
}
page_request.open('GET', url + '&tempocache=' + new Date().getTime(), true)
page_request.send(null)
}
function loadpage(page_request, containerid, loading_id){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
document.getElementById(containerid).innerHTML = "";
document.getElementById(containerid).innerHTML=page_request.responseText
}else{
document.getElementById(loading_id).innerHTML = "
";
}
}
function initImage(id) {
image = document.getElementById(id);
setOpacity(image, 0);
image.style.visibility = "visible";
fadeIn(id,0);
}
function fadeIn(objId,opacity) {
if (document.getElementById) {
obj = document.getElementById(objId);
if (opacity <= 100) {
setOpacity(obj, opacity);
opacity += 10;
window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
}
}
}
function setOpacity(obj, opacity) {
opacity = (opacity == 100)?99.999:opacity;
// IE/Win
obj.style.filter = "alpha(opacity:"+opacity+")";
// Safari<1.2, Konqueror
obj.style.KHTMLOpacity = opacity/100;
// Older Mozilla and Firefox
obj.style.MozOpacity = opacity/100;
// Safari 1.2, newer Firefox and Mozilla, CSS3
obj.style.opacity = opacity/100;
}
function limitar_campo(id_campo, id_contador, tanto){
objeto_campo_contar = document.getElementById(id_campo);
contar_letras = objeto_campo_contar.value.length;
if(contar_letras>tanto){
objeto_campo_contar.value = objeto_campo_contar.value.substring(0,tanto)
}else{
document.getElementById(id_contador).innerHTML = (tanto-contar_letras);
}
}
function trim(value) {
return LTrim(RTrim(value));
}
function virgula(number) {
number += '';
x = number.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
return x1 + x2;
}
function fncUpdate(){
nTotal = nTotal + 20;
document.getElementById("lblTotal").innerHTML = virgula(nTotal);
setTimeout("fncUpdate()", 1000);
}
function fixImgs(whichId, maxW){
var pix = document.getElementById(whichId);
for (i=0; i maxW) {
f=1-((w - maxW) / w);
pix.width = w * f;
pix.height = h * f;
}
}
pix.onerror = function() {
pix.attempts = (pix.attempts == 'undefined') ? 1 : 2;
if (pix.attempts == 1) {
pix.src = pix.src;
}else {
pix.src='http://s.onlineshoes.com/images/no_image_icon_sm.gif';
}
}
}
function enviarOrkut(titulo, link){
var params = {};
var imgParentSelector = '#wrap';
params[google.orkut.share.Field.TITLE] = titulo;
params[google.orkut.share.Field.DESTINATION_URL] = link;
imgs = [];
$( imgParentSelector+' img').each(function() {
imgs.push($(this).attr('src'));
});
params[google.orkut.share.Field.CONTENT] = titulo;
params[google.orkut.share.Field.THUMBNAIL] = imgs;
var connection = new google.orkut.share.Connection(params);
connection.send('orkut.com', {});
}
/////////////////////////////////////////////////////////////////////////////////////////////////
//V�deos Youtube
/////////////////////////////////////////////////////////////////////////////////////////////////
var OriPicNum = 0;
var CurDocument = 0;
var CurPicNum = 0;
var CurUrl = "";
(function($){
$.extend({
playSound: function(){
return $("