
/*flash menu link*/
var flashLink=new Array();
flashLink[00]="/";

function bestImg(type){
	obj=document.getElementById('best_img');
	oleft=obj.style.pixelLeft;
	if(!obj) return;
	if(type == 2){
		obj.style.pixelLeft-=190;
	}else{
		if(oleft < 0) obj.style.pixelLeft+=190;
	}
}


function goFlash(n){
	if (flashLink[n]) location.href=flashLink[n];	
}

function menu_OnOver(o,mtd){
	num=o.name.replace("a","");
	if (mtd==1 || num==now_menu)
	{
		img='../_image/common/'+num+'r.gif';
	}
	else 
	{
		img='../_image/common/'+num+'.gif';
	}

	o.src = img;
}

function imgCbox(N, tabstop)
{
	var objs, cboxes, Img, Span, A;

	if (typeof N == 'undefined') return false;
	if (typeof tabstop == 'undefined') tabstop = true;
	if ((objs=document.getElementsByName(N)) == null) return false;

	for (var i=0; i < objs.length; i++) {
		if (objs[i].tagName.toLowerCase() != "input" || objs[i].type.toLowerCase() != "checkbox") continue;
		
		if (typeof imgCbox.Objs[N] == 'undefined') {
			imgCbox.Objs[N] = new Array;
			imgCbox.ImgObjs[N] = new Array;
		}
		
		var len = imgCbox.Objs[N].length;
		imgCbox.Objs[N][len] = objs[i];
		imgCbox.ImgObjs[N][len] = {};

		// anchor element for tab stop
		A = document.createElement("A");
		if (tabstop) {
			A.href = "javascript:;";
		}
		A.onclick =  new Function("imgCbox.onclick('"+N+"',"+len+")");
		A.style.borderWidth = "0px";
		A.style.cursor = "pointer";

		// for image cache
		Img = document.createElement("IMG");
		Img.src = objs[i].getAttribute("onsrc");
		Img.style.borderWidth = "0px";
		Img.style.display = objs[i].checked?"":"none";
		imgCbox.ImgObjs[N][len]["on"] = Img;
		A.appendChild(Img);

		Img = document.createElement("IMG");
		Img.src = objs[i].getAttribute("offsrc");
		Img.style.borderWidth = "0px";
		Img.style.display = objs[i].checked?"none":"";
		imgCbox.ImgObjs[N][len]["off"] = Img;
		A.appendChild(Img);

		// insert object
		Span = objs[i].parentNode;
		Span.style.display = "none";
		Span.parentNode.insertBefore(A, Span);

	}
}
imgCbox.onclick = function(N, idx) {
	var C = imgCbox.Objs[N][idx];
	var I = imgCbox.ImgObjs[N][idx];

	C.checked = !C.checked;
	if (C.checked) {
		I["on"].style.display = "";
		I["off"].style.display = "none";
	} else {
		I["on"].style.display = "none";
		I["off"].style.display = "";
	}
	
	// fire event
	if (typeof C.onclick != 'undefined' && C.onclick != null) C.onclick();
}
imgCbox.Objs = {};
imgCbox.ImgObjs = {};

