
(function(a){a.fn.example=function(e,g){var d=a.isFunction(e),f=a.extend({},g,{example:e});return this.each(function(){var c=a(this),b=a.metadata?a.extend({},a.fn.example.defaults,c.metadata(),f):a.extend({},a.fn.example.defaults,f);if(!a.fn.example.boundClassNames[b.className]){a(window).unload(function(){a("."+b.className).val("")});a("form").submit(function(){a(this).find("."+b.className).val("")});a.fn.example.boundClassNames[b.className]=true}if(!c.attr("defaultValue")&&(d||c.val()==b.example))c.val("");
if(c.val()==""&&this!=document.activeElement){c.addClass(b.className);c.val(d?b.example.call(this):b.example)}c.focus(function(){if(a(this).is("."+b.className)){a(this).val("");a(this).removeClass(b.className)}});c.change(function(){a(this).is("."+b.className)&&a(this).removeClass(b.className)});c.blur(function(){if(a(this).val()==""){a(this).addClass(b.className);a(this).val(d?b.example.call(this):b.example)}})})};a.fn.example.defaults={className:"example"};a.fn.example.boundClassNames=[]})(jQuery);


function switchnavptv(id){

	jQuery('#vnav').children().each(function() {
    jQuery(this).css("display","none");
	
});
	var returnVar = document.getElementById(id);
	var menos=document.getElementById(id-1);
	var mais=document.getElementById(id+1);
	jQuery(returnVar).css("display","inline");
	jQuery(menos).css("display","inline");
	jQuery(mais).css("display","inline");
	if(id==0){
	jQuery('#prev').css("display","none");	
	}else
	{
	jQuery('#prev').css("display","inline");
	}
	var i=jQuery('#vnav a').length;
	if(id==i-1){
	jQuery('#next').css("display","none");	
	}else
	{
	jQuery('#next').css("display","inline");
	}
}

function gonextr(){
	var id=jQuery('.activeSlide').attr('id');
	id=parseInt(id);
	id=id+1;
	var i=jQuery('#revnav a').length;
	i=parseInt(i);
	if(id==i){
	id=1;	
	}
	if(id==0){
	jQuery('#prev').css("display","none");	
	}else
	{
	jQuery('#prev').css("display","inline");
	}
	if(id==i-1){
	jQuery('#next').css("display","none");	
	}else
	{
	jQuery('#next').css("display","inline");
	}
	jQuery('#revnav').children().each(function() {
    jQuery(this).css("display","none");
	
});
	var returnVar = document.getElementById(id);

	var menos=document.getElementById(id-1);

	var mais=document.getElementById(id+1);
	jQuery(returnVar).css("display","inline");
	jQuery(menos).css("display","inline");
	jQuery(mais).css("display","inline");
	
}


function goprevr(){
	var id=jQuery('.activeSlide').attr('id');
	id=parseInt(id);
	id=id-1;
	if(id==-1){
	id=10;	
	}
	if(id==0){
	jQuery('#prev').css("display","none");	
	}else
	{
	jQuery('#prev').css("display","inline");
	}
	if(id==i-1){
	jQuery('#next').css("display","none");	
	}else
	{
	jQuery('#next').css("display","inline");
	}
	jQuery('#revnav').children().each(function() {
    jQuery(this).css("display","none");
	
});
	var returnVar = document.getElementById(id);

	var menos=document.getElementById(id-1);

	var mais=document.getElementById(id+1);

	jQuery(returnVar).css("display","inline");
	jQuery(menos).css("display","inline");
	jQuery(mais).css("display","inline");		

}

function gonext(){
	var id=jQuery('.activeSlide').attr('id');
	id=parseInt(id);
	id=id+1;
	var i=jQuery('#vnav a').length;
	i=parseInt(i);
	if(id==i){
	id=1;	
	}
	if(id==0){
	jQuery('#prev').css("display","none");	
	}else
	{
	jQuery('#prev').css("display","inline");
	}
	if(id==i-1){
	jQuery('#next').css("display","none");	
	}else
	{
	jQuery('#next').css("display","inline");
	}
	jQuery('#vnav').children().each(function() {
    jQuery(this).css("display","none");
	
});
	var returnVar = document.getElementById(id);

	var menos=document.getElementById(id-1);

	var mais=document.getElementById(id+1);
	jQuery(returnVar).css("display","inline");
	jQuery(menos).css("display","inline");
	jQuery(mais).css("display","inline");
}


function goprev(){
	var id=jQuery('.activeSlide').attr('id');
	id=parseInt(id);
	id=id-1;
	var i=jQuery('#vnav a').length;
	i=parseInt(i);
	if(id==-1){
	id=10;	
	}
	if(id==0){
	jQuery('#prev').css("display","none");	
	}else
	{
	jQuery('#prev').css("display","inline");
	}
	if(id==i-1){
	jQuery('#next').css("display","none");	
	}else
	{
	jQuery('#next').css("display","inline");
	}
	jQuery('#vnav').children().each(function() {
    jQuery(this).css("display","none");
	
});
	var returnVar = document.getElementById(id);

	var menos=document.getElementById(id-1);

	var mais=document.getElementById(id+1);

	jQuery(returnVar).css("display","inline");
	jQuery(menos).css("display","inline");
	jQuery(mais).css("display","inline");	

}

