
window.onload = function() {
	Dizsc.nav("nav");
	Dizsc.openWindow("blank1","","width=411,height=484");
	Dizsc.openWindow("blank2","","width=518,height=732");
	Dizsc.openWindow("blank3","","width=296,height=200");
	Dizsc.openWindow("blank4","","width=518,height=732");
	Dizsc.openWindow("blank5","","width=276,height=151");
	Dizsc.openWindow("blank6","","width=899,height=577");
	Dizsc.openWindow("blank7","","width=824,height=135");
	Dizsc.openWindow("blank8","","width=562,height=446");
	Dizsc.openWindow("blank9","","width=546,height=432");
	Dizsc.openWindow("blank10","","width=539,height=405");
	Dizsc.openWindow("blank11","","width=550,height=452");
	Dizsc.openWindow("blank12","","width=576,height=250");
	Dizsc.openWindow("blank13","","width=570,height=480");
	Dizsc.openWindow("blank14","","width=567,height=464");
	Dizsc.openWindow("blank15","","width=712,height=420");
}

var Dizsc = {
	currentUrl: window.location.href,
	
	rollImg: function(imgName,imgSrc) {
		imgName.oriSrc = imgSrc;
		imgName.rollSrc = imgSrc.replace(/(\.gif|\.jpg|\.png)/ , "_over"+"$1");	
	},
	
	preLoad: {
		imgFolder: [],
		img: function (rep,imgName){
			this.imgFolder[rep] = new Image();
			this.imgFolder[rep].setAttribute("src",imgName);
		}
	},
		
	mouseEvent: function(imgName) {
		imgName.onmouseover = function(){
			this.setAttribute("src", this.rollSrc);
		}
		imgName.onmouseout = function(){
			this.setAttribute("src", this.oriSrc);
		}
	}
};

Dizsc.nav = function(tgtName) {
	if (!document.getElementById(tgtName)) return false;
	
	var idName = document.getElementById(tgtName);	
	var aTag = idName.getElementsByTagName("a");
	
	for (var i=0; j=aTag.length, i<j; i++) {
		var FCImg = aTag[i].firstChild;
		
		if (FCImg.nodeType == 1 && FCImg.nodeName == "IMG") {
			var FCImgSrc = FCImg.getAttribute("src");
			
			this.rollImg(FCImg,FCImgSrc);
			this.preLoad.img(i,FCImg.rollSrc);
			
			if (FCImgSrc.indexOf("_over") == -1) {	
				this.mouseEvent(FCImg);
			}
		}
	}
};

Dizsc.openWindow = function(tatName,blank,size) {
	var aTag = document.getElementsByTagName("a");
	
	for (var i=0; j= aTag.length, i<j; i++) {
		if (aTag[i].className == tatName) {
			 aTag[i].onclick = function() {
				window.open(this.getAttribute("href"),blank,size);
				return false;
			}
		}
	}
};

