//--------------------------------------------------------------------------------------------
// ÆäÀÌÁö ¿ëµµ : °øÅë(ÀÚÁÖ)»ç¿ëÇÏ´Â ÀÚ¹ÙÇÔ¼ö
// ÀÛ¼ºÀÏ : 2009-11-19
// ÀÛ¼ºÀÚ : ¹Ú´ëÈÆ
// ÃÖÁ¾ ¼öÁ¤ÀÏ : 
// ±âÅ¸ :
//--------------------------------------------------------------------------------------------

// highslide ºä¾î °ü·Ã 

hs.graphicsDir = '/Common/highslide/graphics/';  
hs.align = 'center';  
hs.transitions = ['expand', 'crossfade'];  
hs.fadeInOut = true;  
hs.dimmingOpacity = 0.8;  
hs.outlineType = 'rounded-white';  
hs.captionEval = 'this.thumb.alt';  
hs.marginBottom = 105 // make room for the thumbstrip and the controls  
hs.numberPosition = 'caption'; 

// Add the slideshow providing the controlbar and the thumbstrip 
hs.addSlideshow({

	//slideshowGroup: 'group1',  
	interval: 5000,  
	repeat: false,  
	useControls: true,  
	overlayOptions: {  
		className: 'text-controls',  
		position: 'bottom center',  
		relativeTo: 'viewport',  
		offsetY: -60  
	},  
		thumbstrip: {  
		position: 'bottom center',  
		mode: 'horizontal',  
		relativeTo: 'viewport' 
	}  
});  

// °Ë»ö °ü·Ã 
function searchCheck() {
	var val = document.searchFrm.searchKey.value;
	if (checkStr(val, " ", "")==0) 
    {
      alert("°Ë»ö¾î ÀÔ·ÂÇÏ¼¼¿ä.");
      document.searchFrm.searchKey.value="";
      document.searchFrm.searchKey.focus();
      return;
    }
	
	document.searchFrm.submit();
}

// °Ë»ö¾î °ü·Ã 
function checkStr(strOrg, strFind, strChange) {
    var position, strOri_Length;
    position = strOrg.indexOf(strFind);  
    
    while (position != -1){
      strOrg = strOrg.replace(strFind, strChange);
      position    = strOrg.indexOf(strFind);
    }
  
    strOri_Length = strOrg.length;
    return strOri_Length;
}

// À¥¿¡µðÅÍ °ü·Ã 
// Á¤±Ô½Ä Ã¼Å©
function isNull( text ) {
	
	 if( text == null ) return true;  

	 var result = text.replace(/(^\s*)|(\s*$)/g, "");  

	 if( result ) return false;  
	 else return true;  
}

// ÇÃ·¡½Ã °ü·Ã 
function onActiveFlash( oId, oUrl, oWidth, oHeight, oMode )
{

var	object = "";
var	param  = "";
var	embed  = "";

	object = "<object id=\""+ oId +"\" width=\""+ oWidth +"\" height=\""+ oHeight +"\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\">";

	param  = "<param name=\"movie\"   value=\""+ oUrl +"\" />";
	param += "<param name=\"quality\" value=\"high\">";
	param += "<param name=\"menu\"    value=\"false\">";
	param += "<param name=\"wmode\"   value=\""+ oMode +"\">";

	embed  = "<embed name=\""+ oId +"\" src=\""+ oUrl +"\" width=\""+ oWidth +"\" height=\""+ oHeight +"\" quality=\"high\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed>";

	document.write(object + param + embed +"</object>");

}

// ÇÃ·¡½Ã °ü·Ã 
function onActiveMovie( oId, oUrl, oWidth, oHeight, oMode )
{

var	object = "";
var	param  = "";

	object = "<object id=\""+ oId +"\" name=\""+ oId +"\" width=\""+ oWidth +"\" height=\""+ oHeight +"\" type=\"application/x-oleobject\" classid=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\">";

	param  = "<param name=\"url\" value=\""+ oUrl +"\">";
	param += "<param name=\"autoStart\" value=\"false\">";
	param += "<param name=\"stretchToFit\" value=\"true\">";
	param += "<param name=\"enableContextMenu\" value=\"false\">";
	param += "<param name=\"volume\" value=\"100\">";
	param += "<param name=\"uimode\" value=\""+ oMode +"\">";

	document.write(object + param +"</object>");

}

// ¿ÀºêÁ§Æ® °ü·Ã 
function onActiveMedia( oId, oUrl )
{

var embed = "";

	embed = "<embed name=\""+ oId +"\" src=\""+ oUrl +"\" stretchToFit=\"true\" showstatusbar=\"true\" enableContextMenu=\"false\" type=\"application/x-oleobject\"></embed>";

	document.write(embed);

}


// ¸Þ´º(·Ñ¿À¹ö)  - µå¸²À§¹ö ¹öÁ¯

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_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 openZipcode () {
	window.open("/include/post.asp","zipcode","width=425,height=265,top=300,left=550");
}

// iframe ³ôÀÌ ÀÚµ¿Á¶Àý 
function resizeFrm(ifr_obj){
        var iframe = ifr_obj.contentWindow.document.body;
  
  var innerHeight = iframe.scrollHeight + (iframe.offsetHeight - iframe.clientHeight);
  var innerWidth = iframe.scrollWidth + (iframe.offsetWidth - iframe.clientWidth);
  
  ifr_obj.style.height = innerHeight;
  ifr_obj.style.width = innerWidth;
  
}


