var url = window.location;
var title = document.title;
var wwwroot = "../";

function wopmove(id)
{
if(id == "facebook")
	window.open("http://www.facebook.com/sharer.php?u="+url+"&t="+title);
if(id == "delicious")
	window.open("http://del.icio.us/post?url="+url+"&title="+title+"&notes="+title);
if(id == "stumbleupon")
	window.open("http://www.stumbleupon.com/submit?url="+url+"&title="+title);
if(id == "google")
	window.open("http://www.google.com/bookmarks/mark?op=add&bkmk="+url+"&title="+title+"&labels="+sitename);
if(id == "yahoo")
	window.open("http://myweb2.search.yahoo.com/myresults/bookmarklet?u="+url+"&t="+title);
if(id == "myspace")
	window.open("http://www.myspace.com/index.cfm?fuseaction=postto&t="+ title +"&u=" + url);
if(id == "livespace")
	window.open("https://skydrive.live.com/sharefavorite.aspx/.SharedFavorites??&url="+url+"&title="+title);
if(id == "blogger")
	window.open();
}

function versioneStampabile(){
  var str = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"><html><head><title>"+ document.title +"</title>"+
  "<link href='"+wwwroot+"style/css.css' rel='stylesheet' type='text/css'>"+
  "<style type='text/css'>BODY {margin:10px;background: none; text-align:left}</style>"+
  "</head><body>"+
  "<div style='width:734px; text-align:left; background: #FFF'><img src='../img/layoutElem/logo.png'><br>" + MM_findObj("print").innerHTML +"<br></div>"+
  "</body></html>";

  win2 = open();
  win2.document.open();
  win2.document.write(str);
  win2.print();
  win2.document.close();
}

function getUrlFromText(param){
	
	// Restituisce, in una lista, tutti i link presenti nell'oggetto
	var anchorTags=param.getElementsByTagName("a");
	// Il link cui si viene ridirezionati è il primo della lista (OK se c'è solo un link)
	var objRef = anchorTags[0].href;

	if(objRef != null){
		var rel = objRef;
	}else{
		var rel = '#';
	}
return rel;
}


function rollOverBox_h(stato, param) {

var i = 0;
for (; i < param.childNodes.length; i++)
{
  if (param.childNodes[i].tagName == 'SPAN')
  {
   var h3 = param.childNodes[i].getElementsByTagName("H3");
  }
}

	if (stato)
	{
	h3[0].className = "more-ov";
	}else{
		h3[0].className = "more";
	}
}


function rollOverBox(stato, param) {

var i = 0;
for (; i < param.childNodes.length; i++)
{
  if (param.childNodes[i].tagName == 'SPAN')
  {
   var h3 = param.childNodes[i].getElementsByTagName("H3");
  }
}

	if (stato)
	{
	h3[0].className = "more2-ov";
	}else{
		h3[0].className = "more2";
	}
}

function showDivFromTab(param){
	for(i=1; i<4; i++){
		if(param == i){
			document.getElementById('menu' + i).style.display = 'block';
			document.getElementById('tab' + i).className = 'tabOn';
			document.getElementById('child_menu' + i).style.display = 'block';
		}else{
			document.getElementById('menu' + i).style.display = 'none';
			document.getElementById('tab' + i).className = 'tabOff';
			document.getElementById('child_menu' + i).style.display = 'none';
		}
	}
}