function vesselinfo(obj){
	window.open('/eservice/vessel/vesselinfo.jsp?vessel_cd='+obj+'','newwin','width=470,height=270,scrollbars=1')
}

function vesselinfo_k(obj){
	window.open('/korea/eservice/vessel/vesselinfo.jsp?vessel_cd='+obj+'','newwin','width=400,height=200,scrollbars=1')
}

function newcertify(obj){
	window.open('/about/safety/'+obj+'.jsp','newwin','width=618,height=700,scrollbars=1')
}

function whichCompany(obj){
	window.open('/maritime/iso/iso_svc.jsp?imi_company='+obj+'','isowin','width=820,height=450,scrollbars=1,resizable=1')
}

function City(obj){
	obj = "/service/business/exclusive/" + obj + ".jsp";
	window.open(obj,"City","width=550,height=550,scrollbars=yes");
}

function Commerce(obj1, obj2){
	window.open('/service/commerce/'+obj1+'.jsp','newwin','width=560,height='+obj2+',scrollbars=1')
}

function newwin(obj){
	window.open('/about/newwin/'+obj+'.jsp','newwin','width=800,height=600')
}

function newglobal(obj){
	window.open('/global/globalinfo.jsp?I_CNT_CD='+obj,'newglobal','width=570,height=700,scrollbars=1,resizable=1');
}

function newsc(obj){
	window.open('/eservice/schedule/'+obj+'.jsp','newwin','width=570,height=400,scrollbars=1');
}

function Notice(){
	window.open('/home/notice.jsp','newwin','width=570,height=400,scrollbars=1');
}

function Related(){
	window.open('/home/related2.jsp','newwin','width=570,height=400,scrollbars=1');
}

function Others(form){
	var myindex=form.others.selectedIndex
	if(form.others.options[myindex].value != null){
		window.location=form.others.options[myindex].value;
	}
}

function newphoto(obj){
	window.open('/about/photo/newphoto/'+obj+'.jsp','newphoto','width=800,height=600')
}

function newsckor(obj){
	window.open('/korea/eservice/schedule/'+obj+'.jsp','newwin','width=570,height=400,scrollbars=1');
}

function newroute(obj){
	window.open('/service/route/'+obj+'.jsp','newroute','width=570,height=700,scrollbars=1');
}

function Safety(obj){
	window.open('/about/safety/'+obj+'.jsp','Safety','width=600,height=700,scrollbars=1');
}

function qm_disappear(){
    select2.style.visibility="hidden";
}

function qm_reappear(){
    select2.style.visibility="visible";
}

function qc_disappear(){
    document.quickcargo.quicktype.style.visibility="hidden";
}

function qc_reappear(){
    document.quickcargo.quicktype.style.visibility="visible";
}

function qv_disappear(){
    document.vessel.vessel_cd.style.visibility="hidden";
}

function qv_reappear(){
    document.vessel.vessel_cd.style.visibility="visible";
}

function MM_findObj(n, d) { //v3.0
	var p,i,x;
	if(!d)
	d=document;

	if((p=n.indexOf("?"))>0&&parent.frames.length){
		d=parent.frames[n.substring(p+1)].document;
		n=n.substring(0,p);
	}

	if(!(x=d[n])&&d.all)
	x=d.all[n];

	for (i=0;!x&&i<d.forms.length;i++)
	x=d.forms[i][n];

	for(i=0;!x&&d.layers&&i<d.layers.length;i++)
	x=MM_findObj(n,d.layers[i].document);

	return x;
}

function MM_showHideLayers() { //v3.0
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for(i=0; i<(args.length-2); i+=3){
		if((obj=MM_findObj(args[i]))!=null){
			v=args[i+2];
			if(obj.style){
				obj=obj.style;
				v=(v=='show')?'visible':(v='hide')?'hidden':v;
			}
			obj.visibility=v;
		}
	}
}

function MM_preloadImages() { //v3.0
	var d=document;
	if(d.images){

		if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments;

		for(i=0; i<a.length; i++)

		if(a[i].indexOf("#")!=0){
			d.MM_p[j]=new Image;
			d.MM_p[j++].src=a[i];
		}
	}
}

function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr;
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
	x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments;
	document.MM_sr=new Array;
	for(i=0;i<(a.length-2);i+=3)
	if((x=MM_findObj(a[i]))!=null){
		document.MM_sr[j++]=x;

		if(!x.oSrc)
		x.oSrc=x.src; x.src=a[i+2];
	}
}

function ImgOn(Name){
	ImgName  =  Name;
	KeepVar =  Name;
	SwitchImg = "/img/" + Name + ".gif";
	document.images[Name].src=SwitchImg;
}

function Fix(){
	SwitchImg = "/img/" + ImgName + ".gif";
	document.images[ImgName].src=SwitchImg;
}

function ImgOn_kor(Name_kor){
	ImgName_kor  =  Name_kor;
	KeepVar_kor =  Name_kor;
	SwitchImg_kor = "/img/korea/about/" + Name_kor + "_1.gif";
	document.images[Name_kor].src=SwitchImg_kor;
}

function Fix_kor(){
	SwitchImg_kor = "/img/korea/about/" + ImgName_kor + ".gif";
	document.images[ImgName_kor].src=SwitchImg_kor;
}

