// JavaScript Document

$(document).ready(function() {
	
$("#slider").easySlider(); 
$("#slider1").easySlider(); 



$(".enviaamigo").fancybox({
						  'autoDimensions': false,
						  'width': 630,
						  'height': 310,
						  'transitionIn': 'none',
						  'transitionOut': 'none',
						  'type': 'iframe'
						
						
						  });	
$("#horoscopo").fancybox({
						  'autoDimensions': false,
						  'width': 350,
						  'height': 150,
						  'transitionIn': 'none',
						  'transitionOut': 'none',
						  'type': 'iframe'
						
						
						  });
$(".enviatorpedo").fancybox({
						  'autoDimensions': false,
						  'width': 630,
						  'height':480,
						  'transitionIn': 'none',
						  'transitionOut': 'none',
						  'type': 'iframe'
						
						
						  });	

$(".abrecontato").fancybox({
						  'autoDimensions': false,
						  'width': 570,
						  'height': 420,
						  'transitionIn': 'none',
						  'transitionOut': 'none',
						  'type': 'iframe'
						
						
						  });	
$(".do_login").fancybox({
						  'autoDimensions': false,
						  'width': 300,
						  'height': 300,
						  'transitionIn': 'none',
						  'transitionOut': 'none',
						  'type': 'iframe'
						
						
						  });	



$("a[rel=galeria_noticias]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
		    return '<span id="fancybox-title-over"><strong style="color:#C30">[' +  (currentIndex + 1) + ' / ' + currentArray.length + ']</strong> -  ' + title + '</span>';
		}
	});

});

function ValidaBusca(){
	if(document.getElementById("q").value==""){
		alert("Informe um termo ou palavra para ser pesquisada");
		return false;
	}
	
}

function CloseAds(){
 document.getElementById("adsfloatcontainer").style.visibility='hidden'	
	
	
}

function logouse(){
$.fancybox.close();
document.location.reload()
	
}

function GetADS(pos,banner,id,w,h){

		//var so = new SWFObject("/userfiles/banners/"+banner+"", "ads", ""+w+"", ""+h+"", "8", "");
		//so.addParam("wmode", "opaque");
    	//so.addParam("menu", "false");
		//so.write(pos);
		 var params = { bgcolor: "#fff", wmode: "opaque"  };
		var atts = { id: "myytplayer" };
      	swfobject.embedSWF("/userfiles/banners/"+banner+"", pos, ""+w+"", ""+h+"", "8", null, null, params, atts);

	
}

function watchvideo(uri,w,h){
	
			var vid;
			var results;

			results = uri.match("[\\?&]v=([^&#]*)");

			vid = ( results === null ) ? url : results[1];
			
			document.getElementById("show_watch").innerHTML='<object width="'+w+'" height="'+h+'"><param name="movie" value="http://www.youtube.com/v/'+vid+'"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'+vid+'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'+w+'" height="'+h+'"></embed></object>'
}
