function writeEmbedVideoWE(videoUrl, W, H, str){
Pa = ""
Pb = ""
if (videoUrl!="") {

   params = str.split("§")
   for (i=0; i<params.length; i++)
   {
	vals = params[i].split('|')
	Pa+= ' ' + vals[0] + '="' + vals[1] + '"'
	Pb+= '<param name="' + vals[0] + '" value="' + vals[1] + '"/>'
   }

   document.write('<object width="'+ W + '" height="' + H +'">')
   document.write('<param value="' + videoUrl + '" name="movie"/>')
   document.write('<param value="transparent" name="wmode"/>')
   document.write(Pb)
   document.write('<embed width="'+ W +'" height="' + H +'" wmode="transparent" type="application/x-shockwave-flash" wmode="transparent" src="' + videoUrl + '" ' + Pa + '/>')
   document.write('</object>')
   }

}

function setEmbed(movie, width, height, qs){
  var out = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" height="' + height + '" width="' + width + '"><param value="' + movie + '" name="movie"/><param value="transparent" name="wmode"/><param value="true" name="allowFullScreen"/><param value="always" name="allowScriptAccess"/><embed height="' + height + '" width="' + width + '" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" type="application/x-shockwave-flash" src="' + movie + '"/></object>';
  return out
}

function writeEmbedVideo(videoUrl, W, str){
Pa = ""
Pb = ""
if (videoUrl!="") {

   params = str.split("§")
   for (i=0; i<params.length; i++)
   {
	vals = params[i].split('|')
	Pa+= ' ' + vals[0] + '="' + vals[1] + '"'
	Pb+= '<param name="' + vals[0] + '" value="' + vals[1] + '"/>'
   }

   document.write('<object width="'+ W +'">')
   document.write('<param value="' + videoUrl + '" name="movie"/>')
   document.write('<param value="transparent" name="wmode"/>')
   document.write(Pb)
   document.write('<embed width="'+ W +'" type="application/x-shockwave-flash" src="' + videoUrl + '" ' + Pa + ' wmode="transparent" />')
   document.write('</object>')
   }

}

function strelapsed(t) {
	if (t.indexOf) {
		var m = ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dec'];
		var s = m[parseInt(t.substr(5, 2), 10)] + ' ' +  t.substr(8, 2) + ', ' + t.substr(0, 4) + ' ' + t.substr(11, 8);
		t = Date.parse(s) / 1000;
	}
	ct = Math.round((new Date()).getTime() / 1000);
	t = ct - t;
	if (t < 60) {
		return t + " sec";
	}
	if (t < 3600) {
		m = Math.floor(t / 60);
		if(m == 1)
			return m + " min";
		else
			return m + " min";
	}
	if (t < (3600 * 24)) {
		h = Math.floor(t / 3600);
		if(h == 1)
			return h + " ora";
		else
			return h + " ore";
	}
	d = Math.floor(t / (3600 * 24));
	if(d == 1)
		return d + " giorno";
	else
		return d + " giorni";
}

var _POPUP_FEATURES = 'resizable=yes,location=0,statusbar=0,menubar=0,width=800,height=500';

function raw_popup(url, target, features) {
    // pops up a window containing url optionally named target, optionally having features
    if (isUndefined(features)) features = _POPUP_FEATURES;
    if (isUndefined(target  )) target   = '_blank';
    var theWindow = window.open(url, target, features);
    theWindow.focus();
    return theWindow;
}

function link_popup(src, features) {
    // to be used in an html event handler as in: <a href="..." onclick="link_popup(this,...)" ...
    // pops up a window grabbing the url from the event source's href
    return raw_popup(src.getAttribute('href'), src.getAttribute('target') || '_blank', features);
}

function isUndefined(v) {
    var undef;
    return v===undef;
}

try{
    var lenArrADV = _nameArray.length;
}
catch(e)
{
    var _nameArray = new Array();
    _nameArray[0]="adv7";
    _nameArray[1]="adv1";
    _nameArray[2]="manchette";
}