﻿// ################## Script For Flash & ActiveX #########################
// +++++++++++++  MakeFlashString(source,id,width,height,wmode) ++++++++
// 
// source: source url --> 플래쉬 파일의 경로
// id: flash id 
// width: source width
// height: source height
// wmode: wmode --> "none, transparent, opaque"
// otherparam : 추가 파라미터 "<param name='myParam' value='myValue' />
// 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


// +++++++++++++  MakeObjectString(classid, codebase, name, id, width,height, param) ++++++++
// 
// classid: classid --> 플래쉬 파일의 경로
// codebase: cab파일 위치 및 버전정보 
// name :
// id :
// width: source width
// height: source height
// 
// wmode: wmode --> "none, transparent, opaque"
// param : 추가 파라미터 "<param name='myParam' value='myValue' />
// 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// Example 
// DocumentWrite(MakeFlashString('image/ml_flash.swf','emb1','330','520','opaque'));
// SetInnerHTML(document.all.mm, MakeFlashString('image/ml_flash.swf','emb1','330','520','opaque'));
// @@주의 사항 
//  - 상호작용 없는 컨텐츠는 DocumentWrite, SetInnerHTML 둘다 사용 가능
//  - 상호작용 있는 컨텐츠는 SetInnerHTML만 사용 가능
// #######################################################################


function MakeFlashString(source,id,width,height,wmode, otherParam)
{	
	return "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0\" width="+width+" height="+height+" id="+id+"><param name=wmode value="+wmode+" /><param name=movie value="+source+" /><param name=quality value=high />"+otherParam+"<embed src="+source+" quality=high wmode="+wmode+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+width+" height="+height+"></embed></object>";
}

function MakeObjectString(classid, codebase, name, id, width,height, param)
{
	return "<object classid="+classid+" codebase="+codebase+" name="+name+" width="+width+" height="+height+" id="+id+"><param name=wmode value="+wmode+" />"+param+"</object>";
}

// innerHTML Type
function SetInnerHTML(target, code)
{ 
	target.innerHTML = code; 
}

