// Begin SABER tag

	// THE SABER TAG GOES HERE!!!

// End SABER tag


// banners
ordval=Math.floor (Math.random()*1000000);


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function GetDomain () {
var url = ""+window.location+"";
if (url.indexOf("terra.com.pr",0) != -1)
        pcountry = "pr";
else
        pcountry = "us";
}
GetDomain();

function mm(url,pref) {
        terratv = window.open("http://php.terra.com/terratv/video.php?video="+url, "terratv");
}


function audio(audiofile) {
	options = "scrollbars=no,height=200,width=285";
	newWindow = window.open("http://www.terra.com/multimedia/audio/audio.html?audio="+audiofile,'audio',options);
}

function openTvPlayer(szQs) {
        var szUrl = new String("http://multimedia.terra.com/ot_frameset.asp");
        if (szQs != "") {
                szUrl += szQs;
        }
	window.open(szUrl, "entplayer","height=615,width=800,toolbar=0,directories=0, location=0,status=0,scrollbars=1,resize=1,menubar=0,copyhistory=1");
}

function SearchIt () {
        if (document.fast.query.value == 0) {
                alert("ERROR: Has olvidado rellenar el campo de bœsqueda, que no puede dejarse en blanco");
                return false;
        }
        if (document.fast.query.length < 3) {
                alert("ERROR: La palabra de bœsqueda debe tener m‡s de 3 caracteres");
                return false;
        }
	if (document.fast.multimedia.length == null) {
                document.fast.method = "get";
                document.fast.action = "http://buscador.terra.com/default.asp";
        } else {
                for (var i=0;i<document.fast.multimedia.length;i++) {
	                if (document.fast.multimedia[i].checked) {
	                        if (document.fast.multimedia[i].value == "image") {
	                                document.fast.action = "/cgi-bin/fast/legal.pl";
	                                document.fast.catalog.value = "image";
	                                document.fast.cgi.value="mm.pl";
	                        }
	                        if (document.fast.multimedia[i].value == "audio") {
	                                document.fast.action = "/cgi-bin/fast/legal.pl";
	                                document.fast.catalog.value = "audio";
	                                document.fast.cgi.value="mm.pl";
	                        }
	                        if (document.fast.multimedia[i].value == "video") {
	                                document.fast.action = "/cgi-bin/fast/legal.pl";
	                                document.fast.catalog.value = "video";
	                                document.fast.cgi.value="mm.pl";
	                        }
	                        if (document.fast.multimedia[i].value == "cancion")  {
	                                document.fast.action = "/cgi-bin/fast/legal.pl";
	                                document.fast.cgi.value="audio.pl";
	                        }
	                        if (document.fast.multimedia[i].value == "descargas")  {
	                                document.fast.action = "/cgi-bin/fast/ftp.pl";
	                        }
	                        if (document.fast.multimedia[i].value == "letra") {
	                                document.fast.action = "/cgi-bin/fast/legal.pl";
	                                document.fast.cgi.value = "lyrics.pl";
	                        }
	                        if (document.fast.multimedia[i].value == "multimedia") {
	                                document.fast.action = "/cgi-bin/fast/legal.pl";
	                                document.fast.catalog.value = "all";
	                                document.fast.cgi.value="mm.pl";
	                        }
	                        if (document.fast.multimedia[i].value == "internet") {
	                                document.fast.method = "get";
	                                document.fast.action = "http://buscador.terra.com/default.asp";
	                        }
	                        document.fast.submit();
                        }
                }
	}
}

function dealtimesearch () {
	 document.dealtime.action = "http://terra.dealtime.com/xKW-" + document.dealtime.searchparam.value + "/FD-0/nFormID-0/NS-1/keyword-sony/NS-1/linkin_id-3003647/GS.html?header=us";
        document.dealtime.submit();
}

function pgSearch () {
	document.pg.action = "http://terra.pricegrabber.com/search_gen_top.php/form_keyword=" + document.pg.keyword.value + "/mode=terra_channelsearch";
	document.pg.submit();
}



function mOvr(src,clrOver) {
  if (!src.contains(event.fromElement)) {
         src.style.background = clrOver;
        }
}
function mOut(src,clrIn) {
  if (!src.contains(event.toElement)) {
         src.style.background = clrIn;
        }
}




// tabs
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}



function encode_utf8(txt) {
    txt = txt.replace(/\r\n/g,"\n");
    var utf = "";
    for(var n=0; n<txt.length; n++) {
        var c=txt.charCodeAt(n);
        if (c<128)
            utf += String.fromCharCode(c);
        else if((c>127) && (c<2048)) {
            utf += String.fromCharCode((c>>6)|192);
            utf += String.fromCharCode((c&63)|128);
        } else {
            utf += String.fromCharCode((c>>12)|224);
            utf += String.fromCharCode(((c>>6)&63)|128);
            utf += String.fromCharCode((c&63)|128);
        }
    }
    return utf;
}


//tabs

