function runSlideShow() {
	if (document.all) {
		document.images.SlideShow.style.filter="blendTrans(duration=2)";
		document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
		document.images.SlideShow.filters.blendTrans.Apply();
	}
	document.images.SlideShow.src = preLoad[j].src;
	if (document.all) {
		document.images.SlideShow.filters.blendTrans.Play();
	}
	j = j + 1;
	if (j > (p - 1)) j = 0;
	t = setTimeout('runSlideShow()', slideShowSpeed);
}			

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}
function moveLayer(obj, x, y) {
  x = x + "px";
  y = y + "px";
  obj.style.left = x;
  obj.style.top = y;
}

function cambiaimmagine(obj){
	img=obj.src;
	len=img.length;
	trimOVER=img.lastIndexOf("_")
	trimEXT=img.lastIndexOf(".")
	over=img.substr((trimOVER+1),(trimEXT-trimOVER-1))
	if (over=="over"){
		obj.src=img.substr(0,trimOVER)+img.substr(trimEXT);
	}else{
		obj.src=img.substr(0,trimEXT)+"_over"+img.substr(trimEXT);
	}
}

function switchIMG (Bobj,Sobj){
	var img_name= new Array(2);
	var img_path= new Array(2);
	img_path[0]=Bobj.src;
	img_path[1]=Sobj.src;
	i=0;
	
	while(img_path[i]!=null){
		len=img_path[i].length;
		trimP=img_path[i].lastIndexOf("/")
		img_name[i]=img_path[i].substr((trimP+1));
		img_path[i]=img_path[i].substr(0,(trimP+1));
		i++;
	}
	Bobj.src=img_path[0]+img_name[1];
	//Sobj.src=img_path[1]+img_name[0];		//attivando questo, l'immagine viene switcata tra i 2 oggetti
}


function NOquote(text){					//change "char in \" and ' char in \'
	txt=text.value.replace(/"/g,'&#34;');
	txt=txt.replace(/'/g,"&#39;");
	text.value=txt;
}

function DELquote(form){
	j=0;
	while (form.elements[j]!=null){
		if (form.elements[j].type=="text" || form.elements[j].type=="password" || form.elements[j].type=="textarea"){
			NOquote(form.elements[j]);
		}
		j++;
	}
}