// JavaScript Document
var ja = jQuery.noConflict();


ja(document).ready(function(){
	ja(".main img").each(function(index,element){
		if (ja(this).attr("class") == 'menu_selected'){
			this.src = this.src.replace(".png","_hover.png");					   
		} else {
			ja(this).hover(
				function(){
					this.src = this.src.replace(".png","_hover.png");					   
				}, function(){
					this.src = this.src.replace("_hover.png",".png");					   
				});		
		}
	});					   

	ja(".flechitas").each(function(index,element){
		
			ja(this).hover(
				function(){
					this.src = this.src.replace(".jpg","_hover.jpg");					   
				}, function(){
					this.src = this.src.replace("_hover.jpg",".jpg");					   
				});		
		
	});					   
	ja(".flechitas_programas").each(function(index,element){
		
			ja(this).hover(
				function(){
					this.src = this.src.replace(".png","_hover.png");					   
				}, function(){
					this.src = this.src.replace("_hover.png",".png");					   
				});		
		
	});					   


	ja(".paginacion img").each(function(index,element){
		if (ja(this).attr("class") == 'menu_selected'){
			this.src = this.src.replace(".jpg","_hover.jpg");					   
		} else {
			ja(this).hover(
				function(){
					this.src = this.src.replace(".jpg","_hover.jpg");					   
				}, function(){
					this.src = this.src.replace("_hover.jpg",".jpg");					   
				});		
		}
	});					   

	ja(".reproductor img").each(function(index,element){
		if (ja(this).attr("class") == 'menu_selected'){
			this.src = this.src.replace(".png","_hover.png");					   
		} else {
			if (ja(this).attr("class") != 'facebook' && ja(this).attr("class") != 'tweeter'){
				ja(this).hover(
					function(){
						this.src = this.src.replace(".png","_hover.png");					   
					}, function(){
						this.src = this.src.replace("_hover.png",".png");					   
					});	
			}
		}
	});	
	
	ja(".scrollExclusivos").scrollable({ vertical: true});
	ja(".scrollExclusivos1").scrollable({ vertical: true});
	ja(".scrollNoticias").scrollable({ vertical: true});
	ja(".scrollProgramas").scrollable();
	ja(".scrollDestacados").scrollable().navigator({ navi:'ul.paginacion' });
	
	ja("#form_contacto").validate();
	
	ja(".imghover").each(function(index,element){
		
			ja(this).hover(
				function(){
					this.src = this.src.replace(".png","_hover.png");					   
				}, function(){
					this.src = this.src.replace("_hover.png",".png");					   
				});		
		
	});
	


});

function cargaPlayer(p){
	if(p==undefined){
		p="";
		}
	$f("player"+p, "flowplayer-3.2.5.swf", {
	
			// don't start automcatically
			clip: {
				autoPlay: false,
				autoBuffering: true
			},
				
			// disable default controls
			plugins: {controls: null}
			
			

	
		// install HTML controls inside element whose id is "hulu"
		}).controls("barrita"+p, {/*duration: 25*/});
}



function cargaPlayerFull(){
	$f("player", "flowplayer-3.2.5.swf");
}





