function opwin(cosa,larghezza,altezza) {
var larga= larghezza;
var alta= altezza;
W=(screen.availWidth-larga)/2;
H=(screen.availHeight-alta)/2;
seleziona1=cosa;
window.open(seleziona1, 'inpharzampopup', 'width='+larga+', height='+alta+',top='+H+',left='+W+',resizable=yes,scrollbars=no,LOCATION=no,toolbar = no');
}

function opzoom() {
var larga= 600;
var alta= 400;
W=(screen.availWidth-larga)/2;
H=(screen.availHeight-alta)/2;
immagine=document.hdn.hidnzoom.value;
if (immagine.length>0) {
seleziona1='zoom_img.asp?img='+immagine;
window.open(seleziona1, 'zoomimg', 'width='+larga+', height='+alta+',top='+H+',left='+W+',resizable=yes,scrollbars=no,LOCATION=no,toolbar = no');
}
}

function opprint(cosa) {
pagina='page_print.asp?pagina1='+cosa;
window.open(pagina,'print','width=800,height=600,scrollbars=Yes,top=0,left=0');
}

function printContent(){
str=document.getElementById("textScroller").innerHTML
tit="";
if (document.getElementById("titPage")) tit=document.getElementById("titPage").innerHTML
var now = new Date();
var refl="_2";
if (document.getElementById("refl")) refl=document.getElementById("refl").value;
newwin=window.open('','printwin','left=100,top=100,width=400,height=400');
newwin.document.write('<HTML>\n<HEAD>\n');
newwin.document.write('<title>Print Page</title>\n');
newwin.document.write('<script>\n');
newwin.document.write('function chkstate(){\n');
newwin.document.write('if(document.readyState=="complete"){\n');
newwin.document.write('window.print();\nwindow.close()\n');
newwin.document.write('}\n');
newwin.document.write('else{\n');
newwin.document.write('setTimeout("chkstate()",2000)\n');
newwin.document.write('}\n');
newwin.document.write('}\n');
newwin.document.write('function printWin(){\n');
newwin.document.write('\n');
newwin.document.write('chkstate();\n');
newwin.document.write('}\n');
newwin.document.write('<\/script>\n');
newwin.document.write('<link rel="stylesheet" href="./load_stili.asp" type="text/css">');
newwin.document.write('</HEAD>\n');
newwin.document.write('<body "onload="printWin()" class="testo" style="background:#fff;margin:5%"><p style="text-align:right"><img src="./images/logo'+refl+'.jpg" alt=""/></p>\n');
newwin.document.write('<p class="titolo">'+tit+'</p>')
newwin.document.write('<p class="testo">'+str+'')
newwin.document.write('<center><br/><br/><font class="credits">bist.ch // fep.ch '+now.getDate()+'.'+(now.getMonth()+1)+'.'+now.getFullYear()+'</font></center></p>')
newwin.document.write('<script type="text/javascript">\nprintWin();\n</script>\n</BODY>\n');
newwin.document.write('</HTML>\n');
newwin.document.close();
}

function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}


function tofull() {
h=screen.availHeight;w=1024; l=0; t=0; 
if (parseInt(navigator.appVersion)>3) {
   if (navigator.appName=="Netscape") {
   top.outerWidth=w;
   top.outerHeight=h;
   }
   else top.resizeTo(w,h);
   top.moveTo(l,t);
 }
}

function blendimage(divid, millisec) {
var speed = Math.round(millisec / 100);
var timer = 0;
    for(i = 100; i >= 0; i--) {
        setTimeout("changeOpac(" + i + ",'" + divid + "')",(timer * speed));
        timer++;
    }
}

function findPos(obj) {
	var curleft = curtop = 0;
if (obj.offsetParent) {
do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
} while (obj = obj.offsetParent);
return curleft;
}
}

function findPosY(obj) {
	var curleft = curtop = 0;
if (obj.offsetParent) {
do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
} while (obj = obj.offsetParent);
return curtop;
}
}


