function NewWindow(img,url,w,h,scroll){
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;	settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',toolbar=no,location=no,status=no,menubar=no,resizable=no,dependent=no'
	win=window.open('','MyWindow',settings)
		win.document.write('<html><head><title>Student Zone Community</title><\/head><body topmargin=0 leftmargin=0>')
		win.document.write('<table border=0 align=center cellpadding=0 cellspacing=0><tr><td align=center><img src='+url+img+' border=0><\/td><\/tr><\/table>')
		win.document.write('<\/body><\/html>')
	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}


function PopUp_pxcm(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll
	win = window.open(mypage,myname,settings)
	if(win.window.focus){win.window.focus();}
}

var bookmarkurl="{URL_BOOKMARK}";
var bookmarktitle="{TITLE_BOOKMARK}";

function addbookmark(){
  if (document.all)
     window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function Abilita(check,myform,nome) {
	var elem;
	if (nome) {
		elem=eval("myform."+nome);
		if (check.checked) {
			elem.disabled=false;
		}else{
			elem.disabled=true;
		}
	}else{
		if (check.checked) {
			myform.submit.disabled=false;
		}else{
			myform.submit.disabled=true;
		}
	}
}
function ShowHelp(div, title, desc) {
		div.style.display = 'inline';
		div.style.position = 'absolute';
		//div.style.zIndex = '30px';
		//div.style.width = '240';
		//div.style.backgroundColor = '#FFFEE0';
		//div.style.border = '1px solid #DDDDDD';
		//div.style.padding = '5px';
		div.innerHTML = '<b>' + title + '</b><br /><span class="div-popup">' + desc + '</span>';
}

function ShowHelpMod(div, title, desc, w, h) {
		div.style.display = 'inline';
		div.style.position = 'absolute';
		div.style.width = w;
		//div.style.height = h;
		div.style.backgroundColor = '#FFFEE0';
		div.style.border = '1px solid #DDDDDD';
		div.style.padding = '5px';
		div.innerHTML = '<b>' + title + '</b><br /><span class="div-popup">' + desc + '</span>';
}

function HideHelp(div) {
		div.style.display = 'none';
}
					function getAnchorPosition(anchorname){
						var useWindow=false;
						var coordinates=new Object();
						var x=0,y=0;
						var use_gebi=false, use_css=false, use_layers=false;
						if(document.getElementById){use_gebi=true;
						}else if(document.all){use_css=true;
						}else if(document.layers){use_layers=true;
						}if(use_gebi && document.all){x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
						y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
						}else if(use_gebi){var o=document.getElementById(anchorname);
						x=AnchorPosition_getPageOffsetLeft(o);
						y=AnchorPosition_getPageOffsetTop(o);
						}else if(use_css){x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
						y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
						}else if(use_layers){var found=0;
						for(var i=0;
						i<document.anchors.length;
						i++){if(document.anchors[i].name==anchorname){found=1;
						break;
						}}if(found==0){coordinates.x=0;
						coordinates.y=0;
						return coordinates;
						}x=document.anchors[i].x;
						y=document.anchors[i].y;
						}else{coordinates.x=0;
						coordinates.y=0;
						return coordinates;
						}coordinates.x=x;
						coordinates.y=y;
						return coordinates;
						}
					function getAnchorWindowPosition(anchorname){
						var coordinates=getAnchorPosition(anchorname);
						var x=0;
						var y=0;
						if(document.getElementById){
						if(isNaN(window.screenX)){x=coordinates.x-document.body.scrollLeft+window.screenLeft;
						y=coordinates.y-document.body.scrollTop+window.screenTop;
						}else{x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
						y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
						}}else if(document.all){x=coordinates.x-document.body.scrollLeft+window.screenLeft;
						y=coordinates.y-document.body.scrollTop+window.screenTop;
						}else if(document.layers){x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
						y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
						}coordinates.x=x;
						coordinates.y=y;
						return coordinates;
						}
					function AnchorPosition_getPageOffsetLeft(el){
						var ol=el.offsetLeft;
						while((el=el.offsetParent) != null){
							ol += el.offsetLeft;
						}
						return ol;
						}
					function AnchorPosition_getWindowOffsetLeft(el){
						return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
						}
					function AnchorPosition_getPageOffsetTop(el){
						var ot=el.offsetTop;
						while((el=el.offsetParent) != null){
							ot += el.offsetTop;
						}
						return ot;
						}
					function AnchorPosition_getWindowOffsetTop(el){
						return 	AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
					}

brow = "";
versione = navigator.appVersion;
var bVer = parseInt(versione.substring(0,1));
bName = navigator.appName;
if (bName.substring(0,8) == "Netscape") {
if(bVer >= 4) brow = "n4";
else if(bVer == 3) brow = "n3";
else if(bVer == 2) brow = "n2";
}
else if (bName.substring(0,9) == "Microsoft") {
if(bVer >= 4) brow = "e4";
else brow = "e3";
}
function stampa() {
	if ((brow == "e2")||(brow == "e3")||(brow == "n3")) {
		alert('Con questo browser non si puņ stampare da codice');
	}
	else if (brow == "e4") {
		self.focus();
		setTimeout('self.print()',100);
	}
	else {
		self.print();
	}
}
function chiudi() {
	self.close();
}

var allSupport = document.all!=null;
var getElementBy = document.getElementById!=null;

function getElement(elName) {
	// Get an element from its ID
	if (allSupport) {
		return document.all[elName]
	}else{
		if (getElementBy) {
			return document.getElementById(elName)
		}else{
			return document.layers[elName]
		}
	}
}

function aggiornaComuni(elm, frm, url) {
	if (elm.selectedIndex != 0) {
		frm.action = url;
		frm.submit();
	}
}

function writeML(name, code, dom) {
	document.write('<a href="mailto:'+name+code+dom+'">'+name+code+dom+'<\/a>');
}

function del_confirm(href,msg) { 
	var name = confirm(msg)
    if(name == true) {
		window.open(href,'_self')
	}
}