





function loadActividades(){
  
var xmlhttp;    

if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("box1_activities").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","activities.php",true);
xmlhttp.send();
  
}

function loadConcursos(){
  
  var xmlhttp;    

if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("concursosContainer").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","concursos.php",true);
xmlhttp.send();
}

 $('#defaultCube4').click(tb_show('Magic Reflexiones', 'http://www.magic973.com/reflexiones/?keepThis=true&TB_iframe=true&height=440&width=902', null));
 
 



function pageLoad(){
 
}
var inte;
var c=0;
var t;
var timer_is_on=0;
function closeAdFloat()
{ 
 $("#adBoxCentral").fadeOut("fast");
}

$(document).ready(function() {
 
loadActividades();
 loadConcursos();
 
 inte=window.setInterval("rotateList('banner')",7500);
 
     $("ul.demo1").ytplaylist({addThumbs:true, autoPlay: false, holderId: 'ytvideo'});
      
     $('#closeAd').click(
								       
			     function(){ 
				     $("#adBoxCentral").fadeOut("fast");
			     });
      
     $('#livesMagic2').click(
								       
			     function(){ 
				     window.location = "http://magic973.dyndns-ip.com:1162/listen.pls";
			     
			     }); 
     $('#bnr_liberty1').click(
								       
			     function(){ 
				     //window.open("http://www.libertypr.com/");
				     window.open("http://www.libertyincreible.com/");
			     
			     });
     
     function clickBanner(){
       window.open("http://www.libertyincreible.com/");
     }
     
     $('#bnr_liberty_hit').click(
								       
			     function(){ 
				     //window.open("http://www.libertypr.com/");
				     window.open("http://www.libertyincreible.com/");
			     
			     });
     
     $('#bnr_liberty_hit2').click(
								       
			     function(){ 
				     //window.open("http://www.libertypr.com/");
				     window.open("http://www.libertyincreible.com/");
			     
			     });
     
     
     $('#bnr_liberty2').click(
								       
			     function(){ 
				     //window.open("http://www.libertypr.com/");
				     window.open("http://www.libertyincreible.com/");
			     
			     });
			     
     /*$('#liberty1a').click(
								       
			     function(){ 
				     window.open("http://www.libertyincreible.com/");
			     
			     });
			     
     $('#liberty2a').click(
								       
			     function(){ 
				     window.open("http://www.libertyincreible.com/");
			     
			     });*/
			     
     function openLiberty(){
	     window.open("http://www.libertypr.com/"); 
     }
      
     /*$('#image').click(
								       
			     function(){ 
				     window.open("juniorcelestino.html");
			     
			     });	*/		
	     
     $('#voceroLinkbox').click(
								       
			     function(){ 
				     window.open("http://vocero.com");
			     
			     });			
     $('#ctprfc').click(
								       
			     function(){ 
				 $('#adsRightbannerFirst').disable = true;
				     window.open("http://www.facebook.com/pages/close-to-puertorico/113908811989534");
			     
			     });
      
     $('#botonVolver1').click(
								       
			     function(){ 
				     $("#ipadBox4").fadeOut("fast");
				     $("#ipadBox2").fadeOut("fast");
				     $("#ipadBox3").fadeOut("fast");
				     $("#ipadBox1").fadeOut("fast");
				     $("#ipadBox5").fadeOut("fast");
				 $("#slideShowBox").fadeIn("slow");
				 $("#adsRightbannerFirst").fadeIn("slow");
				 $("#twetterBox").fadeIn("slow");
			     
			     });		
				     
     $('#botonVolver2').click(
								       
			     function(){ 
				     $("#ipadBox4").fadeOut("fast");
				     $("#ipadBox2").fadeOut("fast");
				     $("#ipadBox3").fadeOut("fast");
				     $("#ipadBox1").fadeOut("fast");
				     $("#ipadBox5").fadeOut("fast");
				 $("#slideShowBox").fadeIn("slow");
				 $("#adsRightbannerFirst").fadeIn("slow");
				 $("#twetterBox").fadeIn("slow");
			     
			     });	
     $('#botonVolver3').click(
								       
			     function(){ 
				     $("#ipadBox4").fadeOut("fast");
				     $("#ipadBox2").fadeOut("fast");
				     $("#ipadBox3").fadeOut("fast");
				     $("#ipadBox1").fadeOut("fast");
				     $("#ipadBox5").fadeOut("fast");
				 $("#slideShowBox").fadeIn("slow");
				 $("#adsRightbannerFirst").fadeIn("slow");
				 $("#twetterBox").fadeIn("slow");
			     
			     });		
     $('#botonVolver4').click(
								       
			     function(){ 
				     $("#ipadBox4").fadeOut("fast");
				     $("#ipadBox2").fadeOut("fast");
				     $("#ipadBox3").fadeOut("fast");
				     $("#ipadBox1").fadeOut("fast");
				     $("#ipadBox5").fadeOut("fast");
				 $("#slideShowBox").fadeIn("slow");
				 $("#adsRightbannerFirst").fadeIn("slow");
				 $("#twetterBox").fadeIn("slow");
			     
			     });
     
     

	 //bannerTimer = window.setInterval("rotateList('banner')",7000);
		//$("ul#banner").jBanner({height:104,width:902,borderSize:'0',borderStyle:'solid',borderColor:'F00',padding:0,margin:0,caption:false,cheight:35,delay:10500,speed:1000});
		
		//$("ul#banner2").jBanner({height:69,width:516,borderSize:'0',borderStyle:'solid',borderColor:'F00',padding:0,margin:0,caption:false,cheight:35,delay:5000,speed:1000});
		
		//$("ul#banner3").jBanner({height:79,width:253,borderSize:'0',borderStyle:'solid',borderColor:'F00',padding:0,margin:0,caption:false,cheight:35,delay:5000,speed:1000});

	
	//$("ul#banner4").jBanner({height:79,width:253,borderSize:'0',borderStyle:'solid',borderColor:'F00',padding:0,margin:0,caption:false,cheight:35,delay:5000,speed:1000});
	
	
	

      
		
});


function launchPOPUP(){
 newWindow('http://www.magic973.com/promoapp.html','','696','450','');
}



function rotateList(id){

var list = document.getElementById(id);

var first = list.removeChild(list.firstChild);

list.appendChild(first);

}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=400,left = 440,top = 312');");
}



// Centered Pop-Up Window (v1.0)
// (C) 2002 www.smileycat.com
// Free for all users, but leave in this header

var win = null;
function newWindow(mypage,myname,w,h,features) {
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  if (winl < 0) {winl = 0;}
  if (wint < 0) {wint = 0;}
  var settings = 'height=' + h + ',';
  settings += 'width=' + w + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += features;
  win = window.open(mypage,myname,settings);
  win.window.focus();
}

