//window.onload = function() {
	//ajaxInit();
	//renderSwfs();
	//if (document.getElementById("slideBox")) {
		//slideInit("r", 3000, 10, 5, "slideBox", "slide_"); //direction, delay, pixelsToSlide, speed, id_main_box, id_prefix
	//}
//}

window.onload = function() {
	
	function renderSwfs() {
	if (document.getElementById("flash_home")) {
		var params = {
			wmode: "transparent"
		};
		swfobject.embedSWF("strip/strip_prodotti.swf", "flash_home", "250", "700", "9.0.0", "swf/expressInstall.swf", {}, "params", {});
	}
	/*if (document.getElementById("swf_clickus")) {
		var params = {
			wmode: "transparent"
		};
		var nome = document.getElementById("swf_clickus").innerHTML;
		swfobject.embedSWF("swf/" + nome + ".swf", "swf_clickus", "682", "293", "9.0.0", "swf/expressInstall.swf", {}, params, {});
	}*/
}
	
	if (document.getElementById("nav")) {
		//var tags = document.getElementsByTagName("a");
		var tags = document.getElementById("nav").getElementsByTagName("div");
		for (var i = 0; i <  tags.length  ; i++ ) {
			var tag = tags[i];
	
			var tag_class = tag.className;
			if (tag.className.indexOf("nav_box") != -1 && tag.className.indexOf("selected") == -1) {
				//alert(tag_class);
				tag.onmouseover = function() {
					var thisId = this.id;
					//alert(thisId);
					document.getElementById(thisId).className += " over";
					//alert(document.getElementById(thisId).className);
				}
				tag.onmouseout = function() {
					var thisId = this.id;
					//alert(thisId);
					document.getElementById(thisId).className=document.getElementById(thisId).className.replace(" over", "");
					//alert(document.getElementById(thisId).className);
				}
			}
		//for (var j = 0; j < tags.lenght; j++ ) {
			//var thisId = this.id
			//var rolls = document.getElementById(thisId).className = " over"
			//var roll = rolls[j]
			//if (roll != -1) {
				//roll = true
				//}
			//if (roll = true) {
					//document.getElementById(thisId).className=document.getElementById(thisId).className.replace(" over", " over_alternativo");
				//}
			//}
		}
	}
}

function RefreshImage(valImageId) {
	var objImage = document.images[valImageId];
	if (objImage == undefined) {
		return;
	}
	var now = new Date();
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}

function resize(Elem, Img) {
	var obj = document.getElementById(Elem);
	var img = document.getElementById(Img);
	obj.style.width = (img.style.width + 4) + "px";
	obj.style.height = (img.style.height + 4) + "px";
	obj.style.left = (getWindowProperty("w")/2 - getElementProperty(Img, "w") /2) + "px";
	obj.style.top = (getWindowProperty("h")/2 - getElementProperty(Img, "h") /2) + "px";
}

function getWindowProperty(which) {
	var value = 0;
	if (document.layers||(document.getElementById&&!document.all)) {
		if (which == "w") {
			value = window.innerWidth;
		} else if (which == "h") {
			value = window.innerHeight;
		}
	} else if (document.all) {
		if (which == "w") {
			value = document.documentElement.clientWidth;
		} else if (which == "h") {
			value = document.documentElement.clientHeight;
		}
	}
	return value;
}

/*if(document.layers||(document.getElementById&&!document.all)){
   browseWidth=window.outerWidth;
   browseHeight=window.outerHeight;
}else if(document.all){
   browseWidth=document.body.clientWidth;
   browseHeight=document.body.clientHeight;
}*/


function getElementProperty(Elem, which) {
	var value = 0;
	if (document.getElementById) {
		var elem = document.getElementById(Elem);
	} else if (document.all) {
		var elem = document.all[Elem];
	}
	if (which == "w") {
		value = elem.offsetWidth;
	} else if (which == "h") {
		value = elem.offsetHeight;
	}
	return value;
}

function toggle(id_objs) {
	var id_obj_array  = id_objs.split(", ");
	for (n=0; n<id_obj_array.length;n++) {
		id_obj = id_obj_array[n];
		if (id_obj != "") {
			obj = document.getElementById(id_obj);
			obj.style.display = (obj.style.display == "block" ? "none" : "block");
		}
	}
}

function zoom(url) {
	var ww = 586;
	var wh = 713;
	var l = (screen.width/2)-(ww/2);
	var t = (screen.height/2)-(wh/2);
	window.open('pop.asp?immagine=' + url, 'pop', 'status, top=' + t + ',left=' + l + ',width=' + ww + ',height=' + wh).focus();
}

function zoom2(url) {
	var ww = 392;
	var wh = 389;
	var l = (screen.width/2)-(ww/2);
	var t = (screen.height/2)-(wh/2);
	window.open('pop.asp?immagine=' + url, 'pop', 'status, noresize, top=' + t + ',left=' + l + ',width=' + ww + ',height=' + wh).focus();
}