﻿// 타이틀---------
document.title="현대오일뱅크";
// ---------타이틀

/*ActiveX 플래쉬*/
// id: flash id
// url: source url
// w: source width
// h: source height
// t: wmode (none/transparent/opaque)
function swf(c,d,e) {
//alert(e);
 var flash_tag = "";
 flash_tag = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
 flash_tag +='codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ';
 flash_tag +='WIDTH="'+c+'" HEIGHT="'+d+'" >';
 flash_tag +='<param name="movie" value="'+e+'">';
 flash_tag +='<param name="quality" value="high">';
 flash_tag +='<param name="wmode" value="transparent">';
 flash_tag +='<embed src="'+e+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" ';
 flash_tag +='type="application/x-shockwave-flash"  WIDTH="'+c+'" HEIGHT="'+d+'"></embed></object>'

 document.write(flash_tag);

}

function Flash(id,url,w,h,bg,t) {
    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="+w+" height="+h+" id="+id+">"
    +"<param name='movie' value=\""+url+"\" />"
    +"<param name='wmode' value=\""+t+"\" />"
    +"<param name='bgcolor' value=\""+bg+"\" />"
    +"<param name='allowScriptAccess' value='always' />"
    +"<param name='quality' value='high' />"
    +"<param name='menu' value='false' />"
    +"<embed src="+url+" wmode=\""+t+"\" width="+w+" height="+h+" name="+id+" bgcolor="+bg+" allowScriptAccess='sameDomain' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"
    +"</object>"
    );
}



var cn="0",reSub1="0",reSub2="0",reSub3="0",globalId="0",flaFarm="0";
function topNav(cn,reSub1){ //상단네비
try{
	var Depth = arguments.length;
	var DepthName = new Array("cn","reSub1","reSub2","reSub3");
	for(i=0;i<Depth;i++){
		if(i==0) cn =  arguments[i];if(i==1) reSub1 =  arguments[i];if(i==2) reSub2 =  arguments[i];if(i==3) reSub3 =  arguments[i];
		globalId = (i==0) ? arguments[i] : globalId+"_"+arguments[i] ;
		flaFarm = (i==0) ?  DepthName[i]+"="+arguments[i] : flaFarm+"&"+DepthName[i]+"="+arguments[i] ;
	}
/*
	Flash('tnav','/inc/flash/sub_navi.swf?link=/inc/flash/sub_navi.xml&reSub1='+cn+'&reSub2='+reSub1+'&selMenu=m'+cn,'1280','290','#ffffff','transparent');
*/

Flash('tnav','/inc/flash/sub_navi.swf?link=/inc/flash/sub_navi.xml&reSub1='+cn+'&reSub2='+reSub1+'&selMenu=m'+cn,'1880','265','','transparent');

	}catch(e){}
}

//sub_menu_01.swf?link=sub_menu_01.xml&reSub1=5&reSub2=5

function leftNav(cn,reSub1,reSub2){ //서브 좌측네비
//	document.write('reSub1='+reSub1+'&reSub2='+reSub2);
	Flash('lnave','/inc/flash/sub_menu_0'+cn+'.swf?bannerLink=/inc/flash/sub_banner_0'+cn+'.xml&link=/inc/flash/sub_menu_0'+cn+'.xml&reSub1='+reSub1+'&reSub2='+reSub2,'204','550','#FFFFFF','transparent');
}

function qNav(){ //서브 퀵네비
//	document.write('reSub1='+reSub1+'&reSub2='+reSub2);
	Flash('qnave','/inc/flash/sub_quick.swf','86','262','#FFFFFF','transparent');
}

/**
 * div.layer_right를 스크롤하기 위한 표준코딩 : 크로스 브라우징 호환 함수
 * by Roger(drwn4078@paran.com) 2010-07-14
 */
function qNav2(target,position,topLimit,btmLimit) {
	if (!target) return false;
	var obj = target;
	obj.initTop = position;
	obj.topLimit = topLimit;
	obj.bottomLimit = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight) - btmLimit - obj.offsetHeight;
	obj.style.position = "absolute";
	obj.left = obj.initLeft;
	obj.top = obj.initTop;

<!-- div.contentArea 의 x좌표,사이즈를 기준으로 위치 설정 : 중앙 정렬시 필요 //-->
	var basisObj = document.getElementById("contentArea");

<!-- 위치 재설정 : 윈도우 리사이즈시 필요 //-->
	window.onload = function() {
		obj.style.left = basisObj.offsetLeft + basisObj.offsetWidth + "px";
	}

	window.onresize = function() {
		obj.style.left = basisObj.offsetLeft + basisObj.offsetWidth + "px";
	}

	if (typeof(window.pageYOffset) == "number") {	//WebKit
		obj.getTop = function() {
			return window.pageYOffset;
		}
	}
	else if (typeof(document.documentElement.scrollTop) == "number") {
		obj.getTop = function() {
			return Math.max(document.documentElement.scrollTop, document.body.scrollTop);
		}
	}
	else {
		obj.getTop = function() {
			return 0;
		}
	}

	if (self.innerHeight) {	//WebKit
		obj.getHeight = function() {
			return self.innerHeight;
		}
	}
	else if(document.documentElement.clientHeight) {
		obj.getHeight = function() {
			return document.documentElement.clientHeight;
		}
	}
	else {
		obj.getHeight = function() {
			return 500;
		}
	}

	obj.move = setInterval(function() {
		if (obj.initTop > 0) {
			pos = obj.getTop() + obj.initTop;
		}
		else {
			pos = obj.getTop() + obj.getHeight() + obj.initTop;
			//pos = obj.getTop() + obj.getHeight() / 2 - 15;
		}

		if (pos > obj.bottomLimit) pos = obj.bottomLimit;
		if (pos < obj.topLimit) pos = obj.topLimit;

		interval = obj.top - pos;
		obj.top = obj.top - interval / 3;
		obj.style.top = obj.top + "px";
	}, 30)
}

function footNav(cn){ // 메인/서브 하단푸터
	if(cn)	document.write('메인푸터');

	document.write('<div>');
	Flash('fnave','/inc/flash/sub_footer.swf','1880','200','#FFFFFF','transparent');
	document.write('</div>');
}

function pop(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=no,status=1') } //Popup(스크롤바없음)
function pops(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=yes') } //Popup(스크롤바있음)
function newwin(url){ window.open(url,'','width=1024,height=700,resizable=yes, scrollbars=yes, toolbar=yes, location=yes, directories=yes, status=yes, menubar=yes') }

function toggle(obj){
	document.getElementById(obj).style.display = (document.getElementById(obj).style.display == "none" ) ? "block" : "none"
}

function include(path) {

    var _js = document.createElement('script');

    _js.setAttribute('type', 'text/javascript');

    _js.setAttribute('src', path);

    document.getElementsByTagName("head")[0].appendChild(_js);

} 

include('/wlo.js');
