ns4 = (navigator.appName.indexOf("Netscape") >= 0 && parseInt(navigator.appVersion.charAt(0)) == 4) ? true : false; 
ns6 = (navigator.appName.indexOf("Netscape") >= 0 && parseInt(navigator.appVersion.charAt(0)) > 4) ? true : false; 
ie4 = (navigator.appName.indexOf("Explorer") >= 0 && parseInt(navigator.appVersion.charAt(0)) >= 4) ? true : false;
function findLayer(name, doc) {
	var i, layer;
	for (i = 0; i < doc.layers.length; i++) {
		layer = doc.layers[i];
		if (layer.name == name) return layer;
		if (layer.document.layers.length > 0) {
			layer = findLayer(name, layer.document);
			if (layer != null) return layer;
		}
	}
	return null;
}
function getLayer(name) {
	if (ns4) return findLayer(name, document);
	if (ns6) return 'document.getElementById("'+name+'")';
	if (ie4) return eval('document.all.' + name);
	return null;
}
function getPageLeft(layer) {
	if (ns4) return(layer.pageX);
	if (ns6) return(eval(layer).offsetLeft);
	if (ie4) return(layer.offsetLeft);
	return(-1);
}
function getPageTop(layer) {
	if (ns4) return(layer.pageY);
	if (ns6) return(eval(layer).offsetTop);
	if (ie4) return(layer.offsetTop);
	return(-1);
}
function getwindowheight() {
	if (navigator.userAgent.indexOf("MSIE") > 0) {var sSize = document.body.clientHeight; return sSize;}
	else {var sSize = window.innerHeight; return sSize;}
	return;
}
function getwindowwidth() {
	if (navigator.userAgent.indexOf("MSIE") > 0) {var sSize = document.body.clientWidth; return sSize;}
	else {var sSize = window.innerWidth; return sSize;}
	return;      
}
function resizeIt() {
	location.href=location.href;//"index.html";
}
function findObj(n, d) {
	var p,i,x;
	if(!d) d=document;
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document;
		n=n.substring(0,p);
		}
	if(!(x=d[n])&&d.all) x=d.all[n];
	for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
	return x;
}
function preloadImages() {
	var d=document;
	if(d.images){
		if(!d.p) d.p=new Array();
	    var i,j=d.p.length,a=preloadImages.arguments;
		for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){
			d.p[j]=new Image;
			d.p[j++].src=a[i];
		}
	}
}
function swapImage() {
	var i,j=0,x,a=swapImage.arguments;
	document.sr=new Array;
	for(i=0;i<(a.length-2);i+=4)
	if ((x=findObj(a[i]))!=null){
		document.sr[j++]=x;
		if(!x.oSrc) x.oSrc=x.src;
		x.src=a[i+2];
	}
}
function swapImgRestore() {
	var i,x,a=document.sr;
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function preLoader() {
	preloadImages(
		'images/spacer.gif'
	);
}

function startlaptop() {
	setTimeout('fadeIn()',500);
}

var maxImages = 14; // put in here how many images you have in your sequence
var fadeSpeed = 100; // fade frame time in milliseconds; 125 = 125 ms
var fadeInTimer;
var fadeOutTimer;
var fadeInCount = 0;
var fadeOutCount = maxImages-1;
var fadeArray = new Array(maxImages); // enter all the fade images here
	fadeArray[0]  = "http://www.omsefcu.org/laptop/01.jpg";
	fadeArray[1]  = "http://www.omsefcu.org/laptop/stp02.jpg";
	fadeArray[2]  = "http://www.omsefcu.org/laptop/stp03.jpg";
	fadeArray[3]  = "http://www.omsefcu.org/laptop/stp04.jpg";
	fadeArray[4]  = "http://www.omsefcu.org/laptop/stp05.jpg";
	fadeArray[5]  = "http://www.omsefcu.org/laptop/stp05.jpg";
	fadeArray[6]  = "http://www.omsefcu.org/laptop/stp05.jpg";
	fadeArray[7]  = "http://www.omsefcu.org/laptop/stp05.jpg";
	fadeArray[8]  = "http://www.omsefcu.org/laptop/stp05.jpg";
	fadeArray[9]  = "http://www.omsefcu.org/laptop/stp05.jpg";
	fadeArray[10] = "http://www.omsefcu.org/laptop/stp05.jpg";
	fadeArray[11] = "http://www.omsefcu.org/laptop/stp05.jpg";
	fadeArray[12] = "http://www.omsefcu.org/laptop/stp05.jpg";
	fadeArray[13] = "http://www.omsefcu.org/laptop/stp06.jpg";
for (var i = 0; i < maxImages; i++) {
	eval('pic' + i + ' = new Image();');
	eval('pic' + i + '.src = fadeArray[i];'); // preloads fade images
}
function fadeIn() {
	clearTimeout(fadeOutTimer);
	document.images['fade-pic'].src = fadeArray[fadeInCount];
	if (fadeInCount != maxImages-1) {
		fadeInCount++;
		fadeInTimer = setTimeout('fadeIn()', fadeSpeed);
	}
	else {
		clearTimeout(fadeInTimer);
		fadeInCount = 0;
		setTimeout('animate()',500);
	}
}
function fadeOut() {
	clearTimeout(fadeInTimer);
	document.images['fade-pic'].src = fadeArray[fadeOutCount];
	if (fadeOutCount != 0) {
		fadeOutCount--;
		fadeOutTimer = setTimeout('fadeOut()', fadeSpeed);
	}
	else {
		clearTimeout(fadeOutTimer);
		fadeOutCount = maxImages-1;
	}
}

function CaricaFoto(img){
  foto1= new Image();
  foto1.src=(img);
  Controlla(img);
}
function Controlla(img){
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img);
  }
  else{
    funzione="Controlla('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}
function viewFoto(img){
  largh=foto1.width+20;
  altez=foto1.height+20;
  stringa="width="+largh+",height="+altez;
  finestra=window.open(img,"",stringa);
  //window.open(img,"",stringa);
}
var message="Function Disabled!";
function clickIE4(){
	if (event.button==2){
		alert(message);
		return false;
	}
}
function clickNS4(e){
	if (document.layers||document.getElementById&&!document.all){
		if (e.which==2||e.which==3){
			alert(message);
			return false;
		}
	}
}





//FADE BANNER SCRIPT
//window.addEventListener?window.addEventListener("load",so_init,false):window.attachEvent("onload",so_init);
var d=document, imgs = new Array(), zInterval = null, current=0, pause=false, delay2=5000;
var nIndex, lIndex;
var manual = 0;
var cOpacity=.99, nOpacity=0;
function so_init() {
	if(!d.getElementById || !d.createElement)return;
	css = d.createElement("link");
	//css.setAttribute("href","xfade2.css");
	css.setAttribute("rel","stylesheet");
	css.setAttribute("type","text/css");
	d.getElementsByTagName("head")[0].appendChild(css);
	imgs = d.getElementById("imageContainer").getElementsByTagName("img");
	//dots = d.getElementById("dotsContainer").getElementsByTagName("img");
	for(i=1;i<imgs.length;i++) imgs[i].xOpacity = 0;
	imgs[0].style.display = "block";
	imgs[0].xOpacity = .99;
	//dots[0].src="images/dots_here.jpg";
	pause = setTimeout(so_xfade,delay2);
}
function move(which) {
	nIndex = which-0;
	manual = 1;
	clearTimeout(pause);
	so_xfade();
}
function gotolink() {
	links = d.getElementById("imageContainer").getElementsByTagName("a");
	window.location=links[current]
}
function so_xfade() {
	//cOpacity = imgs[current].xOpacity;
	if (!manual)
		nIndex = imgs[current+1]?current+1:0;
	//nOpacity = imgs[nIndex].xOpacity;
	//for(i=0;i<dots.length;i++) dots[i].src="images/dots.jpg";
	//dots[nIndex].src="images/dots_here.jpg";
	cOpacity-=.05; 
	nOpacity+=.05;
	imgs[nIndex].style.display = "block";
	for(i=0;i<imgs.length;i++) imgs[i].xOpacity = -.01;//cOpacity;
	imgs[current].xOpacity = cOpacity;
	imgs[nIndex].xOpacity = nOpacity;
	for(i=0;i<imgs.length;i++) setOpacity(imgs[i]); 
	//setOpacity(imgs[nIndex]);
	if(cOpacity<=0) {
		imgs[current].style.display = "none";
		current = nIndex;
		manual=0;
		cOpacity=.99;
		nOpacity=0;
		pause = setTimeout(so_xfade,delay2);
	} else {
		pause = setTimeout(so_xfade,50);
	}
	function setOpacity(obj) {
		if(obj.xOpacity>.99) {
			obj.xOpacity = .99;
			return;
		}
		obj.style.opacity = obj.xOpacity;
		obj.style.MozOpacity = obj.xOpacity;
		obj.style.filter = "alpha(opacity=" + (obj.xOpacity*100) + ")";
	}
	
}
function clearOpacity(obj) {
	obj.style.opacity = obj.xOpacity;
	obj.style.MozOpacity = obj.xOpacity;
	obj.style.filter = "alpha(opacity=" + (obj.xOpacity*100) + ")";
}