function pongoflash(pelicula,ancho,alto,link,destino){
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='"+ancho+"' height='"+alto+"'>");
	document.write("<param name='movie' value='"+pelicula+"?link="+link+"&destino="+destino+"' />");
	document.write("<param name='quality' value='high' />");
	document.write("<param name='wmode' value='transparent' />");
	document.write("<embed src='"+pelicula+"?link="+link+"&destino="+destino+"' wmode='transparent' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='"+ancho+"' height='"+alto+"'></embed>");
	document.write("</object>");
}
function show_solapa(cual){	if(solapa_sel!=cual){for(i=1 ; i <= 5 ; i++){if(document.getElementById('solapa'+i)) {var solapa = document.getElementById('solapa'+i);var pagina = document.getElementById('cont'+i);if(i==cual){solapa.className="solapa_h";pagina.style.display = "inline";solapa_sel=i;}else{solapa.className="solapa";pagina.style.display = "none";}}}}}
function equalHeight2(group) { group.height("auto");	var tallest = 0; group.each(function() {var thisHeight = $(this).height();if(thisHeight > tallest) { tallest = thisHeight;}});group.height(tallest);}
function FormatNumber(num, decimalNum, bolLeadingZero, bolParens)
/* IN - num:            the number to be formatted
	   decimalNum:     the number of decimals after the digit
	   bolLeadingZero: true / false to use leading zero
	   bolParens:      true / false to use parenthesis for - num

  RETVAL - formatted number
*/
{
   var tmpNum = num;

   // Return the right number of decimal places
// tmpNum *= Math.pow(10,decimalNum);
//	alert(tmpNum);
// tmpNum = Math.floor(tmpNum);
//	alert(tmpNum);
// tmpNum /= Math.pow(10,decimalNum);


   var tmpStr1 = new String(num);
	var pos_decimal;
	pos_decimal = tmpStr1.indexOf(".");
	if(pos_decimal== -1)
	{
		tmpStr1 = tmpStr1 + ".";
		pos_decimal = tmpStr1.length;
	}
	for(var i=0; i<decimalNum; i++)
	{
		tmpStr1 = tmpStr1 + "0";
	}
	var tmpStr = tmpStr1.substr(0,(parseInt(pos_decimal) + parseInt(decimalNum) + 1 ));
	

   // See if we need to hack off a leading zero or not
   if (!bolLeadingZero && num < 1 && num > -1 && num !=0)
	   if (num > 0)
		   tmpStr = tmpStr.substring(1,tmpStr.length);
	   else
		   // Take out the minus sign out (start at 2)
		   tmpStr = "-" + tmpStr.substring(2,tmpStr.length);


   // See if we need to put parenthesis around the number
   if (bolParens && num < 0)
	   tmpStr = "(" + tmpStr.substring(1,tmpStr.length) + ")";


   return tmpStr;
}

function mainmenu(){
	$(" #nav2 ul ").css({display: "none"}); // Opera Fix
	$(" #nav2 li").hover(function(){
			$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(100);
			},function(){
			$(this).find('ul:first').css({visibility: "hidden"});
			});

	$(" #nav ul ").css({display: "none"}); // Opera Fix
	$(" #nav li").hover(function(){
			$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(100);
			},function(){
			$(this).find('ul:first').css({visibility: "hidden"});
			});
}

$(document).ready(function() {
			$("#fan_suscrip").fancybox({
				'width'				: '40%',
				'height'			: '65%',
				'autoScale'			: true,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
			$(".fan_suscrip2").fancybox({
				'width'				: '50%',
				'height'			: '40%',
				'autoScale'			: true,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
			$("#acercade").fancybox({
				'width'				: '22%',
				'height'			: '90%',
				'autoScale'			: true,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
			$("#recomenda").fancybox({
				'width'				: '30%',
				'height'			: '60%',
				'autoScale'			: true,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
			$("#recomdet").fancybox({
				'width'				: '45%',
				'height'			: '80%',
				'autoScale'			: true,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
			$(".detalleprint").fancybox({
				'width'				: '45%',
				'height'			: '95%',
				'autoScale'			: true,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
			$("#generaexcel").fancybox({
				'width'				: '30%',
				'height'			: '45%',
				'autoScale'			: true,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
			$(".btnpreguntas").fancybox({
				'width'				: '30%',
				'height'			: '55%',
				'autoScale'			: true,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});	
			$("#ampliar").fancybox({
				'width'				: '60%',
				'height'			: '100%',
				'autoScale'			: true,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});					
			
			
			mainmenu();
});

var XMLHttpRequestObject = false;

if (window.XMLHttpRequest) {
XMLHttpRequestObject = new XMLHttpRequest();
// XMLHttpRequestObject.overrideMimeType("text/xml");
} else if (window.ActiveXObject) {
XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
}

function cuentaBanner(inValor){
	if(XMLHttpRequestObject) {
	  XMLHttpRequestObject.open("GET", "seguir_banner.php3?banner=" + inValor, true);

	  XMLHttpRequestObject.send(null);
	}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function popup(ancho, alto, url, nombre) {
	resx = screen.width;
	resy = screen.height;
	posx = (resx-ancho)/2;
	posy = (resy-alto)/2;
	window.open(url,nombre,"width="+ancho+",height="+alto+", top=50,left="+posx+", toolbar=no, resizable, scrollbars=yes");
}

function equalHeight(group) {
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}
