//
// myJS.js
//
var dbgconsole = null;
function debug (msg){
	var w = dbgconsole;
	if((w==null)||(w.closed)){
		dbgconsole = window.open("","debug","width=500, height=500, resizable, scrollbars");
		w = dbgconsole;
		w.document.open("text/plain");
	}
	w.focus();
	w.document.writeln(msg);
	w.self.scrollBy(0,100);
}
//========================================================
var myLib = {
	getChildNodesByTagName: function(parent, tagName){
		var nodes = new Array();
		for(var i=0; i< parent.childNodes.length; i++){
			if(parent.childNodes[i].nodeName == tagName){
				nodes.push(parent.childNodes[i]);
			}
		}
		return nodes;
	},

	get1stChildByTagName: function (parent, tagName){
		return this.getChildNodesByTagName(parent, tagName)[0];
	}

};

//========================================================
var slideShow ={
	imgs: [],
	idx:0,
	start: function(){
		for(i=0; i<5; i++){
			slideShow.imgs[i]=new Image();
			slideShow.imgs[i].src="images/widebanner" + i + ".jpg";
		}
		setInterval(slideShow.repeat, 3000);
	},
	repeat: function(){
		var obj = document.getElementById("bigShow");
		obj.src = slideShow.imgs[slideShow.idx++].src;
		slideShow.idx = slideShow.idx%5;
	}
};

//========================================================
var ar = {
	idx: 0,
	opacity: 0,

	start: function(){
		ar.fadeIn();
		ar.idx++;
		setInterval(ar.repeat, 3500);
	},

	repeat: function(){
		var obj = document.getElementById("bigShow");
		ar.opacity = 10;
		obj.src = "images/wideBanner" + ar.idx + ".jpg";
		ar.idx++;
		ar.idx = ar.idx%4;
		ar.fadeIn();
	},

	setOpacity: function(){
		var obj = document.getElementById("bigShow");
		//IE/Win
		obj.style.filter="alpha(opacity:" + ar.opacity + ")";
		//Firefox
		obj.style.opacity=ar.opacity/100;
	},

	fadeIn: function(){
		if (ar.opacity <=100){
			ar.setOpacity();
			ar.opacity += 10;
			window.setTimeout(ar.fadeIn, 150);
		}
	}
};

//========================================================
function jumpURL(obj){
	location.href = obj.options[obj.selectedIndex].value;
}
//========================================================

