// OAS SETUP begin

//configuration
OAS_url ='http://ads.prisacom.com/RealMedia/ads/';
OAS_query = '?';
//OAS_listpos = "Position1,Top";
//OAS_sitepage = "www.plus.es/portada";

//end of configuration
OAS_version = 10;
OAS_rn = '001234567890'; OAS_rns = '1234567890';
OAS_rn = new String (Math.random()); OAS_rns = OAS_rn.substring (2, 11);


function OAS_NORMAL(pos) {
	document.write('<a href="' + OAS_url + 'click_nx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + OAS_query + '" target="_top>"');
	document.write('<img src="' + OAS_url + 'adstream_nx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + OAS_query + '" alt="Click!" /></a>');
}

OAS_version = 11;
if (navigator.userAgent.indexOf('Mozilla/3') != -1)
	OAS_version = 10;
if (OAS_version >= 11)
	document.write('<script type="text/javascript" src="' + OAS_url + 'adstream_mjx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + OAS_query + '"></script>');

function OAS_AD(pos) {
//	alert (OAS_sitepage +"***"+pos);
	if (OAS_version >= 11 && typeof(OAS_RICH)!='undefined')
	  OAS_RICH(pos);
	else
	  OAS_NORMAL(pos);
}

// OAS SETUP end

// OJD INI
function __setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}
function __getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}
if(__getCookie('plus_ctrl')==null)
{
        var d = new Date();
        __setCookie('plus_ctrl',d.getTime()+navigator.platform+navigator.appCodeName+screen.width,'Thu, 31 Dec 2008 23:59:59 UTC','/','plus.es');
}

function PIXEL() {
	if (PIXEL_tag != '') {
		//var ref = escape(window.location);
		var rexp = /\//g;
		var ref = escape(document.location.href, 1).replace(rexp, '%2F');
		//alert (ref);
		document.write('<img src="http://control.prisacom.com/ojd/plus/pixel.php?sec='+PIXEL_tag+'&amp;domain=plus&amp;user='+__getCookie('plus_ctrl')+'&amp;r='+ref+'&amp;random='+Math.floor(Math.random()*100000)+'" width="1" height="1" />');

		//Omniture
		var s_code=s.t();
		if(s_code) document.write(s_code);
		if(navigator.appVersion.indexOf('MSIE')>=0) document.write(unescape('%3C')+'\!-'+'-');
	}
}

// OJD INI fin


/* Publicidad, función que la incrusta en el html */
function playParamFlashObject(swfFile, id, dim, transparent, clsid, flashversion, divId)
{
	content = '<object classid="'+clsid+'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+flashversion+',0,0,0" ID="'+id+'" '+dim+'>';
	if(swfFile.indexOf('?')!=-1){
		pos=swfFile.indexOf('?');
		fname=swfFile.substring(0,pos);
		fvars=swfFile.substring(pos+1,swfFile.length);
		content += '<param name="movie" value="'+fname+'" />';
		content += '<param name="FlashVars" value="'+fvars+'" />';
	}else{
		fname=swfFile;
		fvars='';
		content += '<param name="movie" value="'+fname+'" />';
	}
	content += '<param name="quality" value="high" /><param name="wmode" value="'+transparent+'" />';
	content += '<embed src="'+fname+'" FlashVars="'+fvars+'" quality="high" wmode="'+transparent+'" swLiveConnect="FALSE" '+dim+' name="'+id+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
	content += '</embed></object>';
	if (divId)
	{
		objDiv = document.getElementById(divId);
		objDiv.innerHTML=content;
	}
	else document.write(content);
	return content;
}
