var AFNet= new Array();

AFNet['loadFile']= function (pagina,divcontent,cache) {
  if (pagina.indexOf("?")== -1) pagina= pagina+ '?';
  if (cache=true)		pagina= pagina+ '&randomnumber='+ Math.floor(Math.random()*10000);

  $('#'+ divcontent)
	  .css('position', 'relative')
	  .prepend("<img src='imagenes/loading.gif' style='position: absolute; left: 50%; z-index:1001; top: 50%; height: 32px; margin-top: -16px; width: 32px; margin-left: -16px;' />")
	  .prepend("<div style='background-color:#FFF; position:absolute; z-index:1000; top:0; left:0; right:0; bottom:0; opacity:0.9; filter:alpha(opacity=90);'></div>")
	  .load(pagina, function() {
		$(this)
			.hide()
			.fadeIn(500, function(){
				$(this).show()
			});
	  });
}


AFNet['activarBoton']= function(divBoton) {
  $('#'+ divBoton).addClass('activo');
}



$(document).ready(function() {
  var flashvars = {xmlPath: "./banner/slideshow.xml?rand="+ Math.floor(Math.random()*10)};
  var params = {wmode: "transparent", menu: "false"};
  swfobject.embedSWF("./banner/banner.swf", "splash", "624", "107", "8","", flashvars, params, "");  


  $(".boxed2 ul").hide();  
  
  $('.boxed1 h2').click(function() {
	estado= $(this).attr('class');
	
	if (estado== 'up') {
		$(this).attr('class','down');
	  	$(".boxed1 ul").slideUp('slow');

	}else{
		$(this).attr('class','up');
	  	$(".boxed1 ul").slideDown('slow');

	}
  }).click();

  $('.boxed2 h2').click(function() {
	estado= $(this).attr('class');
	
	if (estado== 'up') {
		$(this).attr('class','down');
	  	$(".boxed2 ul").slideUp('slow');

	}else{
		$(this).attr('class','up');
	  	$(".boxed2 ul").slideDown('slow');

	}
  }).click();

  $('.boxed3 h2').click(function() {
	estado= $(this).attr('class');
	
	if (estado== 'up') {
		$(this).attr('class','down');
	  	$(".boxed3 ul").slideUp('slow');

	}else{
		$(this).attr('class','up');
	  	$(".boxed3 ul").slideDown('slow');

	}
  }).click();

  $('.boxed4 h2').click(function() {
	estado= $(this).attr('class');
	
	if (estado== 'up') {
		$(this).attr('class','down');
	  	$(".boxed4 ul").slideUp('slow');

	}else{
		$(this).attr('class','up');
	  	$(".boxed4 ul").slideDown('slow');

	}
  }).click();  
});