function switchnavrev(id){

	jQuery('#revnav').children().each(function() {
     jQuery(this).css("display","none");
	
});
	var returnVar = document.getElementById(id);
	var menos=document.getElementById(id-1);
	var mais=document.getElementById(id+1);
	jQuery(returnVar).css("display","inline");
	jQuery(menos).css("display","inline");
	jQuery(mais).css("display","inline");
	if(id==0){
	jQuery('#prev').css("display","none");	
	}else
	{
	jQuery('#prev').css("display","inline");
	}
	var i=jQuery('#vnav a').length;
	if(id==i-1){
	jQuery('#next').css("display","none");	
	}else
	{
	jQuery('#next').css("display","inline");
	}
}


	/*	$(document).ready(function(){	
			$("#slider").easySlider({
				auto: true, 
				continuous: true,
				numeric: true
			});
		});*/
// Javascript originally by Patrick Griffiths and Dan Webb.
// http://htmldog.com/articles/suckerfish/dropdowns/
sfHover = function() {
   var sfEls = document.getElementById("navbar").getElementsByTagName("li");
   for (var i=0; i<sfEls.length; i++) {
      sfEls[i].onmouseover=function() {
         this.className+=" hover";
      }
      sfEls[i].onmouseout=function() {
         this.className=this.className.replace(new RegExp(" hover\\b"), "");
      }
   }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

jQuery(document).ready(function() {
	jQuery('#filterby').after('<div style="clear:both"></div>');
	
	infoinputs('#mini-login','email');
	infoinputs('#mini-password','password');
	
	jQuery('a.lightwindow').fancybox({
		'centerOnScroll':true
	});
	jQuery('a.lightwindowiframe').fancybox({
		'width':500,
		'height':400,
		'type':'iframe',
		'centerOnScroll':true
	});
	
	jQuery('.jtooltip').tooltip({ 
    	track: true, 
    	delay: 0, 
    	showURL: false, 
    	showBody: "", 
    	fade: 250 
	});
	
    jQuery('#slider').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		pager:  '#nav',
		zIndex: 0 
	});
	
	    jQuery('#sliderh').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		pager:  '#navh',
		zIndex: 0 
	});
	    jQuery('#topseller_slider').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		pager:  '#topseller_nav',
		timeout: 0,
		zIndex: 0 
	});
	
	    jQuery('#destaques_slider').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		pager:  '#destaques_nav',
		timeout: 5000,
		speed: 2000,
		pause: 1,
		zIndex: 0 
	});
		jQuery('#hotdeals_slider').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		pager:  '#hotdeals_nav',
		timeout: 0,
		zIndex: 0 
	});
	
	jQuery(".vidbox").jqvideobox();
	
});
	jQuery(function() {
		jQuery("#tabs").tabs({ fxFade: true, fxSpeed: 'fast' });
	});
	var $tabs = jQuery('#tabs').tabs(); // first tab selected

	jQuery('#ver_review').click(function() { // bind click event to link
    $tabs.tabs('select', 1); // switch to third tab
    location.href = "#customer-reviews";
    return false;
});

jQuery(document).ready(function(){ 
	
var colmain;
var coldir;
var colmain2;
var coldir2;
var colmain3;
var coldir4;

colmain=jQuery("#colunamain").height();
coldir=jQuery("#colunadireita").height();
colmain2=jQuery("#colunamain2").height();
coldir2=jQuery("#colunadireita2").height();
colmain3=jQuery("#colunamain3").height();
coldir3=jQuery("#colunadireita3").height();
if (colmain<coldir)
  {
 jQuery("#colunamain").height(coldir);
 jQuery("#colunamain").css("background-color","#323232");
  }	
  
  if (colmain2<coldir2)
  {
 jQuery("#colunamain2").height(coldir2);
 jQuery("#colunamain2").css("background-color","#FFFFFF");
  }	
  
  if (colmain3<coldir3)
  {
 jQuery("#colunamain3").height(coldir3);
 jQuery("#colunamain3").css("background-color","#E7DFDD");
  }else{
 jQuery("#colunadireita3").height(colmain3);
 jQuery("#colunadireita3").css("background-color","#666666");	  
  }	
	
	
});

    function toggle_visibility(id) {
       var e = document.getElementById(id);
       if(e.style.display == 'block')
          e.style.display = 'none';
       else
          e.style.display = 'block';
    }
	
	// Fazer info de exemplos aos inputs de login e password - by Jose Moreira
	function infoinputs(selector,texto){
		if(texto=='') texto='exemplo';
		if(selector=='') return false;
		btn=jQuery(selector);
		btn.attr('value',texto);
		btn.click(function(){
			if(jQuery(this).attr('value') == texto)
				jQuery(this).attr('value','');
		});
		btn.blur(function(){
			if(jQuery(this).attr('value')=='')
				jQuery(this).attr('value',texto);
		});
		return true;
	}