function showTab(tab) {
    MM_showHideLayers('tab1','','hide','tab2','','hide','tab3','','hide','tab4','','hide','tab5','','hide','tab6','','hide');
	
    switch(tab) {
	case 1: 
		MM_showHideLayers('tab1','','show');
                MM_showHideLayers('tabfija','','show');
		break;
	case 2:
		MM_showHideLayers('tab2','','show');
                MM_showHideLayers('tabfija','','show');
		break;
	case 3:
		MM_showHideLayers('tab3','','show');
                MM_showHideLayers('tabfija','','show');
		break;
	case 4:
                MM_showHideLayers('tabfija','','show');
                MM_showHideLayers('tab4','','show');
		break;
	case 5:	
                MM_showHideLayers('tabfija','','hide');
		tabImpression();
		MM_showHideLayers('tab5','','show');
                //MM_showHideLayers('tabfija','','show');
		break;
	case 6:
		MM_showHideLayers('tab6','','show');
                MM_showHideLayers('tabfija','','show');
		break;
        case 99:
                MM_showHideLayers('tabfija','','show');
                MM_showHideLayers('tab1','','show');
		document.write('99');
		//alert('99');
                break;
	case 0:
		MM_showHideLayers('tab1','','show');
                MM_showHideLayers('tabfija','','show');
                break;
    }
}

// Flash
if(Browser == undefined){
var Browser = {
isIE: function(){ return (window.ActiveXObject && document.all && navigator.userAgent.toLowerCase().indexOf("msie") > -1 && navigator.userAgent.toLowerCase().indexOf("opera") == -1) ? true : false; }
}
}

var Flash = function(movie, id, width, height, initParams){

this.html = "";
this.attributes = this.params = this.variables = null;

this.variables = new Array();
this.attributes = {
"classid": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
"codebase": "http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version=8,0,22,0",
"type": "application/x-shockwave-flash"
}
this.params = { "pluginurl": "http://www.macromedia.com/go/getflashplayer_br" };

if(movie) {
this.addAttribute("data", movie);
this.addParameter("movie", movie);
}

if(id && id != null) this.addAttribute("id", id);
if(width) this.addAttribute("width", width);
if(height) this.addAttribute("height", height);

if(initParams != undefined){
for(var i in initParams){
this.addParameter(i.toString(), initParams[i]);
}
}

}
Flash.version = "1.2b";
Flash.getObjectByExceptions = function(obj, excep){
var tempObj = {};
for(var i in obj){
var inclui = true;
for(var j=0; j<excep.length; j++)
if(excep[j] == i.toString()) { inclui = false; break; };
if(inclui) tempObj[i] = obj[i];
}
return tempObj;
}
Flash.prototype.addAttribute = function(prop, val){ this.attributes[prop] = val; }
Flash.prototype.addParameter = function(prop, val){ this.params[prop] = val; }
Flash.prototype.addVariable = function(prop, val){ this.variables.push([prop, val]); }
Flash.prototype.getFlashVars = function(){
var tempString = new Array();

for(var i=0; i<this.variables.length; i++)
tempString.push(this.variables[i].join("="));

return tempString.join("&");
}
Flash.prototype.toString = function(){

this.params.flashVars = this.getFlashVars();
if(Browser.isIE()){
//IE
this.html = "<ob" + "ject";
var attr = Flash.getObjectByExceptions(this.attributes, ["type", "data"]);
for(var i in attr) if(i.toString() != "extend") this.html += " " + i.toString() + " = \"" + attr[i] + "\"";
this.html += "> ";
var params = Flash.getObjectByExceptions(this.params, ["pluginurl", "extend"]);
for(var i in params) if(i.toString() != "extend") this.html += "<param name=\"" + i.toString() + "\" value=\"" + params[i] + "\" /> ";
this.html += " </obj" + "ect>";
} else {
//non-IE
this.html = "<!--[if !IE]> <--> <obj" + "ect";
var attr = Flash.getObjectByExceptions(this.attributes, ["classid", "codebase"]);
for(var i in attr) if(i.toString() != "extend") this.html += " " + i.toString() + " = \"" + attr[i] + "\"";
this.html += "> ";
var params = Flash.getObjectByExceptions(this.params, ["extend"]);
for(var i in params) if(i.toString() != "extend") this.html += "<param name=\"" + i.toString() + "\" value=\"" + params[i] + "\" /> ";
this.html += " </obj" + "ect> <!--> <![endif]-->";
}

return this.html;

}
Flash.prototype.write = Flash.prototype.outIn = Flash.prototype.writeIn = function(w){
if(typeof w == "string" && document.getElementById) var w = document.getElementById(w);
if( w != undefined && w ) w.innerHTML = this.toString();
else document.write( this.toString() );
}

function FlashInstalled()
{
result = false;
if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"])
{
result = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
}
else if (document.all && (navigator.appVersion.indexOf("Mac")==-1))
{
eval ('try {var xObj = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if (xObj) result = true; xObj = null; } catch (e) {}');
}
return result;
}

// End Flash