// Direct Write Type
function DocumentWrite(src)
{
	document.write(src);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

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_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_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

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 id_check(){  // 회원가입 - 아이디 체크
	var mem_id = document.all.mem_id.value;
	if (mem_id.length > 3 && mem_id.length < 17){
		var popUrl = "ChecK_id.asp?Mem_id="+mem_id;
		window.open(popUrl,"set_prinum","width=360,height=150,scrollbars=yes");
	}else{
		alert("4~16 자리의 ID를 입력해 주세요");
	}
}

function check_id_confirm(id){
	var check_id = document.all.check_id;
	var mem_id = document.all.mem_id;
	var mem_id2 = document.all.mem_id2;
	check_id.value = "yes";
	mem_id.value = id;
	mem_id2.value = id;
	mem_id.focus();
}

function Member_Reg(){ //회원가입 
	
	var check_id = document.all.check_id.value;
	var mem_id = document.all.mem_id;
	var mem_id2 = document.all.mem_id2;
	var mem_name = document.all.mem_name.value;
	var mem_pwd1 = document.all.mem_pwd1.value;
	var mem_pwd2 = document.all.mem_pwd2.value;
	var mem_nickname = document.all.mem_nickname.value;
	var email1 = document.all.email1.value;
	var email2 = document.all.email2.value;
	var mem_sex = document.all.mem_sex.value;
	var mem_nation = document.all.mem_nation.value;

	if (check_id != "yes"){
		alert("ID를 Check해 주세요");	
	}//else if (mem_id != mem_id2){
	//	alert("다시 ID를 Check해 주세요");}
	else if (mem_name.length < 1){
		alert("이름을 입력 하세요.");
		document.all.mem_name.focus();
	}else if (mem_pwd1 != mem_pwd2 || mem_pwd1.length < 1){
		alert("패스워드가 잘 못 되었습니다.");
		document.all.mem_pwd1.focus();
	}else if (mem_nickname.length < 1){
		alert("별명을 입력 하세요.");
		document.all.mem_nickname.focus();
	}else if (email1.length < 1 || email2.length < 1){
		alert("메일이 잘못 되었습니다.");
		document.all.email1.focus();
	}else if (mem_nation.length == 0){
		alert("국가를 선택해 주세요.");
		document.all.mem_nation.focus();
	}else{
		document.myForm.submit();
	}

}
function logout(){  // 회원가입 - 아이디 체크

	var popUrl = "http://www.holidayinkorea.com/Hostel/Member/Logout.asp"
	window.open(popUrl,"set_prinum","width=360,height=150,scrollbars=yes");

}


function ch_konw_path(){
	var konw_path = document.all.konw_path;

	if (konw_path.value = "32")
	{
		alert("...");
	}


}



//Flash 활성화 2007-12-18 게시자 : 이새벽 

//////////////////////////////////////
// IE Embed patch
//
// @author iezn@iezn.com
// @homepage http://iezn.com
// @create date 2006.04.19
// @last modify 2006.04.26
// @version 0.42
// 배포시 위내용을 포함해 주시기 바랍니다
//////////////////////////////////////
/**
* embed 패치 적용 컨테이너
* null인경우 document 값을 기본으로 합니다
* id값을 설정한경우 설정범위 내에만 적용이 됩니다
* 
* 본문이나 일부 노드에만 적용할경우 해당 노드의 id 값을 입력하실 수 있습니다
* 예)
* var __embed_target_id = "contents";
* 로 처리한경우 body 내에 <태그 id="contents">플래쉬,동영상...</태그>
* 안에 내용에만 패치가 적용됩니다
*/
if(typeof(__embed_target_id)=='undefined'){
	var __embed_target_id = null;
}

/**
* embed 패치를 적용할 태그를 설정합니다
* 기본값은 object,eembed,appelt 태그입니다
* false 값인경우 패치에서 제외됩니다
*/
if(typeof(__embed_tags)=='undefined'){
	var __embed_tags = {object:true,embed:true,applet:false}
}

/**
* 플래쉬파일중 flashvars 를 사용할경우 해당 플래쉬의 오브젝트아이디:true 값으로 object를 등록해 주세요
*/
var __flash_force_objs = {};

if(document.attachEvent){
	document.write('<style type="text/css">');
	document.write('object,embed{display:none;}');
	document.write('</style>');
	document.attachEvent('onreadystatechange',
		function (){
			
			if(__embed_target_id===null){
				var __target = document;
			}else{
				var __target = document.getElementById(__embed_target_id);
			}
			if (document.readyState == "complete"){
				function _replace(obj){
					var obj_re = document.createElement(obj.outerHTML);					
					obj_re.style.display='inline';
					obj.parentNode.replaceChild(obj_re,obj);
				}
				function _inner(obj){
					obj.style.display='inline';					
					var html = obj.outerHTML;
					var classid = obj.classid.toLowerCase();
					if(classid=='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' && typeof(__flash_force_objs[obj.id])=='undefined'){//flash 인경우
						obj.insertAdjacentHTML('beforeBegin',html);
						obj.parentNode.removeChild(obj);
					}else if(classid=='clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b'){
						//퀵타임

					}else{
						//변경하고자하는 ActiveX classid 를 추가하시기 바랍니다
						if(classid=='clsid:6bf52a52-394a-11d3-b153-00c04f79faa6' || //media 7
						classid=='clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95' || //6.4
						classid=='clsid:6bf52a52-394a-11d3-b153-00c04f79faa6' ||
						classid=='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'
						){
							embed_pos = html.indexOf('embed');
							if(embed_pos!=-1){//embed 가 존재하는경우
								var embed = '<'+html.substr(embed_pos);
								embed = embed.substr(0,embed.length-9);
								obj.insertAdjacentHTML('beforeBegin',embed);
								obj.parentNode.removeChild(obj);
							}else{
								//object로만 되어 있는경우 동영상 부분만 패치한다
								var embed = document.createElement('embed');
								if(obj.id){
									embed.id = obj.id;
								}
								var total = obj.childNodes.length;
								//embed.setAttribute('autostart',0);
								if(obj.width){
									embed.setAttribute('width',obj.width);
								}
								if(obj.height){
									embed.setAttribute('height',obj.height);
								}
								for(var k=0;k<total;k++){
									n = obj.childNodes.item(k).getAttribute("name");
									v = obj.childNodes.item(k).getAttribute("value");
									if(n=='URL' || n=='url' || n=='FileName'){
										n = 'src';
									}
									embed.setAttribute(n,v);
								}
								if(embed.getAttribute('src')){
									embed.style.display = 'inline';
									obj.parentNode.replaceChild(embed,obj);
								}else{
									//파일엑세스 object가 아닌경우는 유지한다								
								}
							}
						}
					}
				}

				if(__embed_tags.object===true){
					var objs = __target.getElementsByTagName('object');
					var i = objs.length;
					while(i-->0){
						_inner(objs[i]);
					}
				}
				if(__embed_tags.embed===true){
					var objs = __target.getElementsByTagName('embed');
					var i = objs.length;
					while(i-->0){
						_replace(objs[i])
					}
				}

				if(__embed_tags.applet===true){
					var objs = __target.getElementsByTagName('applet');
					var i = objs.length;
					while(i-->0){
						_replace(objs[i])
					}
				}
			}
		}
	);
}


function pu_popup(){  // Pick-up Popup - Banner

	var popUrl = "http://www.holidayinkorea.com/Hostel/Inc/popup.html"
	window.open(popUrl,"set_prinum","width=510,height=360,scrollbars=no,toolbar=no,location=no,directories=no,status=no");

}

//-->
