<!--
//configure the two variables below to match yoursite's own info
var bookmarkurl="http://www.quizzi.it"
var bookmarktitle="Quiz e Test online"

function addbookmark(){
 if (document.all)
 window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function Iscrizione()
{
	var regolamento = document.ISC.regolamento.checked;
	var nome = document.ISC.nomecognome.value;
	var materia = document.ISC.materia.value;
	var email = document.ISC.email.value;
	var titolo = document.ISC.titolo.value;
	var pagine = document.ISC.pagine.value;
	var re_email = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
	if (regolamento == false)
	{
		alert("E' necessario accettare i termini del regolamento per procedere.");
	}
	else if (nome == "" || nome == "undefined" || nome.charAt(0) == " ")
	{
		alert("Inserisci il tuo nome e cognome.");
		document.ISC.nomecognome.value = "";
		document.ISC.nomecognome.focus();
	}
	else if (materia == "" || materia == "undefined" || materia.charAt(0) == " ")
	{
		alert("Inserisci una materia.");
		document.ISC.materia.value = "";
		document.ISC.materia.focus();
	}
	else if (re_email.test(email) == false)
	{
		alert("Inserisci la tua email.");
		document.ISC.email.value = "";
		document.ISC.email.focus();
	}
	else if (titolo == "" || titolo == "undefined" || titolo.charAt(0) == " ")
	{
		alert("Inserisci un titolo.");
		document.ISC.titolo.value = "";
		document.ISC.titolo.focus();
	}
	else if (pagine == "" || pagine == "undefined" || pagine.charAt(0) == " ")
	{
		alert("Inserisci il numero di pagine.");
		document.ISC.pagine.value = "";
		document.ISC.pagine.focus();
	}
	else
	{
		document.ISC.method = "POST";
		document.ISC.action = "compravendi_registra.asp";
		document.ISC.submit();
	}
}

function stoperror(){
return true
}
window.onerror=stoperror

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function Segnala(origine){
 window.open("segnala.asp?"+ origine, null, "top=30, left=30, width=350, height=350");
}

function Condividi(origine){
 window.open("/condividi.asp?quiz="+ escape(origine), null, "top=30, left=30, width=350, height=350");
}


function bookmark() {
	
	 title = "TiFaccioICompiti.com"; 
	
	 url = "http://www.tifaccioicompiti.com";
	
		if (window.sidebar) { // Mozilla Firefox Bookmark
			window.sidebar.addPanel(title, url,"");
		} else if( window.external ) { // IE Favorite
			window.external.AddFavorite( url, title); }
		else if(window.opera && window.print) { // Opera Hotlist
			return true; }
}
	 
function social_bookmark(targetURL,service) {
		//URL of this document
		if(!service) service='delicious';
		var loc=(targetURL && targetURL.length>0?targetURL:location.href);
		//Strip out any anchors
		var apos=loc.indexOf('#');
		loc=encodeURIComponent((apos>0?loc.substring(0,apos):loc));
					
		//Get Title and encode
		var title = encodeURIComponent(document.title); 
					
		var url='';
					
		//Redirect to service
		if(service=='digg') url='http://www.digg.com/submit?phase=2&url=' + loc + '&title=' + title;
		else if(service=='newsvine') url='http://www.newsvine.com/_tools/seed&save?u=' + loc + '&h=' + title;
		else if(service=='furl') url='http://www.furl.net/storeIt.jsp?p=1&u='+ loc +'&t=' + title;
		else if(service=='blinklist') url='http://www.blinklist.com/index.php?Action=Blink/addblink.php&Description=&Url=' + loc + '&Title=' + title;
		else if(service=='oknotizie') url='http://oknotizie.alice.it/post.html.php?url=' + loc + '&title=' + title;
		else if(service=='segnalo') url='http://segnalo.com/post.html.php?url=' + loc + '&title=' + title;
		else url='http://del.icio.us/post?v=2&url=' + loc + '&amp;title=' + title;
					
		location.href = url;
		return false;
}
//-->
