﻿
var flag;
var overInterval;
var subCont1;
var subCont2;
var subCont3;
var subCont4;

function init() {
	subCont1 = new fx.Height('animazione1' , { duration: 400 });
	subCont2 = new fx.Height('animazione2' , { duration: 400 });
	subCont3 = new fx.Height('animazione3' , { duration: 400 });
	subCont4 = new fx.Height('animazione4' , { duration: 400 });
	subCont1.hide();
	subCont2.hide();
	subCont3.hide();
	subCont4.hide();
}

function initGeneric(animaz) {
    alert(animaz);
    var subCont;
	subCont = new fx.Height(animaz , { duration: 400 });
	subCont.hide();
}


function rollOverPopup() {
    if (flag==false) {
        document.getElementById('casaProdOver').style.display='none';
        clearInterval(overInterval);
    }
}

function getElementsByStyleClass (className) {
  var all = document.all ? document.all : document.getElementsByTagName('*');
  var elements = new Array();
  for (var e = 0; e < all.length; e++) {
    if (all[e].className == className) {
        elements[elements.length] = all[e];
    }
  }
  return elements;
}

function prevImage() {
    if (position>0) {
        position-=1;
    }
    for (k=0;k<theImgS.length;k++) {
        theImgS[k].style.display='none';
    }
    for (k=position;k<position+3;k++) {
        theImgS[k].style.display='block';
    }
}

function nextImage() {
    if (position<theImgS.length-3) {
        position+=1;
    }
    for (k=0;k<theImgS.length;k++) {
        theImgS[k].style.display='none';
    }
    for (k=position;k<position+3;k++) {
        theImgS[k].style.display='block';
    }
}

function alternate(id){
 if(document.getElementsByTagName){  
   var table = document.getElementById(id);  
   var rows = table.getElementsByTagName("tr");  
   for(i = 1; i < rows.length-1; i++){          
     if(i % 2 == 0){
       rows[i].className = "bg1";
     }else{
       rows[i].className = "bg2";
     }      
   }
 }
}

var scrolling;
var left=0;
function scrollImages(value) {
    scrollerWidth=parseInt(document.getElementById('images').style.width)-225;
    scrolling=setInterval("scroller("+value+","+scrollerWidth+")",50);
}

function scroller (value,scrollerWidth) {
    if ((left>-scrollerWidth && value<0) || (left<0 && value>0)) {
        left=left+value;
    }
    styleWord="0px 0px 0px "+left+"px";
    document.getElementById('images').style.margin=styleWord;
}

function populateList(region) {
	list=document.getElementById('ctl00_bodyPlace_CreateUserWizard1_ListBox1')
	list.options.length=0;
	for (i=0;i<=5;i++) {
		list.options[i]=new Option(region+i, region+i);
	}
}
