$(document).ready(function(){									   
	/*-inputs-*/
	$(document).pngFix(); 
	$("input.text").focus(function(e){
		value = $(this).attr("alt");
		if($(this).attr("value") == value){ $(this).val(""); }
	});
		$("input.text").blur(function(e){
			if($(this).attr("value") == ''){ $(this).attr("value", value); }
		});

	/*-over menu interna-*/
	$(".btn_menu").hover(function() {  
		if(($(this).parent().find("div.interna_izquierda_btn")).is('.nrml')){
			$(this).parent().find("div.interna_izquierda_btn").removeClass('nrml').addClass('over'); 
    	    $(this).parent().find("div.interna_centro_btn").removeClass('nrml').addClass('over'); 
			$(this).parent().find("div.interna_derecho_btn").removeClass('nrml').addClass('over'); 
		}
    }, function(){ 
		if(($(this).parent().find("div.interna_izquierda_btn")).is('.over')){
    	    $(this).parent().find("div.interna_izquierda_btn").removeClass('over').addClass('nrml'); 
        	$(this).parent().find("div.interna_centro_btn").removeClass('over').addClass('nrml'); 
			$(this).parent().find("div.interna_derecho_btn").removeClass('over').addClass('nrml'); 
		}
    }); 

	/*-over menu-*/
	$(".contenedor_pizzas").hover(function() {  
		$(this).parent().find("div.imagen_pizzas").removeClass('norml_img').addClass('over_img'); 
        $(this).parent().find("div.titulo_pizzas").removeClass('norml_titulo').addClass('over_titulo'); 
    }, function(){  
        $(this).parent().find("div.imagen_pizzas").removeClass('over_img').addClass('norml_img'); 
        $(this).parent().find("div.titulo_pizzas").removeClass('over_titulo').addClass('norml_titulo'); 
    });     

 	//setTimeout(function(){ $(document).pngFix(); },150);
	/*-validaciones-*/
	$("#frm_enviar").validate({
		  debug: false,  
		  errorElement: "em",  
		  errorContainer: $("#warning"),  
		  success: function(label) {  
			   label.remove(); 
		  },
		 submitHandler: function(form) {
			form.submit();
		 }	  
	});
	
	
	
	$('#twitterbutton').twitterbutton({
	user:'dominosgt',
	layout:'none',
	title:'Dominos Pizza Guatemala',
	action:'follow',
	onfollow:function(response){
	$('.twitterbutton-uncontent:visible').hide('fade');
	$('.twitterbutton-content').show('fade');
	$.cookie('tw','followed',{expires: 999});
	},
	ontweet:function(response){
	$('.twitterbutton-uncontent:visible').hide('fade');
	$('.twitterbutton-content').show('fade');
	$.cookie('tw','tweeted',{expires: 999});
	},
	onretweet:function(response){
	$('.twitterbutton-uncontent:visible').hide('fade');
	$('.twitterbutton-content').show('fade');
	$.cookie('tw','retweeted',{expires: 999});
	},
	googleanalytics:true,
	lang:'es'
	});
	if($.cookie('tw')=='followed' || $.cookie('tw')=='tweeted' || $.cookie('tw')=='retweeted'){$('.remember-state').show('fade');$('.twitterbutton-uncontent:visible').hide('fade');}	
	
	$('#contenido_izquierda .mainb').cycle({ 
    fx:      'scrollDown', 
    speed:    750, 
    timeout:  10000 
	});

});

function divOculto(id){
	var div = "#flecha_"+id;
	if ($(div).is('.normal')){
		$(div).removeClass('normal').addClass('abajo');			
		$("#respuesta_"+id).show();
	}else{
		$(div).removeClass('abajo').addClass('normal');				
		$("#respuesta_"+id).hide();
	}	
}

