// JavaScript Document

function chiudi() {
if (navigator.userAgent.indexOf("MSIE")!= -1) {
//alert("IE");
document.write("<br style='clear: both' />");
}
/*else if ((navigator.userAgent.indexOf("Netscape")!= -1) && (navigator.userAgent.indexOf("Windows")!= -1)){
	scosta=(((misura / 2) + spaceL) - 8);
document.write("<div id='wrapper' style='left:" + scosta + "px;'>");
}
else if ((navigator.userAgent.indexOf("Netscape")!= -1) && (navigator.userAgent.indexOf("Mac")!= -1)){
	scosta=(((misura / 2) + spaceL) - 8);
document.write("<div id='wrapper' style='left:" + scosta + "px;'>");
}*/
else if ((navigator.userAgent.indexOf("Firefox")!= -1) && (navigator.userAgent.indexOf("Windows")!= -1)){
//alert("F-PC");
document.write("<div style='clear: both'><!--vuoto --></div>");//fx pc
}
else if (navigator.userAgent.indexOf("Mac")!= -1){
//alert("Mac");
document.write("<div style='clear: both'><!--vuoto --></div>");//mac
}
}





function fascia() {	
minimo=325;
h_img=145;
altezza=document.getElementById("right").offsetHeight;
//alert (altezza);
if ((altezza) > minimo) {
sopra=(altezza - h_img) - 180;
document.write("<img src='img/chain.gif' width='300' height='145' class='bott' style='margin-top:" + sopra + "px;' />");
//alert (sopra);
}
else {
document.write("<img src='img/chain.gif' width='300' height='145' class='bott' />");
}
}

function fasciaK() {	
minimo=325;
h_img=145;
altezza=document.getElementById("right").offsetHeight;
//alert (altezza);
if ((altezza) > minimo) {
sopra=(altezza - h_img) - 180;
document.write("<img src='img/chainK.gif' width='300' height='145' class='bott' style='margin-top:" + sopra + "px;' />");
//alert (sopra);
}
else {
document.write("<img src='img/chainK.gif' width='300' height='145' class='bott' />");
}
}

function fasciaT() {	
minimo=405;
h_img=145;
altezza=document.getElementById("container").offsetHeight;
//alert (altezza);
if ((altezza) > minimo) {
sopra=((altezza - h_img) - 180);
document.write("<img src='img/chain.gif' width='300' height='145' class='bott' style='margin-top:" + sopra + "px;' />");
//alert (sopra);
}
else {
document.write("<img src='img/chain.gif' width='300' height='145' class='bott' style='margin-top:80px;' />");
}
}

function fasciaM() {	
minimo=325;
h_img=145;
altezza=document.getElementById("movie").offsetHeight;
//alert (altezza);
if ((altezza) > minimo) {
sopra=(altezza - h_img) - 180;
document.write("<img src='img/chain.gif' width='300' height='145' class='bott' style='margin-top:" + sopra + "px;' />");
//alert (sopra);
}
else {
document.write("<img src='img/chain.gif' width='300' height='145' class='bott' />");
}
}


function wrapper() {
//misura=document.getElementById("wrapper").offsetWidth;
misura=800;
finestra=document.body.clientWidth;

if (navigator.userAgent.indexOf("Safari")!= -1) {
finestra=document.body.offsetWidth;
//finestra=screen.availWidth;
//alert (finestra);
}

//finestra=document.body.offsetWidth;
//uguale
spaceO=(finestra - misura);
//spaceL=Math.floor(spaceO / 2);
spaceL=(spaceO / 2);
//scosta=(((misura / 2) + spaceL) - 9);
//alert (scosta);
if (navigator.userAgent.indexOf("MSIE")!= -1) {
document.write("<div id='wrapper'>");
}
/*else if ((navigator.userAgent.indexOf("Netscape")!= -1) && (navigator.userAgent.indexOf("Windows")!= -1)){
	scosta=(((misura / 2) + spaceL) - 8);
document.write("<div id='wrapper' style='left:" + scosta + "px;'>");
}
else if ((navigator.userAgent.indexOf("Netscape")!= -1) && (navigator.userAgent.indexOf("Mac")!= -1)){
	scosta=(((misura / 2) + spaceL) - 8);
document.write("<div id='wrapper' style='left:" + scosta + "px;'>");
}*/
else if ((navigator.userAgent.indexOf("Firefox")!= -1) && (navigator.userAgent.indexOf("Windows")!= -1)){
scosta=(((misura / 2) + spaceL) - 9);
document.write("<div id='wrapper' style='left:" + scosta + "px;'>");//fx pc
}

/*else if ((navigator.userAgent.indexOf("Gecko")!= -1) && (navigator.platform.indexOf("Win")!= -1)){
	scosta=(((misura / 2) + spaceL) - 8);
document.write("<div id='wrapper' style='left:" + scosta + "px;'>");//moz pc
} */
else {
//fx, safari, mac
scosta=(((misura / 2) + spaceL) - 8);
document.write("<div id='wrapper' style='left:" + scosta + "px;'>");
}

}





/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2-12 : 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)
}

function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;

      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}


function show(id){
  if(document.getElementById(id).style.display=="none")
    document.getElementById(id).style.display="block";
  else
    document.getElementById(id).style.display="none";
}

function hide(id){
  if(document.getElementById(id).style.display=="block")
    document.getElementById(id).style.display="none";
  else
    document.getElementById(id).style.display="block";
}

function segnala() {
var initialsubj="Segnalazione articolo su te.s.s. / tecniche servizi e soluzioni srl";
var initialmsg="Leggi la pagina: ";
var page=document.location;
window.location="mailto:?subject="+initialsubj+"&body="+initialmsg+""+page+"";
}

function toeng() {
coll = new String(window.location);
coll = coll.replace("ita","eng");
document.write("<a href="+coll+">eng</a>");
}

function toita() {
coll = new String(window.location);
coll = coll.replace("eng","ita");
document.write("<a href="+coll+">ita</a>");
}




