/**
 *	Mueve las imagenes a la derecha. 
 */
	
	
	function muestraProgramacion(){

		if($("#contenidoIframe").is(":hidden")){
			$("#contenidoIframe").slideDown("slow");
			$("#toggle_programacion").html("<a href=\"#\" onclick=\"javascript:ocultaProgramacion(); return false;\" ><img src=\"img/btn_cierra_programacion2.jpg\" border=\"0\" /></a>");
			$("#toggleoff_programacion").show();
			
		}else{
			return false;
		}
		
	}
	function ocultaProgramacion(){
		
		$("#contenidoIframe").slideUp("slow");
		$("#toggle_programacion").html("<a href=\"#\" onclick=\"javascript:muestraProgramacion(); return false;\" ><img id=\"manejaProgramacion\" src=\"img/btn_abre_programacion.jpg\" border=\"0\" /></a>");
		$("#toggleoff_programacion").hide();
		
	}
var boolAction = false;

//	  function moveNext(){
//	 	
//        var positionAux = $("#planes_img").css("left");   //Posicion izquierda del contenedor de las imagenes.
//      //  alert(positionAux);
//		var x = positionAux.substr(0,positionAux.length - 2 ); //Extraemos solo el valor numerico y lo dejamos en X.
//        var imgWidth = "";
//        var cont = 1;           
//        var idLast;
//        var idFirst;
//       var appName = navigator.appName;
//       if(boolAction == false){
//       	 	boolAction = true;
//	       //Recorremos todos los elementos hijos que sean imagenes dentro del contenedor de imagenes.
//	        $("#planes_img img").each(function(e){
//	            
//	            if(cont == 1){
//	            	//Guardamos en idFirst el valor del id del primer elemento.
//	                idFirst = this.id
//	            }
//	
//	            if(cont == $("#planes_img img").length){
//	            	//Guardamos en idLast el valor del id del ultimo elemento.
//	                idLast = this.id;
//	               
//	            }
//	            cont++;
//	        });
//		//	alert(idFirst);
//		//	alert(idLast);
//	        //Obtenemos el ancho del ultimo elemento.
//	        imgWidth = $("#"+idLast+"").css("width");
//	       //Extraemos la parte numerica del ancho y lo guardamos en wImg.
//	        wImg = imgWidth.substr(0,imgWidth.length - 2);
//	        //Pareseamos x y lo convertimos en entero.       
//	        x = parseInt(x);
//	         //Pareseamos wImg y lo convertimos en entero.       
//	        wImg = parseInt(wImg);
//	        
//	      
//	      	if(x >= 0){
//	        	x += wImg;
//	      	}
//			//alert(idLast)
//			//alert(idFirst)
//$("#"+idLast+"").clone(true).insertBefore("#"+idFirst+"");   
//			        $("#planes_img").stop().animate({left: x + "px"},"slow","",function(){
//					$("#planes_img img:last").remove()	
//					var z=x;
//					var y=Math.abs(x);
//					//$("#planes_img").css("left",y + "px");
//					$("#planes_img img:first").css("margin-left","-" + x +"px");
//					$("#planes_img img:last").css("margin-left","0px");
//	        			 boolAction = false;
//	       			 });
//	           	
//	        
//	        $("#"+idLast+"").css("margin-left","-" + x +"px");
//	        //$("#"+idLast+"").css("margin-left","0px");
//	      		 
//	        	if( appName != "Microsoft Internet Explorer"){
//	        		$("#"+idFirst+"").css("margin-left","0px");
//	        	}
//	        	
//       }
//        
//      return true;
// }
//  function movePrev(){
//        var positionAux = $("#planes_img").css("left");   //Posicion izquierda del contenedor de las imagenes.
//		//alert(positionAux);
//        var x = positionAux.substr(0,positionAux.length - 2 ); //Extraemos solo el valor numerico y lo dejamos en X.
//		//alert(x);
//        var imgWidth = "";
//        var cont = 1;           
//        var idLast;
//        var idFirst;
//		var idSecond;
//		var w;       
//       if(boolAction == false){
//       	 	boolAction = true;
//	       //Recorremos todos los elementos hijos que sean imagenes dentro del contenedor de imagenes.
//	        $("#planes_img img").each(function(e){
//	            
//	            if(cont == 1){
//	            	//Guardamos en idFirst el valor del id del primer elemento.
//	                idFirst = this.id
//	            }
//				
//				if(cont == 2){
//	            	//Guardamos en idFirst el valor del id del primer elemento.
//	                idSecond = this.id
//	            }
//	
//	            if(cont == $("#planes_img img").length){
//	            	//Guardamos en idLast el valor del id del ultimo elemento.
//	                idLast = this.id;
//	               
//	            }
//	            cont++;
//	        });
//			//alert(idFirst);
//			//alert(idSecond);
//			//alert(idLast);
//			//Obtenemos el ancho del ultimo elemento.
//	        imgWidth = $("#"+idLast+"").css("width");
//			//alert(imgWidth);
//	       //Extraemos la parte numerica del ancho y lo guardamos en wImg.
//	        wImg = imgWidth.substr(0,imgWidth.length - 2);
//	        //Pareseamos x y lo convertimos en entero.       
//	        x = parseInt(x);
//	         //Parseamos wImg y lo convertimos en entero.       
//	        wImg = parseInt(wImg);
//	      if(x <= 0){
//		  	w = wImg * -1;
//	      	x += w;
//	     	l = x;
//	     	if(l < 0 ){
//	     		l = l *-1;
//	     	}
//	      	
//	      }
//	      if(x > 0){
//	      	x -= wImg;
//	      	l = x;
//	      }
//	        $("#planes_img").stop().animate({left: x + "px"},"slow","",function(){
//							$("#"+idFirst+"").clone(true).insertAfter("#"+idLast+"");
//	        				$("#planes_img img:first").remove()	
//							var y=Math.abs(x);
//							$("#planes_img").css("left",y  + "px");
//							$("#"+idSecond+"").css("margin-left","-"+y +"px");
//							$("#planes_img img:last").css("margin-left","0px");
//	        	  			 boolAction = false;
//	        });	 	
//	        //	 $("#"+idFirst+"").css("margin-left", "0px");
//	        	if(navigator.appName != "Microsoft Internet Explorer"){
//	        		$("#"+idLast+"").css("margin-left","0px");
//	        	}
//       }
//        
//      return true;
//    }
function loadDestHome(){
	$.ajax({
		type   : "POST",
		url    : "inc/home/destacados_home.inc.php",
		data   : "actionHome=loadContent",
		success: function(http){
			$("#loading_home").hide();
		},
		complete : function(httpTransport){
			$("#destacados_home").fadeIn("slow",function(){
				$("#destacados_home").append(httpTransport.responseText)
			})
		}
	});
}
function loadPlanesHome(){
	
	$.ajax({
		type   : "POST",
		url    : "inc/home/planes_home.ajax.inc.php",
		data   : "action=loadContent",
		success: function(http){
			$("#loading_planes_home").remove();
		},
		complete : function(httpTransport){
			
				$("#planes_img").append(httpTransport.responseText);
		}
	});
}
