﻿window.addEvent('domready', function() {
if ($('protectcont1') != null && $('protectcont2') != null ){
disableSel($("protectcont1"));
disableSel($("protectcont2"));
}
});

function disableSel(target){
if (typeof target.onselectstart!="undefined") //IE route
	target.onselectstart=function(){return false}
else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
	target.style.MozUserSelect="none"
else //All other route (ie: Opera)
	target.onmousedown=function(){return false}
target.style.cursor = "default"
}
//---
window.addEvent('domready', function() {
	var protector = new dwProtector({
		image: '/js/blank.gif',
		elements: $$('.protect')
	});
});
//---
window.addEvent('domready', function() {
if ($('divLogin') != null){
$('divLogin').setStyle('z-index','2');	
	var t = $('divLogin');
	$('divLogin').setOpacity(0);
	$('mudaopacidade').addEvent('click', function(x) {
		// parar de propagar evento
		x.stop();
		t.fade('out');
		t.fade('in');
		 t.fade('toggle');
	});

$('mudaopacidade2').addEvent('click', function(a) {
		// parar de propagar evento
		a.stop();
		t.fade('out');
		
	});
}
});
//---
window.addEvent('domready',function() {
			new SmoothScroll({duration:500});
			
			var go = $('gototop');
			go.set('opacity','0').setStyle('display','block');
			window.addEvent('scroll',function(e) {
				
				go.fade((window.getScroll().y > 300) ? 'in' : 'out')
			});
		});
//---
window.addEvent('domready',function() {

if($('jc_numComment')!=null){
var count = $('jc_numComment').get('html');
}
else{
var count='';
}

$$('.artcomment').set('html', 'Comentários'+count+'');
});
//--
window.addEvent('domready', function(){

$$('.comptext').addEvent('mouseenter', function(a) {
            // We set the cursor to pointer so users know they can click this region
            this.setStyle('cursor','pointer');
       });
	

    //We retrieve the link location (href) and assign it to LI to make the whole region clickable
    var linkbox = $$('.comptext');
	//alert(link);
    linkbox.each(function(element) {
	//alert(element);
	
	element.addEvent('click', function(){
	var link= element.getElement('a');
		//alert(link);
	
            window.location = link.get('href');
            // on click, background color and border will turn to a different color
            this.morph({
                
                'background-image': 'none',
                'background-color': '#fff'
            });
        });
        
    });
});
//--
window.addEvent('domready',function() {
if($$('.error') != ''){
var count = $$('.error').get('html');
var mensagem= $$('.message').get('html');
$('mensagemerro').set('html', '<span>Entornou o chá?</span><br/>'+mensagem);
$('erros').setStyle('display','block');

$('mensagemerro').setStyle('display','block');

$('mensagemerro').addEvent('click', function(x) {
		$('mensagemerro').setStyle('display','none');
		$('erros').setStyle('display','none');
		x.stop();
	});
$('erros').addEvent('click', function(t) {
		$('mensagemerro').setStyle('display','none');
		$('erros').setStyle('display','none');
		t.stop();
	});
	
}
});
//--
/**
window.addEvent('domready',function() {
var s="";var aux="";
for (i=0; i < document.links.length; i++)
{
s=document.links[i].href;

if(s.match("http://") && s.match("diariodemulher.com")==null ){
document.links[i].href="http://www.diariodemulher.com/linkexterno.php?lnk="+document.links[i].href
}
}
});*/
//-
/*
<script type="text/javascript">
window.addEvent('domready', function(){
$('panel').setStyle('display', 'block');	
var myVerticalSlide = new Fx.Slide('panel', {duration: 1200}).hide();

$('open').addEvent('click', function(e){
		e.stop();
		
		myVerticalSlide.slideIn();
		var url='/ajaxcalls.php?cmd=assinatura';
		var div ='panel2';
		getstuff(url,div);
		//$('open').setStyle('display', 'none');
		$('close').setStyle('display', 'block');
	});
$('close').addEvent('click', function(e){
		e.stop();
		myVerticalSlide.toggle();
		$('close').setStyle('display', 'none');
		//$('open').setStyle('display', 'block');
	});	

$('ganhedinheiro').addEvent('click', function(e){
		e.stop();
		myVerticalSlide.slideIn();
        var url='/ajaxcalls.php?cmd=ganhedinheiro';
		var div ='panel2';
		getstuff(url,div);
		$('close').setStyle('display', 'block');
		//$('open').setStyle('display', 'block');
	});	
	
if($('assartigo')!=null){	
$('assartigo').addEvent('click', function(e){
		e.stop();
		myVerticalSlide.slideIn();
		window.scrollTo(0,0);
        var url='/ajaxcalls.php?cmd=assinatura';
		var div ='panel2';
		getstuff(url,div);
		$('close').setStyle('display', 'block');
		//$('open').setStyle('display', 'block');
	});	
}	
	
});

function getstuff(url,div) {
  $(div).setHTML('<div style="width:48px;margin-left:auto;margin-right:auto;height:48px;margin-top:100px;"><img src="/img/loading3.gif" /></div><div style="color:#000;font-size:10px;width:65px;margin-left:auto;margin-right:auto;">Carregando...</div>');
  var ajax = new Ajax(url, {
    method: 'get',
    update: div,
    evalScripts: true
  });
  ajax.request();
  return false;
}
</script>
-->
<!--[if IE 8]>
<style>div.jv-topletters{margin-left:-7px;}
#jv-header{
margin-left:-11px;
}
</style>
*/

