//마우스무브시 이미지 변경
function hoverf(imgid,bool,type) {
	overoutID = document.getElementById(imgid);

	if (type!='') {
		overoutID.src = "image/" + imgid + ((bool)? "_ov."+type :"."+type) ;
	} else {
		overoutID.src = "image/" + imgid + ((bool)? "_ov.gif" :".gif") ;
	}

}

//마우스무브시 이미지 변경
function hoverf_admin(imgid,bool,type) {
	overoutID = document.getElementById(imgid);

	if (type!='') {
		overoutID.src = "../image/" + imgid + ((bool)? "_ov."+type :"."+type) ;
	} else {
		overoutID.src = "../image/" + imgid + ((bool)? "_ov.gif" :".gif") ;
	}

}

//게시판 검색시 사용(list와 view사이)
function chkSearch(part,subpart) {

	if(this.search.value.length==0) {
		alert("검색어를 입력하세요.");
		this.search.focus();
		return false;
	}
	
	f=this.field_sel.value;
	s=this.search.value;
	pageMove(part+'.php','',part,subpart,f,s);
}


//게시판 검색시 사용(list와 view사이)
function chkSearch_admin(part,subpart,mode,lang) {

	if(this.search.value.length==0) {
		alert("검색어를 입력하세요.");
		this.search.focus();
		return false;
	}
	
	f=this.field.value;
	s=this.search.value;
	pageMove(subpart+'.php','',part,subpart,f,s,'',mode,lang);
}

//게시판 검색시 사용(list와 view사이) - 스케쥴용
function chkSearchSC(part,subpart,mode,lang, c_uid, c_title) {

	if(this.search.value.length==0) {
		alert("검색어를 입력하세요.");
		this.search.focus();
		return false;
	}
	
	f=this.field.value;
	s=this.search.value;
	pageSC(subpart+'.php','',part,subpart,f,s,'',mode,lang, c_uid, c_title);
}

//part별로 이동하는 펑션.. 중간part페이지 및 메인에서 사용한다
function pageMove(act,page,part,subpart,field,search,uid,mode,mylanguage) {

	frmMove.page.value=page;
	frmMove.part.value=part;
	frmMove.subpart.value=subpart;
	frmMove.field.value=field;
	frmMove.search.value=search;
	frmMove.uid.value=uid;
	frmMove.mode.value=mode;
	frmMove.mylanguage.value=mylanguage;
	frmMove.action = act;
	frmMove.submit();	
}

//schedule별로 이동하는 펑션.. 중간part페이지 및 메인에서 사용한다
function pageSC(act,page,part,subpart,field,search,uid,mode,mylanguage,c_uid, c_title) {

	frmMove.page.value=page;
	frmMove.part.value=part;
	frmMove.subpart.value=subpart;
	frmMove.field.value=field;
	frmMove.search.value=search;
	frmMove.uid.value=uid;
	frmMove.mode.value=mode;
	frmMove.mylanguage.value=mylanguage;
	frmMove.c_uid.value=c_uid;
	frmMove.c_title.value=c_title;
	frmMove.action = act;
	frmMove.submit();	
}

//2011.11.03 windjr
function newsea(){
	//var wind = 
	window.open('http://www.samyoungexp.com/schedule/index.php?bound=sea', 
		'', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=750, height=720'); 
}

function newair(){
	//var wind = 
	window.open('http://www.samyoungexp.com/schedule/index.php?bound=air', 
		'', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=750, height=720'); 
}
//

//
function remodeling() {
	alert("공사중입니다");
}


function resize_img(obj,frm){
	//미니갤러리-0 / 갤러리폼-1
	if (frm==0)	{		
		if(obj.readyState=="complete"){			
			if(obj.width>240) obj.style.width="240px";	
			if(obj.height>150) obj.style.height="150px";	
		}	
	} else if (frm==1) {
		if(obj.readyState=="complete"){
			obj.style.width="500px";	
			obj.style.height=500/obj.style.width*obj.height;	
		}	
	}
	
}


//업로드파일이 그림파일 인지 확장자확인
function extChk(file_obj,frm){

	with(frm){

		gfile=file_obj.value;
		extArray = new Array(".jpg", ".gif", ".png", ".bmp", ".jpeg"); 
		allowSubmit = false; 
		
		while (gfile.indexOf("\\") != -1) 
		{ 
			
			gfile = gfile.slice(gfile.indexOf("\\") + 1); 
			ext = gfile.slice(gfile.indexOf(".")).toLowerCase(); 

			for (var i = 0; i < extArray.length; i++) 
			{ 
				if (extArray[i] == ext) 
				{
				 allowSubmit = true; 
				 break; 
				} 
			 } 
		} 
		return (allowSubmit);

	}
}


//업로드파일의 사이즈 리턴
function sizeChk(f, frm){	
	var oas = new ActiveXObject("Scripting.FileSystemObject");
	var e = oas.getFile(f.value);
	return (e.size);
}
