function PopupRegistration(path, lang){
	var w = 270;
	var h = 220;
	var l = Math.floor((screen.width-w)/2);
	var t = Math.floor((screen.height-h)/2);
	var stile = "top="+t+", left="+l+", width="+w+", height="+h+", status=no, menubar=no, toolbar=no, scrollbar=no, resizable=no";
	window.open("/"+path+"popup_registration_"+lang+".html", "Credits", stile);
}

/*function PopupNewsletter(){
	var w = 500;
	var h = 150;
	var l = Math.floor((screen.width-w)/2);
	var t = Math.floor((screen.height-h)/2);
	var stile = "top="+t+", left="+l+", width="+w+", height="+h+", status=no, menubar=no, toolbar=no, scrollbars=yes, resizable=no";
	window.open("/popup_newsletter_question.php", "Newsletter", stile);
}*/

function PopupPrivacy(path){
	var w = 500;
	var h = 600;
	var l = Math.floor((screen.width-w)/2);
	var t = Math.floor((screen.height-h)/2);
	var stile = "top="+t+", left="+l+", width="+w+", height="+h+", status=no, menubar=no, toolbar=no, scrollbars=yes, resizable=no";
	window.open("/"+path+"popup_privacy.html", "Credits", stile);
}

function PopupCredits(path){
	var w = 300;
	var h = 400;
	var l = Math.floor((screen.width-w)/2);
	var t = Math.floor((screen.height-h)/2);
	var stile = "top="+t+", left="+l+", width="+w+", height="+h+", status=no, menubar=no, toolbar=no, scrollbar=no, resizable=no";
	window.open("/"+path+"popup_credits.html", "Credits", stile);
}

function ViewTestata(vedi,lang){
	if(document.getElementById && document.createTextNode){
		form = document.getElementById("formReg");//form di registrazione
		linea = document.getElementById("linea");//linea divisoria sotto i radio button
		
		if(vedi == 'si'){
			controlla = document.getElementById("textTestata");
			if(controlla == null){//controllo che non esista già il campo testata
				//creo la lable
				newleft = document.createElement("div");
				newleft.setAttribute("id","delleft");
				newleft.setAttribute("class","formleft");
				if(lang==''){
					newleft.appendChild(document.createTextNode("* Testata / Societa'"));
				}
				else{
					newleft.appendChild(document.createTextNode("* Newspaper / Company"));
				}
				
				//creo la textbox
				newright = document.createElement("div");
				newright.setAttribute("class","formright");
				newright.setAttribute("id","delright");
				newinput = document.createElement("input");
				newinput.setAttribute("class","control");
				newinput.setAttribute("type","text");
				newinput.setAttribute("name","textTestata");
				newinput.setAttribute("id","textTestata");
				newright.appendChild(newinput);
				
				//creo l'elemento per andare a capo
				acapo = document.createElement("br");
				acapo.setAttribute("id","acapo");
				
				//inserisco gli elementi creati nel documento
				linea.parentNode.insertBefore(acapo,linea);
				linea.parentNode.insertBefore(newleft,linea);
				linea.parentNode.insertBefore(newright,linea);
			}
		}
		else{
			//elimino la textbox testata
			delleft = document.getElementById("delleft");
			acapo = document.getElementById("acapo");
			delright = document.getElementById("delright");
			form.removeChild(delleft);
			form.removeChild(acapo);
			form.removeChild(delright);
		}
	}
}

/* 
Methods for resizing the flash stage at runtime.

setFlashWidth(divid, newW)
divid: id of the div containing the flash movie.
newW: new width for flash movie

setFlashWidth(divid, newH)
divid: id of the div containing the flash movie.
newH: new height for flash movie

setFlashSize(divid, newW, newH)
divid: id of the div containing the flash movie.
newW: new width for flash movie
newH: new height for flash movie
*/
function setFlashWidth(divid, newW){
	document.getElementById(divid).style.width = newW+"px";
}
function setFlashHeight(divid, newH){
	document.getElementById(divid).style.height = newH+"px";		
}
function setFlashSize(divid, newW, newH){
	setFlashWidth(divid, newW);
	setFlashHeight(divid, newH);
}
