/*
activateActiveX
---------------
Purpose:  Dynamically replace any elements that will be affected by the new security feature in IE6/IE7 that requires a user to click certain types of elements to activate them before use.

Usage:  Include this file at the end of your html document using the following...
	<script language="JScript" type="text/jscript" src="activateActiveX.js"></script>
	


Since this script is in response to a software patent lawsuit, I feel it necessary to state the following...	

License:
activateActiveX is Copyright (C) 2006 Jason Baker (therippa AT gmail.com). It is available as open source code from:
http://therippa.blogspot.com

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details http://www.gnu.org/licenses/gpl.html
*/


//Determine browser, we only need this for Internet Explorer
if (navigator.appName == "Microsoft Internet Explorer") {
	
	//Array of elements to be replaced
	var arrElements = new Array(3);
	arrElements[0] = "object";
	arrElements[1] = "embed";
	arrElements[2] = "applet";

	
	//Loop over element types
	for (n = 0; n < arrElements.length; n++) {
	
		//set object for brevity
		replaceObj = document.getElementsByTagName(arrElements[n]);
		
		//loop over element objects returned
		for (i = 0; i < replaceObj.length; i++ ) {
		
			//set parent object for brevity
			parentObj = replaceObj[i].parentNode;
			
			//grab the html inside of the element before removing it from the DOM
			newHTML = parentObj.innerHTML;
			
			//remove element from the DOM
			parentObj.removeChild(replaceObj[i]);
			
			//stick the element right back in, but as a new object
			parentObj.innerHTML = newHTML;
		
			}
		}
	}
	
var ventanaBusqueda = null;
var fotoAux1 = new Image();


function agregar_favoritos (titulo)
{
	var url = "http://" + window.location.hostname;
	if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4))
	{
		window.external.AddFavorite (url, titulo);
	}
	else
	{ 
		if (navigator.appName == "Netscape") 
			window.alert ("Presione Crtl+D para agregar este sitio en sus Bookmarks"); 
		 	//window.external.AddFavorite(url,titulo);
	}
}
function agregar_inicio(){
	//incluye esta línea justamente al comienzo del body
	//<IE:HOMEPAGE ID="obj_pagina_inicio" />
	var url = "http://" + window.location.hostname;
	obj_pagina_inicio.style.behavior = 'url(#default#homepage)';
	obj_pagina_inicio.setHomePage (url);
}

function openWindow (url, name, w, h, scrollbars, resizable, otras)
{
	 window.open (url, name,"width=" + w + ", height=" + h + ", scrollbars=" + scrollbars + ", resizable=" + resizable + ", status=yes");
}


function verFotoFlash (urlFoto){
	openWindow ("visor.php?foto="+urlFoto, "ventanaBusqueda",600, 520, "no", "no");
}

function runSWF(archivo, ancho, alto, version, bgcolor, id, menu, FlashVars, quality, allowScriptAccess) { // tutorial by IVI CONCEPT - www.ivi-concept.com
	if(version!=""){
		var version_data=version;
	}else{
		var version_data="6,0,0,0";
	}
	if(menu!=""){
		menu_data=menu;
	}else{
		menu_data=false;
	}
	if(bgcolor!=""){
		var bgcolor_data=bgcolor;
	}else{
		var bgcolor_data="#FFFFFF";
	}
	if(id!=""){
		id_data=id;
	}else{
		id_data="flashMovie";
	}
	if(quality!=""){
		quality_data=quality;
	}else{
		quality_data="high";
	}
	if(allowScriptAccess!=""){
		allowScriptAccess_data=allowScriptAccess;
	}else{
		allowScriptAccess_data="always";
	}
	var quality="high"; // calidad de visualización de la peli
	 document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+version_data+'" width='+ancho+' height='+alto+' id='+id_data+'>\n');
	 document.write('<param name="movie" value='+archivo+'>\n');
	 document.write('<param name="allowScriptAccess" value='+allowScriptAccess_data+'>\n');
	 document.write('<param name="quality" value='+quality_data+'>\n');
	 document.write('<param name="FlashVars" value='+FlashVars+'>\n');
	 document.write('<param name="bgcolor" value='+bgcolor_data+'>\n');
	 document.write('<param name="menu" value='+menu_data+' >\n');
	 document.write('<embed src='+archivo+' bgcolor='+bgcolor_data+' FlashVars='+FlashVars+' menu='+menu_data+' allowScriptAccess='+allowScriptAccess_data+' quality='+quality_data+' pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width='+ancho+' height='+alto+' swLiveConnect=true name='+id_data+'></embed>');
	 document.write('</object>\n');
}

