/*
===========================================
                      common functions
                          written by sg
                  http://www.hilosh.com
                 mailto:spike@hilosh.com
===========================================
*/

var routepath="http://www.brugge.jp/";
var seasoncolor="#993300";
var seasoncolor_light="#BB6033";



function preload() {
	if (document.images) {
		var imageArray = new Array();
		var i = imageArray.length;
		var a = preload.arguments;
		for (i=0;i<a.length;i++) {
			imageArray[i] = new Image;
			imageArray[i].src = routepath+'imgs/'+a[i];
		}
	}
}

function swapImg(imgName,imgNumber) {
	if (document.images) {
		var l = document.images[imgName].src.length;
		var fileType = document.images[imgName].src.slice(l-4,l);
		document.images[imgName].src = routepath+"imgs/"+imgName+imgNumber+fileType;
	}
}

function openWin() {
	window.open('popup.html','brugge_popupwindow','toolbar=no,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=530,height=450');
}

function viewPreview(id) {
	var url = 'popup.php?id='+id;
	window.open(url,'brugge_popupwindow','toolbar=no,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=530,height=450');
}

//====================================================
// color setting on the current menu in Local Navigation
//----------------------------------------------------
document.writeln('<style type="text/css">');
document.writeln('.currentmenu { background-color: '+seasoncolor+' }');
document.writeln('.seasoncolor { background-color: '+seasoncolor+' }');
document.writeln('</style>');


//color setting on Local Navigation==================
function ln_over(ln_number) {
	if (document.styleSheets && (document.all || document.getElementById)) {
		var menubg = document.all && document.all("ln"+ln_number+"_menubg") || document.getElementById && document.getElementById("ln"+ln_number+"_menubg");
		var arrowbg = document.all && document.all("ln"+ln_number+"_arrowbg") || document.getElementById && document.getElementById("ln"+ln_number+"_arrowbg");
		var marginbg = document.all && document.all("ln"+ln_number+"_marginbg") || document.getElementById && document.getElementById("ln"+ln_number+"_marginbg");
		var arrow = document.all && document.all("ln"+ln_number+"_arrow") || document.getElementById && document.getElementById("ln"+ln_number+"_arrow");
		var label = document.all && document.all("ln"+ln_number+"_label") || document.getElementById && document.getElementById("ln"+ln_number+"_label");
		menubg.style.backgroundColor = seasoncolor_light;
		arrowbg.style.backgroundColor = seasoncolor_light;
		marginbg.style.backgroundColor = seasoncolor_light;
		label.style.color="#FFFFFF";
		label.style.textDecoration="underline";
		arrow.src=routepath+"imgs/ln_arrow2.gif";
		arrowbg.style.cursor="hand";
		menubg.style.cursor="hand";
		marginbg.style.cursor="hand";
	}
}
function ln_out(ln_number) {
	if (document.styleSheets && (document.all || document.getElementById)) {
		var menubg = document.all && document.all("ln"+ln_number+"_menubg") || document.getElementById && document.getElementById("ln"+ln_number+"_menubg");
		var arrowbg = document.all && document.all("ln"+ln_number+"_arrowbg") || document.getElementById && document.getElementById("ln"+ln_number+"_arrowbg");
		var marginbg = document.all && document.all("ln"+ln_number+"_marginbg") || document.getElementById && document.getElementById("ln"+ln_number+"_marginbg");
		var arrow = document.all && document.all("ln"+ln_number+"_arrow") || document.getElementById && document.getElementById("ln"+ln_number+"_arrow");
		var label = document.all && document.all("ln"+ln_number+"_label") || document.getElementById && document.getElementById("ln"+ln_number+"_label");
		menubg.style.backgroundColor = "";
		arrowbg.style.backgroundColor = "";
		marginbg.style.backgroundColor = "";
		label.style.color="#4D4D4D";
		label.style.textDecoration="none";
		arrow.src=routepath+"imgs/ln_arrow1.gif";
	}
}