function Change(service, location) {
	var temp = service.value;
	if (temp == "1") {
		location.options[0] = new Option("Seattle");
		location.options[1] = new Option("Long beach");
		location.options[2] = new Option("Oakland");
		location.options[3] = new Option("Busan Kamcheon");
		location.options[4] = new Option("Busan Kamman");
		location.options[5] = new Option("Kwangyang");
		location.options[6] = new Option("Kaohsiung");
		location.options[7] = new Option("Tokyo");
		location.options[8] = new Option("Osaka");

		location.options.length = 9;
		select_maker="Terminal";
	}else if (temp == "2"){
		location.options[0] = new Option("Shanghai");
		location.options[1] = new Option("Tianjin");
		location.options[2] = new Option("Dailian");
		location.options[3] = new Option("Qingdao");
		location.options[4] = new Option("Lat Krabang");
		location.options[5] = new Option("Port Kelang");

		location.options.length = 6;
		select_maker="ODCY";
	}
	location.selectedIndex = 0;
	location.focus();
}

/* »õ·Î Ãß°¡ */
function NumChk(num){
	if( String != "" ){
		count = 0;
		cp_string = "1234567890-";

		for(i = 0 ; i < 12 ; i++){
			for(j = 0 ; j < num.length ; j++){
				if(cp_string.charAt(i) == num.charAt(j)){
					count++;
				}
			}
		}

		if(count == num.length){
			return true;
		}else{
			return false;
		}
	}
	return true;
}

function chkString(str , type, errmsg){
	if(str != ""){
		type = type.toUpperCase();

		count = 0;
		roof  = 0;

		if(type == "DIGIT"){
			cp_string = "1234567890";
			roof = 10;
		}else if(type = "ID" ){
			cp_string = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890, ";
			roof = 26 + 26 + 10 + 2;
		}

		for(i = 0 ; i < roof ; i++){
			for(j = 0 ; j < str.length ; j++){
				if(cp_string.charAt(i) == str.charAt(j) ){
					count++;
				}
			}
		}

		if( count == str.length ){
			return true;
		}else{
			alert(errmsg);
			return false;
		}
	}else{
		return true;
	}
}

function chkDate(fm){
	var tmp = '';
	var txt = fm.value;
	var mm;
	var dd;
	var yyyy;

	for(var i=0;i<txt.length;i++){
		if(txt.charAt(i)!=' ')
			tmp = tmp + txt.charAt(i);
		}

		if(tmp.length != 6){
			alert('Input Data Invalid...(Ex:010101)');
			return false;
		}else{
			mm = tmp.substring(0,2);
			if( mm.charAt(0) == "0" )
				mm = parseInt( mm.charAt(1) );
			else
				dd = parseInt( dd );

			dd = tmp.substring(2,4);
			if( dd.charAt(0) == "0" )
				dd = parseInt( dd.charAt(1) );
			else
				dd = parseInt( dd );

			if(isNaN(mm)!=false || isNaN(dd)!=false){
				alert('Not Number Type Data');
				return;
			}

			if(mm < 1 || mm > 12){
				alert('Month Data Invalid');
				return;
			}else{
				if(mm != 2){
					if(dd <= 0 || dd > 31){
						alert('Day Data Invalid');
						return;
				}
			}else{
				if(dd <= 0 || dd > 29){
					alert('Day Data Invalid');
					return;
				}
			}
		}
	}
	return true;
}

function check_float(str, errmsg){
    if(str != ""){
		cp_string = "1234567890.";
		roof = 11;
		count = 0;

		for( i = 0 ; i < roof ; i++ ){
			for( j = 0 ; j < str.length ; j++ ){
				if(cp_string.charAt(i) == str.charAt(j)){
					count++;
				}
			}
		}

		if( count == str.length ){
			return true;
		}else{
			alert(errmsg);
			return false;
		}
    }else{
		return true;
    }
}

function sendMail(title){
    if (document.all.mail_print != null){
        window.open('/eservice/sendmailin.jsp','Mail','width=500,height=200,left=200,top=150');
    }else{
        alert("Sorry this page is not support Mail");
    }
}

function sendPrint(){
    if (document.all.mail_print != null){
       window.open('/eservice/sendprint.jsp','Print','width=800,height=500,left=100,top=100,scrollbars=yes');
    }else{
        alert("Sorry this page is not support Print");
    }
}

function check_float2(str, len, len2){
	if(isNaN(str)){
		alert('Invalid Number Type!');
		return false;
	}
	var f = new Array();
	var digit = '';
	var deci = '';
    if(str != ""){
		if(str.indexOf('.')!=-1){
			f = str.split('.');
			digit = f[0];
			deci = f[1];
			// ÀüÃ¼ ÀÚ¸®¼ö°¡ 11ÀÚ¸®°¡ ³Ñ´ÂÁö ÆÇ´Ü
			if(digit.length + deci.length > len){
				alert('You must input data less than '+len+'!');
				return false;
			}else if(deci.length > len2){
				alert('Decimal value length cannot over ' + len2 + '!');
				return false;
			}else{
				return true;
			}
		}else{
			return true;
		}
    }else{
		return true;
    }
}

function check_value(name,errmsg){
	if((name == '') || (name == null) || (name == ' ')){
		alert(errmsg);
		return false;
	}else{
		return true;
	}
}

function check_digit(str, errmsg){
	if(str != ""){
		cp_string = "1234567890";
		roof = 10;
		count = 0;
		
		for(i = 0 ; i < roof ; i++){
		     for(j = 0 ; j < str.length ; j++){
		          if(cp_string.charAt(i) == str.charAt(j)){
		               count++;
		          }
		     }
		}
		
		if(count == str.length){
		     return true;
		}else{
		     alert(errmsg);
		     return false;
		}
	}else{
		return true;
	}
}

function check_temp(str, errmsg){
	if(str != ""){
		cp_string = "1234567890-";
		roof = 12;
		count = 0;
		
		for(i = 0; i < roof; i++){
			for( j = 0 ; j < str.length ; j++ ){
				if( cp_string.charAt(i) == str.charAt(j) ){
					count++;
				}
			}
		}
		
		if(count == str.length){
		     return true;
		}else{
		     alert(errmsg);
		     return false;
		}
	}else{
		return true;
	}
}
