var timer;

function openWin(src,width,height,left,top,scroll) {
	if (left==null || left=="") left=(screen.width-width) / 2;
	if (top==null || top=="") top=(screen.height-height) / 2;
	if (scroll=="") scroll="auto";
	var win = window.open(src,"", "toolbar=no,scrollbars="+scroll+",location=no,status=no,width="+width+",height="+height+",left=" + left + ", top=" + top + ",resizable=no");
	win.focus();
}

function openPic(src,title,width,height,left,top) {
	if (window.pic!=null) window.pic.close();
	if (left==null) left=(screen.width-width) / 2;
	if (top==null) top=(screen.height-height) / 2;
	pic = window.open('','pic','width=' + width + ',height=' + height + ',left=' + left + ', top=' + top + ',statusbar=0,menu=0');
	pic.focus();
	pic.document.open();
	pic.document.write("<html><head><title>" + title + "</title></head>");
	pic.document.write("<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>");
	pic.document.write("<a href='javascript:this.close()'><img src='" + src + "' border='0' width='" + width + "' height='" + height + "'></a>");
	pic.document.write("</body></html>");
	pic.document.close();
}

function animateHeader(mode,no) {
	if (mode=="on") document.getElementById("menu-"+no).style.background = "url('./img/menu-top-all_bg_a.gif')";
	else document.getElementById("menu-"+no).style.background = "url('./img/menu-top-"+no+"_bg.gif')";
	if (no==6) return;
	var myParent = document.getElementById("header-motive");
	var myChildren = myParent.childNodes;
	var arr = new Array("360","pa","no","ra","ma");
	if (mode=="on") {
		for( var i = 0; i < myChildren.length; i++ ) {
			if (myChildren[i].nodeType == 1) {
				if (no==i+1) myChildren[i].style.background = "url('./img/header-motive-" + arr[i] + "_a.gif') no-repeat";
			}
		}
	} else if (mode=="off") {
		for( var i = 0; i < myChildren.length; i++ ) {
			if (myChildren[i].nodeType == 1) {
				myChildren[i].style.background = "url('./img/header-motive-" + arr[i] + ".gif') no-repeat";
			}
		}
	}
}