//IE PNG use
function setPng24(obj) { 
      var browser = navigator.appName;
      var version = parseFloat(navigator.appVersion.replace (/^.*MSIE ([.0-9]+).*$/,"$1"));

      if(browser.indexOf("Internet Explorer") && version < 7.0 ) { // IE6 ÀÌÇÏ¿¡¼­¸¸ µ¿ÀÛ 2008-03-14 by zardsama
            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 dollyqueenHeight() {
	var h = document.getElementById("navi").scrollHeight + 88;
	var mh = h + 100;

	document.write('<div id="cnt" style="min-height:'+mh+'px;height: auto !important;height:'+h+'px;">');
}

/////////////////////////////////////////////////////////////////////////////////////////
//
//	¢Æ R2Slider 1.0
//
//	- 2008-03-20 by zardsama
//
// **************************************************************************
//
// Usage)
//		var º¯¼ö¸í = new R2Slider("·¹ÀÌ¾î ID","º¯¼ö¸í", ¼Óµµ, »ó´Ü¸¶Áø);
//		º¯¼ö¸í.slide();
//
//		- ¼Óµµ, »ó´Ü¸¶ÁøÀº »ý·« °¡´É / ÃßÈÄ º¯°æ °¡´É
//		- 'º¯¼ö¸í.limitTop' È¤Àº 'º¯¼ö¸í.limitBottom' À¸·Î »ó/ÇÏ´Ü ÇÑ°è ÁöÁ¡ ¼³Á¤°¡´É
//
//
//	Example )
//		<div id="scroll" style="position:absolute; width: 100px; height: 400px;"></div>
//		<script type="text/javascript">
//			var test = new R2Slider ("scroll","test",null,null,null);
//			test.limitTop = 100;
//			test.slide();
//		</script>
//
/////////////////////////////////////////////////////////////////////////////////////////

R2Slider = function(id, slider, divPitch, marginTop, dElement) {
	if (isNaN(parseInt(marginTop))) marginTop = 0;	// »ó´Ü ¸¶Áø µðÆúÆ®
	if (isNaN(parseInt(divPitch))) divPitch = 15;	// ÀÌµ¿ °£°Ý µðÆúÆ®
	if (!dElement) dElement = document.documentElement; // DTD strict ÀÏ¶§ ( Transitional ÀÏ¶§´Â document.body )

	this.timer;	// Å¸ÀÌ¸Ó º¯¼ö
	this.slider = slider;	// °´Ã¼ º¯¼ö¸í
	this.obj = document.getElementById (id);	// ¿ÀºêÁ§Æ®
	this.marginTop = parseInt(marginTop);	// »ó´Ü ¸¶Áø
	this.divPitch = parseInt(divPitch);	// ÀÌµ¿ °£°Ý
	this.dElement = dElement; // DTD ¿¡ µû¸¥ µµÅ¥¸ÕÆ® ¿¤¸®¸ÕÆ®
	this.limitTop;	 // »ó´Ü ÇÑ°èÁ¡
	this.limitBottom;	 // ÇÏ´Ü ÇÑ°èÁ¡
}


R2Slider.prototype.moveIt = function(){
	var pitch = (parseInt(this.dElement.scrollTop)+ parseInt(this.marginTop)) - parseInt(this.obj.style.top);

	if (pitch == 0) return;
	else nextPos = parseInt(this.obj.style.top) + pitch / this.divPitch
	nextPos = (pitch > 0) ? Math.ceil(nextPos) : Math.floor(nextPos);

	var limitBottom = this.dElement.scrollHeight - parseInt(this.limitBottom)- parseInt(this.obj.offsetHeight);
	if ( this.limitTop && nextPos  < this.limitTop ) nextPos = this.limitTop;
	if ( this.limitBottom && nextPos  > limitBottom ) nextPos = limitBottom;
	if (nextPos < this.marginTop) nextPos = this.marginTop;
	if (isNaN(nextPos)) nextPos = 0;

	this.obj.style.top = nextPos+"px";
}


R2Slider.prototype.slide = function() {
	this.timer = setInterval(""+this.slider+".moveIt()", 10);
}

//quick
var quick_limit_top = 0; // ÀüÃ¼ ÆäÀÌÁö ±âÁØ À§ÂÊ ÇÑ°è ÇÈ¼¿ 
var quick_margin_top = 0; // ÇöÀç º¸°í ÀÖ´Â È­¸é ±âÁØ À§ÂÊ ÇÑ°è ÇÈ¼¿
var quick_margin_bottom = 700; // ¾Æ·¡ÂÊ ÇÑ°è ÇÈ¼¿
var quick_speed = 10; // ÇÑ¹ø¿¡ ¿òÁ÷ÀÌ´Â ÇÈ¼¿ °£°Ý
var quick_interval = 10; // ¿òÁ÷ÀÌ´Â ½Ã°£ °£°Ý

setInterval ("quickscroll()", quick_interval);

function quickscroll() {

	qm = document.getElementById ("quickmenu");

	if (qm)	{

		qm_move_y = document.body.scrollTop + quick_margin_top;
		if (qm_move_y < quick_limit_top ) qm_move_y = quick_limit_top;

		nowTop = parseInt(qm.style.top);

		minus = nowTop - qm_move_y;
		if (Math.abs(minus) >= quick_speed ) minus = 0;

		if ( nowTop != qm_move_y) moving = ( nowTop > qm_move_y) ? (quick_speed * -1) : quick_speed;
		else moving = 0;

		nextPos = nowTop + (moving - minus);

		if (nextPos + qm.offsetHeight + quick_margin_bottom > document.body.scrollHeight ) nextPos = document.body.scrollHeight - qm.offsetHeight - quick_margin_bottom;

		qm.style.top = parseInt(nextPos);
	}

}

function viewMainPrd(url) {
	if(!document.getElementById) return false;
	if(!document.getElementById('mainPrd')) return false;
	var layer = document.getElementById ("mainPrd");
	var getDetail = getHttpRequest(url);
	layer.innerHTML = getDetail;
}