function addLoadEvent(func) {
	var oldonload = window.onload;
	if(typeof window.onload != 'function') {
		window.onload = func;		
	}else{
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function bookmarksite(title,url) { 
	if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, ""); 

	else if(window.opera && window.print) { // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	}
	else if(document.all) // IE
	window.external.AddFavorite(url, title);
}

var flashLink=new Array();
flashLink[10]="/content/content.php?cont=identity";//
flashLink[11]="/content/content.php?cont=identity";//
flashLink[12]="/content/content.php?cont=business";//
flashLink[13]="/content/content.php?cont=partner";//
flashLink[14]="/content/content.php?cont=contact";//
flashLink[20]="/shopmain/";//
flashLink[21]="/shop/big_section.php?cno1=1001";//
flashLink[22]="/shop/big_section.php?cno1=1002";//
flashLink[23]="/shop/big_section.php?cno1=1003";//
flashLink[24]="/shop/big_section.php?cno1=1004";//
flashLink[25]="/shop/big_section.php?cno1=1005";//
flashLink[26]="/shop/big_section.php?cno1=1006";//
flashLink[27]="/shop/big_section.php?cno1=1007";//
flashLink[28]="/shop/big_section.php?cno1=1008";//
flashLink[29]="/shop/big_section.php?cno1=1009";//
flashLink[30]="/content/content.php?cont=store";//
flashLink[40]="/board/?db=news_press";//
flashLink[41]="/board/?db=news_press";//
flashLink[42]="/board/?db=fill_feel";//
flashLink[43]="/board/?db=shopping_notice";//
flashLink[44]="/board/?db=iconic_diary";//
// flashLink[45]="/board/?db=shopping_notice";//

flashLink[50]="/board/?db=promotion";//promotion
flashLink[200]="/shop/big_section.php?cno1=1012";//furniture
flashLink[201]="/shop/big_section.php?cno1=1013";//2008

function goFlash(n){
	var headTitle = document.getElementsByTagName('h1')[0].firstChild.firstChild.getAttribute('alt');

	if (n == 60) bookmarksite(headTitle,root_url);
	else if (flashLink[n]) location.href=flashLink[n];
}

/////////////////////////////////////////////////////////////////////////////////////////
//
//	¢Æ R2Slider 1.0
//
//	- 2008-03-20 by zardsama
//
// **************************************************************************
//
// Usage)
//		var º¯¼ö¸í = new R2Slider("·¹ÀÌ¾î ID","º¯¼ö¸í", ¼Óµµ, »ó´Ü¸¶Áø, DTD);
//		º¯¼ö¸í.slide();
//
//		- ¼Óµµ, »ó´Ü¸¶ÁøÀº »ý·« °¡´É / ÃßÈÄ º¯°æ °¡´É
//		- DTD°¡ strict °¡ ¾Æ´Ò°æ¿ì¿¡´Â º¯¼ö¸í.dElement = document.body ÁöÁ¤
//		- ·£´õ¸µÀÌ strict ¸ðµåÀÏ¶§ DTD ºÎºÐÀº »ý·« °¡´É
//		- 'º¯¼ö¸í.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,document.body);	 
//			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);
}

var cseq = "";
function hiddenClick(crep){
	if(cseq != crep){
		if(cseq !=""){
			cseq.style.display = "none";
		}
		crep.style.display = "";
		cseq = crep;
	}
	else{
		crep.style.display = "none";
		cseq = "";
	}
}
