if(self !=top){
	top.location.href=self.location.href;
}

//confirm with sending form
function conf() {
	if (confirm("Are you sure to send this form?")) {
		return true;
	} else {
		return false;
	}
}

//select menu 
function SelectPage(){
	if(document.f1.s1.options[document.f1.s1.selectedIndex].value != "-"){
		var addr = document.f1.s1.options[document.f1.s1.selectedIndex].value;
		document.f1.s1.options[0].selected = true;
		document.location = addr;
	}
	else{
		document.f1.s1.options[0].selected = true;
	}
}

//window open
var win2;
function WinOpen(NUM,ww,hh){
	if (win2) {win2.close();}	
	if (arguments.length == 3){
		win2=window.open(NUM+'.html','WinName','toolbar=0,location=0,scrollbars=1,resizable=1, width='+ ww + ',height=' +hh+ ',left=0, top=0,screenX=0,screenY=0');
	  }else{
		win2=window.open(NUM+'.html','WinName','toolbar=0,location=0,scrollbars=1, resizable=1');
	}
	win2.focus();
}

//window open for large photografy with "size" & "message"
var win1 = null;
function WinOpen1(img,w,h,mes) {
	winW = w + 20;
	winH = h + 100;
	winStr = "toolbar=no,location=no,scrollbars=no,left=0,top=0,resizable=no,width=" + winW + ",height=" + winH ;
	imgStr = " width='" + w + "' height='" + h + "'";

	if(win1 == null){
		win1 = window.open("","newWin",winStr);
		}else{
			if(win1.closed){
				win1 = window.open("","newWin",winStr);
				}else{
				win1.close();
				win1 = window.open("","newWin",winStr);
			}
	}
	win1.document.write('<html><head>');
	win1.document.write('<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=iso-8859-1">');
	win1.document.write('<TITLE>Large Photo</TITLE>')
	win1.document.write('</head>');
	win1.document.write('<body>');
	win1.document.write('<div align="center">');
	win1.document.write('<img src =' + img + imgStr + ' name="LPhoto">');
	win1.document.write('</div>');
	win1.document.write('<hr>');
	win1.document.write('<div align="center" style="font-family:sans-serif">' + mes + '</div>');
	win1.document.write('<form name ="fm1"><div align="center">');
	win1.document.write('<input type="button" name="closeBtn" value="close" style="font-family:sans-serif" onClick="self.close();">');
	win1.document.write('</div></form>');
	win1.document.write('</body></html>');
	win1.focus();
}
