////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//  ▒   imgOver
//
//**************************************************************************************************************
//
//  Example)
//      <img src="/_image/common/이미지.jpg" alt="" title="" onmouseover="imgOver(this)" onmouseout="imgOver(this,'out')">
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function imgOver(imgEl,opt) {
    var src = imgEl.getAttribute('src');
    var ftype = src.substring(src.lastIndexOf('.'), src.length);
    
    if (opt == 'out') imgEl.src = imgEl.src.replace("_over"+ftype, ftype);
    else imgEl.src = imgEl.src.replace(ftype, "_over"+ftype);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//  ▒   goFlash
//
//**************************************************************************************************************
//
//  Usage) 플래시 링크 자바스크립트 연동
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function flashMovie(fid,src,wid,hei,fvs,wmd) {
  this.fPrint = '';
  this.Id = document.getElementById(fid);
  this.Src = src;
  this.Width = wid;
  this.Height = hei;
  this.FlashVars = (fvs != undefined)? fvs :'';
  this.Wmod = (wmd != undefined)? wmd :'';
  if(isObject(Id)) {

	fPrint = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+Width+'" height="'+Height+'" id="wisa_'+fid+'">';
    fPrint += '<param name="movie" value="'+Src+'">';
	fPrint += '<param name="allowScriptAccess" value="always" />';
	fPrint += '<param name="allowFullScreen" value="false" />';
    fPrint += '<param name="quality" value="high">';
    fPrint += (FlashVars != null) ? '<param name="FlashVars" value="'+FlashVars+'">' : '';
    fPrint += (Wmod != null) ? '<param name="wmode" value="'+Wmod+'">' : '';
    fPrint += '<embed';
    fPrint += ' src="'+Src+'"';
    fPrint += (FlashVars != null) ? ' FlashVars="'+FlashVars+'"' : '';
    fPrint += (Wmod != null) ? ' wmode="'+Wmod+'"' : '';
    fPrint += ' quality="high"';
	fPrint += ' allowScriptAccess="always"';
	fPrint += ' allowFullScreen="false"';
    fPrint += ' pluginspage="http://www.macromedia.com/go/getflashplayer"';
    fPrint += ' type="application/x-shockwave-flash" ';
    fPrint += ' width="'+Width+'"';
    fPrint += ' height="'+Height+'"';
    fPrint += '></embed>';
    fPrint += '</object>';
    Id.innerHTML = fPrint;
  }
}

function isObject(a) {
    return (a && typeof a == 'object');
}

var flashLink=new Array();

/* 상단 네비 플래시 */
flashLink['btn_logo']="/";
flashLink['btn_oana']="/";

flashLink['topDefBtn_00']="/";
flashLink['topDefBtn_01']="/member/login.php";
flashLink['topDefBtn_02']="/main/exec.php?exec_file=member/logout.exe.php";
//flashLink['topDefBtn_03']="/mypage/mypage.php";
flashLink['topDefBtn_04']="mailto:oanasummit@yna.co.kr";
flashLink['topDefBtn_05']="/content/content.php?cont=sitemap";

flashLink['topMainMenu_00']="/content/content.php?cont=invitation_oana";
flashLink['topMainMenu_01']="/content/content.php?cont=congress_overview";
flashLink['topMainMenu_02']="/content/content.php?cont=participants";
flashLink['topMainMenu_03']="/content/content.php?cont=program_glance";
flashLink['topMainMenu_04']="/content/content.php?cont=exhibition";
flashLink['topMainMenu_05']="/content/content.php?cont=registration_how";
flashLink['topMainMenu_06']="/content/content.php?cont=information_seoul";
flashLink['topMainMenu_07']="/board?db=notice";

function goFlash(n){
    //alert(n);
    if (flashLink[n]) location.href=flashLink[n];
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//  ▒   시차
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var timeStamp = 60000;

function gettime() {
today = new Date();
year = today.getYear();
month =  today.getMonth();
month = month + 1;
day = today.getDate();
hours = today.getHours();
minutes = today.getMinutes();
seconds = today.getSeconds();

timeStamp = (60 - seconds ) * 1000;
}

function koreatime() {
gettime();

var hourTmp = hours<10 ? "0" + hours : hours + "";
var minTmp  = minutes<10 ? "0" + minutes : minutes + "";
var secTmp  = seconds<10 ? "0" + seconds : seconds + "";

if(hours >= 18 || hours < 6)
  getObjectFirst("korea").bgColor = "white";
else 
  getObjectFirst("korea").bgColor = "white";

var htmlTmp = "";

htmlTmp += "<img src='/_image/common/s01.gif' border='0'>"
		  +  "<img src='/_image/common/s" + hourTmp.substring(0, 1) + ".gif' border='0'>"
		  +  "<img src='/_image/common/s" + hourTmp.substring(1) + ".gif' border='0'>"
		  +  "<img src='/_image/common/scomma.gif' border='0'>" 
		  +  "<img src='/_image/common/s" + minTmp.substring(0, 1) + ".gif' border='0'>"
		  +  "<img src='/_image/common/s" + minTmp.substring(1) + ".gif' border='0'>"
		  +  "<img src='/_image/common/s02.gif' border='0'>";	    
getObjectFirst("korea").innerHTML = htmlTmp;

setTimeout("koreatime()", timeStamp);
}

function citytime() {
gettime();
zone = getObjectFirst("cityname").options[getObjectFirst("cityname").selectedIndex].value;
hours = parseInt(hours) + parseInt(zone);

if (hours < 0) {
	hours = hours + 24;
}

if (hours > 23) {
	hours = hours - 24;
}

if(hours >= 18 || hours < 6)
  getObjectFirst("city").bgColor = "white";
else 
  getObjectFirst("city").bgColor = "white";

var hourTmp = hours<10 ? "0" + hours : hours + "";
var minTmp  = minutes<10 ? "0" + minutes : minutes + "";
var secTmp  = seconds<10 ? "0" + seconds : seconds + "";

var htmlTmp = "";

htmlTmp += "<img src='/_image/common/t01.gif' border='0'>"
		  +  "<img src='/_image/common/t" + hourTmp.substring(0, 1) + ".gif' border='0'>"
		  +  "<img src='/_image/common/t" + hourTmp.substring(1) + ".gif' border='0'>"
		  +  "<img src='/_image/common/tcomma.gif' border='0'>" 
		  +  "<img src='/_image/common/t" + minTmp.substring(0, 1) + ".gif' border='0'>"
		  +  "<img src='/_image/common/t" + minTmp.substring(1) + ".gif' border='0'>"
		  +  "<img src='/_image/common/t02.gif' border='0'>";

getObjectFirst("city").innerHTML = htmlTmp;
setTimeout("citytime()", timeStamp);
}

/* 기본 데이터값을 LA 로 지정하며, 시간도 같이 지정한다. */
function fncOnLoad(){
koreatime();

getObjectFirst("cityname").selectedIndex = 0;

citytime();
}

function getObjectFirst(targetName){
return document.getElementById(targetName);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//  ▒   포토뉴스
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function photoPicCtr(){
 var photoPicName ;
 for (i=1; i<=3; i++){
  photoPicName = "photoPic" + i ;
  document.getElementById(photoPicName).style.display = "none" ;
 }
 photoPicName = "photoPic" + arguments[0] ;
 document.getElementById(photoPicName).style.display = "" ;

 var photoThumbName ;
 var photoActNum ;
 for (i=0;i<=1; i++){
  photoThumbName = "photoThumb" + i ;

 }
 if (eval(arguments[0]) <= 3) photoActNum = 1 ;
 else photoActNum = 0 ;
 photoThumbName = "photoThumb" + photoActNum ;

}