// µ¿¿µ»ó°Ô½ÃÆÇ ·Ñ¿À¹ö

function rollOverBg(idx,div_size) {
	if(div_size == "b") {
		document.getElementById("b_rOverDiv"+idx).style.visibility = "visible";
	}
	else {
		document.getElementById("rOverDiv"+idx).style.visibility = "visible";
	}
}
function rollOutBg(idx,div_size) {
	if(div_size == "b") {
		document.getElementById("b_rOverDiv"+idx).style.visibility = "hidden";
	}
	else {
		document.getElementById("rOverDiv"+idx).style.visibility = "hidden";
	}
}


// ÀÌ¸ÞÀÏ Çü½Ä Ã¼Å©
function isCheckEmail(email){ 

check1 = /[^@]+@[A-Za-z0-9_-]+[.]+[A-Za-z]+/;
check2 =/[^@]+@[A-Za-z0-9_-]+[.]+[A-Za-z0-9_-]+[.]+[A-Za-z]+/;
check3 =/[^@]+@[A-Za-z0-9_-]+[.]+[A-Za-z0-9_-]+[.]+[A-Za-z0-9_-]+[.]+[A-Za-z]+/;

if(check1.test(email.value)) return true;
if(check2.test(email.value)) return true;
if(check3.test(email.value)) return true;
    
return false;
}

// ¼ýÀÚ¸¸ ÀÖ´ÂÁö Ã¼Å©
function isCheckNumber(number) {
	var regCheck = /^[0-9]+$/;
	if(!regCheck.test(number)) return false;
	else return true;
} 

// ÇÑ±Û¸¸ ÀÖ´ÂÁö Ã¼Å©
function isCheckString(str) {
	var regCheck = /^[¤¡-¤¾°¡-ÆR]+$/;
	if(!regCheck.test(str)) return false;
	else return true;
} 

// ÁÖ¹Îµî·Ï ¹øÈ£ Ã¼Å©
function isCheckRegNo(regNo1,regNo2) {
	var regNo = eval(regNo1+"-"+regNo2);
	var regCheck = /\d{6} \- [1-4]\d{6}/;
	if(!regCheck.test(regNo)) return false;
	else return true;
}


function isCheckRegNo2(regNo1,regNo2) {
    var regNo = regNo1+regNo2;
    var total = 0;
    for(var i=0; i<=13; i++){
		if(i<=7) total += parseInt(regNo.charAt(i)) * (i+2);
		else if(i>=8 && i<=11) total += parseInt(regNo.charAt(i)) * (i-6);
    }
	var check= (11-(total%11))%10
    if(parseInt(check) == parseInt(regNo.charAt(12))) { return true };
	else { return false };
}

// È«º¸µ¿¿µ»ó °ü·Ã

function video_play(url) {
	MediaPlayer.Open(url);
}

function newWin(url) {
	window.open(url,"OPEN","width=660,height=550,scrollbars=yes,resizable=yes")
}

function mmsChange(replacemmsSource){
	if(navigator.appName == "Netscape") { 
		document.MediaPlayer.SetFileName(replacemmsSource); 
	} else { 
		document.MediaPlayer.FileName = replacemmsSource; 
	}
	return;
}

var bWin32IE;
if ((navigator.userAgent.indexOf("IE") != "-1") && (navigator.userAgent.length > 1)) {
	bWin32IE = true;
} else {
	bWin32IE = false;
}

function play(){
	if (bWin32IE == true) {
		document.MediaPlayer.play();
	} else {
		document.MediaPlayer.Play();
	}
}


function stop(){
	if (bWin32IE == true) {
		document.MediaPlayer.stop();
	} else {
		document.MediaPlayer.Stop();
		document.MediaPlayer.SetCurrentPosition(0);
	}
}

function cs(){   
	if (bWin32IE == true) {   
		document.MediaPlayer.stop();
	} else {   
		document.MediaPlayer.stop();
	}   
}   

function full(){   
	if (bWin32IE == true) {   
		document.MediaPlayer.DisplaySize = 3;   
		document.MediaPlayer.Play();   
	} else {   
		document.MediaPlayer.SetDisplaySize(3);   
		document.MediaPlayer.Play();   
	}   
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// Á¦Ç° ÀÌ¹ÌÁö º¸±â

var win1Open = null
function winClose(){
if(win1Open != null) win1Open.close() 
}

function doNothing(){}
function displayImage(picName, windowName, windowWidth, windowHeight){
var winHandle = window.open("" ,windowName,"toolbar=no,scrollbars=no,resizable=no,width=" + windowWidth + ",height=" + windowHeight)
if(winHandle != null){
var htmlString = "<html><head><title>Picture</title></head>" 
htmlString += "<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>"
htmlString += "<a href=javascript:window.close()><img src=" + picName + " border=0 alt=´Ý±â></a>"
htmlString += "</body></html>"
winHandle.document.open()
winHandle.document.write(htmlString)
winHandle.document.close()
} 

if(winHandle != null) winHandle.focus()
return winHandle
}
