﻿/**
 * File Name : default.js
 * Description : 기본스크립트 설정
 * @author Web business Team / Choi Hyun Mi
 * Email : designtj@olymcompnay.com
 * Date : 2011.02.11
 * Update : 2011.02.11
 * Copyright (c) 2011 OLYM Communications. All Rights Reserved.
 */

//------------------------------------------------------------------------------
// png 파일 ie6에서도 투명유지
//------------------------------------------------------------------------------
function setPng24(obj) {
  obj.width=obj.height=1;
  obj.className=obj.className.replace(/\bpng24\b/i,'');
  obj.style.filter =
  "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
  obj.src=''; 
  return '';
}
	
//------------------------------------------------------------------------------
// 롤오버
//------------------------------------------------------------------------------
function rollover(obj){
  var img_name = obj.getElementsByTagName("img").item(0).src;
  var img_extension = img_name.substring(img_name.lastIndexOf(".")+1);
  var img_on = "_over."+img_extension;
  var img_off = "_off."+img_extension;
  obj.getElementsByTagName("img").item(0).src = img_name.replace(img_off, img_on);
}

//------------------------------------------------------------------------------
// 롤아웃
//------------------------------------------------------------------------------
function rollout(obj){
  var img_name = obj.getElementsByTagName("img").item(0).src;
  var img_extension = img_name.substring(img_name.lastIndexOf(".")+1);
  var img_on = "_over."+img_extension;
  var img_off = "_off."+img_extension;
  obj.getElementsByTagName("img").item(0).src = img_name.replace(img_on, img_off);
}

//------------------------------------------------------------------------------
// 플래쉬 연결
//------------------------------------------------------------------------------
function flash_maker(url, width, height, mode) {
  var flashbody = "";
  flashbody = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+width+"' height='"+height+"'>";
  flashbody += "<param name='allowScriptAccess' value='"+url+"' />";

  flashbody += "<param name='movie' value='"+url+"' />";
  flashbody += "<param name='quality' value='high' />";
  flashbody += "<param name='wmode' value='"+mode+"' />";
  flashbody += "<param name='menu' value='false' />";
  flashbody += "<embed src='"+url+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' wmode='"+mode+"' width='"+width+"' height='"+height+"'></embed>"
  flashbody += "</object>";
  document.write(flashbody);
}

function flash_maker3(url, width, height, mode) {
  var flashbody = "";
  flashbody = "<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='Untitled-1' align='middle'>";
  flashbody += "<param name='movie' value='"+url+"' />";
  flashbody += "<param name='quality' value='high' />";
  flashbody += "<param name='wmode' value='"+mode+"' />";
  flashbody += "<param name='menu' value='false' />";
  flashbody += "<param name='allowScriptAccess' value='sameDomain' />";
  flashbody += "<param name='allowFullScreen' value='false' />";
  flashbody += "<embed src='"+url+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' wmode='"+mode+"' width='"+width+"' height='"+height+"'></embed>"
  flashbody += "</object>";
  document.write(flashbody);
}
//------------------------------------------------------------------------------
// 사이트맵
//------------------------------------------------------------------------------
function showHideLayer(stat){
  if(stat){
    document.all.sitemap.style.visibility = "visible";
  }else{
    document.all.sitemap.style.visibility = "hidden";
  }
}


//------------------------------------------------------------------------------
// get 페이지 이동
//------------------------------------------------------------------------------
function sub_page_replace(urllink) {

    document.getElementById("sub").style.display = "";

    var url = urllink;
    var param = '';
    new Ajax.Updater({ success: 'sub' }, url, {
      method: 'get',
      parameters: param,
      onFailure: reportError,
      evalScripts: true
    });

}

function sub_flash_replace(urllink) {

    document.getElementById("snb").style.display = "";

    var url = urllink;
    var param = '';
    new Ajax.Updater({ success: 'snb' }, url, {
      method: 'get',
      parameters: param,
      onFailure: reportError,
      evalScripts: true
    });

}
