// ToggleMenu : 이미지 셀렉트 박스
function toggleMenu(currMenu) { 
if (document.all) { 
thisMenu = eval("document.all." + currMenu + ".style") 
if (thisMenu.display == "block") { 
thisMenu.display = "none" 
} 
else { 
thisMenu.display = "block" 
} 
return false 
} 
else { 
return true 
} 
} 


// 왼쪽메뉴 레이어 보이고, 안보이기
var old_menu = '';
function showhide(name)
{
submenu=eval("add"+name);
    if( old_menu != submenu ){
          if( old_menu !='' ) {
                old_menu.style.display = 'none';
              }
          submenu.style.display='block';    
          old_menu = submenu;
    } else {
                submenu.style.display = 'none';
                old_menu = '';
            }
}

function hide(id) 
{
	obj = document.all[id];

	if (obj.style.display == '') 
	{
		obj.style.display = 'none';
	} 
	else 
	{
		obj.style.display = 'none';
	}
}

function show(id) 
{
	obj = document.all[id];

	if (obj.style.display == 'none') 
	{
		obj.style.display = '';
	} 
	else 
	{
		obj.style.display = 'none';
	}
}

var origWidth, origHeight;
if (document.layers) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

// link style change
var cur_link;
function doLinkClass(lnk) {
  if (lnk && lnk.blur) lnk.blur();	// remove marquee
  if (!lnk || cur_link == lnk) return;
  if (cur_link) cur_link.className = "done";
  lnk.className = "on";
  cur_link = lnk;
}

var cur_lyr;	// holds id of currently visible layer
function swapLayers(lnk,id) {
  doLinkClass(lnk);
  if (cur_lyr) hideLayer(cur_lyr);
  showLayer(id);
  cur_lyr = id;
}

function showLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "visible";
}

function hideLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "hidden";
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getLyrRef(id,document): null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}

// get reference to nested layer for ns4
// from old dhtmllib.js by Mike Hall of www.brainjar.com
function getLyrRef(lyr,doc) {
	if (document.layers) {
		var theLyr;
		for (var i=0; i<doc.layers.length; i++) {
	  	theLyr = doc.layers[i];
			if (theLyr.name == lyr) return theLyr;
			else if (theLyr.document.layers.length > 0) 
	    	if ((theLyr = getLyrRef(lyr,theLyr.document)) != null)
					return theLyr;
	  }
		return null;
  }
}

function init(id,lyr) {
  var lnk = getElemRefs(id);
  swapLayers(lnk,lyr);
}


//새창 띄우기
function popUp(pPage) {
 popUpWin = window.open(pPage,'',
'resizeable=no,scrollbars=yes,width=366,height=343,top=0,left=0');
 } 

function MM_openBrWindow(theURL,winName,features) { //v2.0
			window.open(theURL,winName,features);
}




//즐겨찾기, 시작페이지 설정
function add_favorites(){
  var favorite_url = "#"   //즐겨찾기에 추가할 홈 주소
  var favorite_title = "#"   // 즐겨찾기에 기록할 이름(제목)을 기록

  if (document.all)
   window.external.AddFavorite(favorite_url,favorite_title)
 }



//ActiveX 적용 : 플래쉬
inputSWF = function(id, src, bgcolor, width, height, wmode) {
	if (wmode)
	{
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width+'" height="'+height+'" id="'+id+'" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+src+'" /><param name="quality" value="high" /><param name="bgcolor" value="'+bgcolor+'" /><param name="wmode" value="transparent" />');
		document.write('<embed src="'+src+'" quality="high" bgcolor="'+bgcolor+'" width="'+width+'" height="'+height+'" name="'+id+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" /></object>');
	}
	else{
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width+'" height="'+height+'" id="'+id+'" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+src+'" /><param name="quality" value="high" /><param name="bgcolor" value="'+bgcolor+'" /><param name="wmode" value="transparent" />');
		document.write('<embed src="'+src+'" quality="high" bgcolor="'+bgcolor+'" width="'+width+'" height="'+height+'" name="'+id+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
	}
	
};


//ActiveX 적용 : 동영상
inputMOV = function(id, src, width, height, autostart, loop, showaudiocontrols, showcontrols, showpositioncontrols, showtracker){
	document.write('<object id="'+id+'" name="MediaPlayer" classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" width="'+width+'" height="'+height+'" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" align="center">');
	document.write('  <param name="Filename" value="'+src+'">');
	document.write('  <param name="AutoStart" value="'+autostart+'">');
	document.write('  <param name="loop" value="'+loop+'">');
	document.write('  <param name="ShowAudioControls" value="'+showaudiocontrols+'">');
	document.write('  <param name="ShowControls" value="'+showcontrols+'">');
	document.write('  <param name="ShowPositionControls" value="'+showpositioncontrols+'">');
	document.write('  <param name="ShowTracker" value="'+showtracker+'">');
	document.write('  <embed id="'+id+'" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" width="'+width+'" height="'+height+'" src="'+src+'" AutoStart="'+autostart+'" loop="'+loop+'" ShowAudioControls="'+showaudiocontrols+'" ShowControls="'+showcontrols+'" ShowPositionControls="'+showpositioncontrols+'" ShowTracker="'+showtracker+'"></embed>');
	document.write('</object>');
};





function image(){
document.write('	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" 	codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="660" height="550">');
document.write('	<param name="allowScriptAccess" value="sameDomain" />');
document.write('	<param name="movie" value="/common/flash/sake.swf" />');
document.write('	<param name="quality" value="high" />');
document.write('	<param name="wmode" value="transparent" />');
document.write('	<embed src="/common/flash/sake.swf" quality="high" width="800" height="630" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('	</object>');
}







//***************************navigation.swf //(모든페이지적용)*********************************
//회사소개
function mainNavi01_01(){
     location.href = "/sub/company/company01.asp";
	
}
function mainNavi01_02(){
    location.href = "/sub/company/company02.asp";
}
function mainNavi01_03(){
    location.href = "/sub/company/company03.asp";
}


//제품소개
function mainNavi02_01(){
    location.href = "/sub/product/product01.asp";
}
function mainNavi02_02(){
	location.href = "/sub/product/product02.asp";
    
}

//청주란
function mainNavi03_01(){
    location.href = "/sub/wine/wine01.asp";
}
function mainNavi03_02(){
    location.href = "/sub/wine/wine02.asp";
}
function mainNavi03_03(){
    location.href = "/sub/wine/wine03.asp";
}

//고객센터
function mainNavi04_01(){
    location.href = "/sub/customer/customer01.asp";
}
function mainNavi04_02(){
    location.href = "/sub/customer/customer02_list.asp";
}

