function getFlashObject( name )
{
	if( window.document[name] ) return window.document[name];

	if( navigator.appName.indexOf("Microsoft Internet") == -1 )
	{
		if( document.embeds && document.embeds[name] )	return document.embeds[name];
		else											return null;
	}

	return document.getElementById(name);
}


function Att( oid )
{
	fo= getFlashObject("swfapp");
	if( fo == null )
	{
		alert("Cannot find Flash html object");
		return;
	}

	res= fo.ClickedOid(oid);
}

function GetUrl()
{
    return window.location.href;
}
function GetUrlParam( paramName )
{
    var rtn = "";
    var url = window.location.href;
    paramName = paramName.toUpperCase();
    if (url.indexOf("?") > -1 )
    {
        var queryString = url.substr(url.indexOf("?") + 1);
        var params = queryString.split("&");
        for ( var i = 0; i < params.length; i++ )
        {
            var ps = params[i].split("=");
            if (ps[0].toUpperCase() == paramName)
            {
                rtn = ps[1];
                break;
            }
        }
    }
    return rtn;
} 

function clipboardCopyText(s){ 
  window.clipboardData.setData("Text", s); 
}

//function AddFavorites(url)
//{
//	var url = window.location.href.split('?')[0] + "?";
//	
//	if (x1 != -1 && y1 != -1 && x2 != -1 && y2 != -1 && zone != -1)
//		url = url + "ube=" + x1 + ";" + y1 + ";" + x2 + ";" + y2 + ";" + zone;
//	
//	if (navigator.appVersion.indexOf("Mac",0)>0)
//	{
//		alert("Esta funci" + decodeURI('%c3%b3') + "n no puede ejecutarse en Macintosh.\n Utiliza la combinaci" + decodeURI('%c3%b3') + "n de teclas Command D");
//	}

//	
//	else if(window.external && (navigator.platform == "Win32" || 
//								(window.ScriptEngine && ScriptEngine().indexOf("InScript") + 1 )))
//	{
//		//IE Win32 or iCab - checking for AddFavorite produces errors for no
//		//good reason, so I use a platform and browser detect.
//		//adds the current page page as a favourite; if this is unwanted,
//		//simply write the desired page in here instead of "location.href"
//		return window.external.AddFavorite(url, document.title );
//	}	
//	else if(window.sidebar && window.sidebar.addPanel)
//	{
//		//Gecko (Netscape 6 etc.) - add to Sidebar
//		return window.sidebar.addPanel("Visor Sigpac", url, "");
//	}
//	else if(window.opera && window.print) 
//	{
//		//Opera 6+ - add as sidebar panel to Hotlist
//		window.alert("El navegador no soporta la funci" + decodeURI('%c3%b3') + "n A" + decodeURI('%c3%b1') + "adir a Favoritos.\nPresiona Ctrl+T para a" + decodeURI('%c3%b1') + "adir un marcador de la p" + decodeURI('%c3%a1') + "gina.");
//	}
//	else if(document.layers) 
//	{
//		//NS4 &amp; Escape - tell them how to add a bookmark quickly (adds current page,
//		//not target page)
//		window.alert("El navegador no soporta la funci" + decodeURI('%c3%b3') + "n A" + decodeURI('%c3%b1') + "adir a Favoritos.\nPresiona Ctrl+D para a" + decodeURI('%c3%b1') + "adir un marcador de la p" + decodeURI('%c3%a1') + "gina.");
//	}
//	else 
//	{
//		//other browsers - tell them to add a bookmark (adds current page, not target page)
//		window.alert("El navegador no soporta la funci" + decodeURI('%c3%b3') + "n A" + decodeURI('%c3%b1') + "adir a Favoritos.\nUsa los marcadores de tu navegador para a" + decodeURI('%c3%b1') + "adir marcador de la p" + decodeURI('%c3%a1') + "gina.");
//	}
//	return false;
//}

function AddFavorites(url) 
{
    if (navigator.appVersion.indexOf("Mac", 0) > 0) {
        alert("Esta funci" + decodeURI('%c3%b3') + "n no puede ejecutarse en Macintosh.\n Utiliza la combinaci" + decodeURI('%c3%b3') + "n de teclas Command D");
    }
    else if (window.sidebar) {
        //Gecko (Netscape 6 etc.) - add to Sidebar
        return window.sidebar.addPanel(document.title, url, "");
    }
    else if (window.external && (navigator.platform == "Win32" ||
								(window.ScriptEngine && ScriptEngine().indexOf("InScript") + 1))) {
        //IE Win32 or iCab - checking for AddFavorite produces errors for no
        //good reason, so I use a platform and browser detect.
        //adds the current page page as a favourite; if this is unwanted,
        //simply write the desired page in here instead of "location.href"
        return window.external.AddFavorite(url, document.title);
    }
//    else if (window.opera) {
        //Opera 6+ - add as sidebar panel to Hotlist
//        window.alert("El navegador no soporta la funci" + decodeURI('%c3%b3') + "n A" + decodeURI('%c3%b1') + "adir a Favoritos.\nPresiona Ctrl+D para a" + decodeURI('%c3%b1') + "adir un marcador de la p" + decodeURI('%c3%a1') + "gina.");

//        a = document.createElement("A");
//        a.rel = "sidebar";
//        a.target = "_search";
//        a.title = title;
//        a.href = url;
//        a.click();
          
//          var elem = document.createElement('a');
//          elem.setAttribute('href',url);
//          elem.setAttribute('title',title);
//          elem.setAttribute('rel','sidebar');
//          elem.click();

//    }
    else if (document.layers || window.opera) {
        //NS4 &amp; Escape - tell them how to add a bookmark quickly (adds current page,
        //not target page)
        window.alert("El navegador no soporta la funci" + decodeURI('%c3%b3') + "n A" + decodeURI('%c3%b1') + "adir a Favoritos.\nPresiona Ctrl+D para a" + decodeURI('%c3%b1') + "adir un marcador de la p" + decodeURI('%c3%a1') + "gina.");
    }
    else {
        //other browsers - tell them to add a bookmark (adds current page, not target page)
        window.alert("El navegador no soporta la funci" + decodeURI('%c3%b3') + "n A" + decodeURI('%c3%b1') + "adir a Favoritos.\nUsa los marcadores de tu navegador para a" + decodeURI('%c3%b1') + "adir marcador de la p" + decodeURI('%c3%a1') + "gina.");
    }
    return false;
}
