var RompepaginaActivo = false;
var urlRichMedia = "http://www.nacionadserver.com/nacion/servlet/view/banner/html/campaign?cid=348&pid=0";

var RPWidth  = 370;
var RPHeight = 415;

var flashinstalled = 0;
var flashversion   = 0;

var ns =(document.layers);
var ie =(document.all);
var w3 =(document.getElementById && !ie);


if ( RompepaginaActivo ) {
   if ( get_cookie('richm-nacionales') == '') {
      mostrarRichMedia(urlRichMedia);
      document.cookie = "richm-nacionales=yes; path=/";
   }
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function mostrarRichMedia(urlMedia) {
	if ( navigator.plugins && navigator.plugins.length ) {
		x = navigator.plugins["Shockwave Flash"];
		if (x) {
			flashinstalled = 2;
			if (x.description) {
				y = x.description;
				flashversion = y.charAt(y.indexOf('.')-1);
			}
		} else {
			flashinstalled = 1;
		}

		if (navigator.plugins["Shockwave Flash 2.0"]) {
			flashinstalled = 2;
			flashversion = 2;
		}
	} else if ( navigator.mimeTypes && navigator.mimeTypes.length ) {
		x = navigator.mimeTypes['application/x-shockwave-flash'];
		if (x && x.enabledPlugin) {
			flashinstalled = 2;
		} else {
			flashinstalled = 1;
		}
	} else {
		document.writeln('<SCR' + 'IPT LANGUAGE="VBScript">');
		document.writeln('on error resume next');
		document.writeln('For i = 2 To 8');
		document.writeln('MessageBox i');
		document.writeln('   If IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i)) Then');
		document.writeln('      flashinstalled = 2');
		document.writeln('      flashversion   = i');
		document.writeln('   End If');
		document.writeln('Next');
		document.writeln('If flashinstalled = 0 Then');
		document.writeln('   flashinstalled = 1');
		document.writeln('End If');
		document.writeln('</SCR' + 'IPT>');
	}

	if ( flashinstalled == 2 ) {
document.writeln("<div id=\"sponsorAdDiv\" style=\"position:absolute; height:" + RPHeight + "px; width:" + RPWidth + "px; top:110; left:10;\">");
document.writeln("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("<tr>");
document.writeln("	<td align=\"right\" bgcolor=\"#003399\">");
document.writeln("<img align=\"right\" src=\"http://www.acentix.es/imagenes/cerrar.jpg\" border=\"0\" onClick=\"HideRichMediaFrame();\" title=\"Cerrar este anuncio ...\">");
document.writeln("	</td>");
document.writeln("</tr>");
document.writeln("</table>");
document.writeln("<iframe scrolling=\"no\" width=\"" + RPWidth + "\" height=\"" + RPHeight + "\" frameborder=\"0\" src=\"" + urlMedia + "\"></iframe>");
document.writeln("</div>");

            setInterval('HideRichMediaFrame()',10000);
	}
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function HideRichMediaFrame(){
var adDiv;

   if(!ns && !ie && !w3) return;
   if(ie)	adDiv = eval('document.all.sponsorAdDiv.style');
   else if(ns)	adDiv = eval('document.layers["sponsorAdDiv"]');
   else if(w3)	adDiv = eval('document.getElementById("sponsorAdDiv").style');

   if (ie||w3)
      adDiv.display = "none";
   else
      adDiv.visibility = "hide";
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function get_cookie(name) {
  var search = name + "=";
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search);
    if (offset != -1) {
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) {
        end = document.cookie.length;
      }
      returnvalue=unescape(document.cookie.substring(offset, end));
    }
  }
  return returnvalue;
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
