// JavaScript Document

//Flash Fixers
function flashfixie(url,ancho,alto,boton,boton_link)
{	
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase= "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width=' + ancho + ' height=' + alto + '>\n');
	document.write('<param name="movie" value=' + url + ' />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<PARAM NAME=FlashVars VALUE="boton=' + boton + '&boton_link=' + boton_link + '">');
	document.write('<embed src=' + url + ' FlashVars="boton=' + boton + '&boton_link=' + boton_link + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width=' + ancho + ' height=' + alto + '></embed>\n');
	document.write('</object>\n');
};

function flashnoticias(url,ancho,alto,titulo,detalle,fecha)
{	
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase= "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width=' + ancho + ' height=' + alto + '>\n');
	document.write('<param name="movie" value=' + url + ' />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<PARAM NAME=FlashVars VALUE="titulo=' + titulo + '&detalle=' + detalle + '&fecha=' + fecha + '">');
	document.write('<embed src=' + url + ' FlashVars="titulo=' + titulo + '&detalle=' + detalle + '&fecha=' + fecha + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width=' + ancho + ' height=' + alto + '></embed>\n');
	document.write('</object>\n');
};

//forms admin y demas
function $(element){
	// $(id);
	if (arguments.length > 1){
		for (var i = 0, elements = [], length = arguments.length; i < length; i++)
			elements.push($(arguments[i]));
		return elements;
	}
	if (typeof element == 'string')
		element = document.getElementById(element);
	return element;
}
/*
 
Correctly handle PNG transparency in Win IE 5.5 & 6.
http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006.

Use in <HEAD> with DEFER keyword wrapped in conditional comments:
<!--[if lt IE 7]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->

*/
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

if ((version >= 5.5) && (document.body.filters)) 
{
   for(var i=0; i<document.images.length; i++)
   {
      var img = document.images[i]
      var imgName = img.src.toUpperCase()
      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
      {
         var imgID = (img.id) ? "id='" + img.id + "' " : ""
         var imgClass = (img.className) ? "class='" + img.className + "' " : ""
         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
         var imgStyle = "display:inline-block;" + img.style.cssText 
         if (img.align == "left") imgStyle = "float:left;" + imgStyle
         if (img.align == "right") imgStyle = "float:right;" + imgStyle
         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
         var strNewHTML = "<span " + imgID + imgClass + imgTitle
         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
         img.outerHTML = strNewHTML
         i = i-1
      }
   }
}
