// image roll
function menuOver() {
	this.src = this.src.replace(".gif", "_on.gif");
}
function menuOut() {
	this.src = this.src.replace("_on.gif", ".gif");
}

function imageOver(imgEl) {
	imgEl.src = imgEl.src.replace(".gif", "_on.gif");
}
function imageOut(imgEl) {
	imgEl.src = imgEl.src.replace("_on.gif", ".gif");
}

//¸ñ·Ï»óÀÚ ¸µÅ©
function selectGo(dropdownName){
	var page = document.all[dropdownName].value;
	if(page !="") window.open(page);
}


//¸µÅ© ÁÖº¯ Á¡¼± ¾ø¾Ö±â
var myAnchors=document.all.tags("A"); 
function allblur() {
	for (i=0;i<myAnchors.length;i++) { 
		myAnchors[i].onfocus=new Function("blur()");
	} 
}

allblur();

function bluring(){ 
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
} 
document.onfocusin=bluring; 



/*	
È£Ãâ ·¹ÀÌ¾î À§Ä¡¸¦ ¹ÙÅÁÀ¸·Î contents¸¦ ³ÖÁØ´Ù
*/
var vReceiverId ='';
var vReceiverNick = '';
var vUserId = '';
var vFlag = '';

function show_Layer(obj, receiverId, receiverNick, userId, flag, url) {
  vReceiverId = receiverId;
  vReceiverNick = receiverNick;
  vUserId = userId;	 
  vFlag = flag;	  
  
  x = MB_GetObjectLeft(obj); 
  y = MB_GetObjectTop(obj); 
	//document.all("calLayer").innerHTML = getContent();
	callLayerMessage.style.left=x+50;
	callLayerMessage.style.top=y+60;
	
	if(callLayerMessage.style.display==""){
	  callLayerMessage.style.display=""; //¸¶¿ì½º¾Æ¿ôÀÌ³ª ÀçÅ¬¸¯½Ã È¿°ú
  } else {
	  callLayerMessage.style.display="";
  }
  document.all("ListUserName").innerText = "\"" + receiverNick + "\"";
  document.all("layertitle").innerText = userId;
  document.all("GoUrl").href = url;

  //alert(vReceiverNick+" :"+vReceiverNick ) ;
}

function show_Layer2(obj, receiverId, receiverNick, userId, flag, url) {
  vReceiverId = receiverId;
  vReceiverNick = receiverNick;
  vUserId = userId;	 
  vFlag = flag;	  
  
  x = MB_GetObjectLeft(obj); 
  y = MB_GetObjectTop(obj); 
	//document.all("calLayer").innerHTML = getContent();
	callLayerMessage.style.left=x+50;
	callLayerMessage.style.top=y+30;
	
	if(callLayerMessage.style.display==""){
	  callLayerMessage.style.display=""; //¸¶¿ì½º¾Æ¿ôÀÌ³ª ÀçÅ¬¸¯½Ã È¿°ú
  } else {
	  callLayerMessage.style.display="";
  }
  document.all("ListUserName").innerText = "\"" + receiverNick + "\"";
  document.all("layertitle").innerText = userId;
  document.all("GoUrl").href = url;

  //alert(vReceiverNick+" :"+vReceiverNick ) ;
}

function previewshow_Layer(obj, receiverId, receiverNick, userId, flag) {
  vReceiverId = receiverId;
  vReceiverNick = receiverNick;
  vUserId = userId;	 
  vFlag = flag;	  
  
  x = MB_GetObjectLeft(obj); 
  y = MB_GetObjectTop(obj); 
	//document.all("calLayer").innerHTML = getContent();
	callLayerMessage.style.left=x+50;
	callLayerMessage.style.top=y+20;
	
	if(callLayerMessage.style.display==""){
	  callLayerMessage.style.display=""; //¸¶¿ì½º¾Æ¿ôÀÌ³ª ÀçÅ¬¸¯½Ã È¿°ú
  } else {
	  callLayerMessage.style.display="";
  }
  //alert(document.all("receiver_name"));
  //document.all("receiver_name").innerHTML = receiverNick;
  
  //alert(vReceiverNick+" :"+vReceiverNick ) ;
}

function vi_Layer() {
callLayerMessage.style.display = "";
}

function ex_Layer() {
callLayerMessage.style.display = "none";
}

function MB_GetObjectTop(obj) { 
  if(obj.offsetParent == document.body) 
	return obj.offsetTop; 
  else 
	return obj.offsetTop + MB_GetObjectTop(obj.offsetParent); 
} 

function MB_GetObjectLeft(obj) { 
  if(obj.offsetParent == document.body) 
	return obj.offsetLeft; 
  else 
  return obj.offsetLeft + MB_GetObjectLeft(obj.offsetParent); 
} 


/* ÇÃ·¡½Ã */

function flashMovie(p,w,h, url){
	flashMovie_2(p, w, h, '', url)
}

function flashMovie_2(p,w,h, code, url){
	var s_index="";
	var m_flash_movie="";
 	s_index= p+"?basic_path="+url;
 	flash_vars = "xml_path=/swf/&page_code="+code;
 	
// alert(flash_vars);
	m_flash_movie+="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='submenu_flash' name='submenu_flash'>";
	m_flash_movie+="<param name='movie' value="+s_index+">";
	m_flash_movie+="<param name='FlashVars' value='"+flash_vars+"'>";
	m_flash_movie+="<param name='allowScriptAccess' value='always'>";
	m_flash_movie+="<param name='quality' value='high'>";
	m_flash_movie+="<param name='wmode' value='transparent' />";	
	m_flash_movie+="<embed src="+s_index+" wmode='transparent'  quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+w+"' height='"+h+"' allowScriptAccess='always' swLiveConnect=true id='submenu_flash' name='submenu_flash'></embed></object>";	

	document.write(m_flash_movie);
}

function flashMovie_cu(p,w,h, code){
	flashMovie_3(p, w, h, code)
}
function flashMovie_3(p,w,h, code){
	var s_index="";
	var m_flash_movie="";
 	s_index= p;
 	flash_vars = "page_code="+code;
 	
// alert(flash_vars);
	m_flash_movie+="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='submenu_flash' name='submenu_flash'>";
	m_flash_movie+="<param name='movie' value="+s_index+">";
	m_flash_movie+="<param name='FlashVars' value='"+flash_vars+"'>";
	m_flash_movie+="<param name='allowScriptAccess' value='always'>";
	m_flash_movie+="<param name='quality' value='high'>";
	m_flash_movie+="<param name='wmode' value='transparent' />";	
	m_flash_movie+="<embed src="+s_index+" wmode='transparent'  quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+w+"' height='"+h+"' allowScriptAccess='always' swLiveConnect=true id='submenu_flash' name='submenu_flash'></embed></object>";	

	document.write(m_flash_movie);
}

function flashMovie_04(p,w,h, code){
	var s_index="";
	var m_flash_movie="";
 	s_index= p;
 	flash_vars = "page_code="+code;
 	 
// alert(flash_vars);
	m_flash_movie+="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='submenu_flash' name='submenu_flash'>";
	m_flash_movie+="<param name='movie' value="+s_index+">";
	m_flash_movie+="<param name='FlashVars' value='"+flash_vars+"'>";
	m_flash_movie+="<param name='allowScriptAccess' value='always'>";
	m_flash_movie+="<param name='quality' value='high'>";
	m_flash_movie+="<param name='wmode' value='transparent' />";	
	m_flash_movie+="<embed src="+s_index+" wmode='tracess='always' swLiveConnectnsparent'  quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+w+"' height='"+h+"' allowScriptAc=true id='submenu_flash' name='submenu_flash'></embed></object>";	
	//alert(m_flash_movie);
	document.write(m_flash_movie);
}

function flashMovie_5(p,w,h, code){
	var s_index="";
	var m_flash_movie="";
 	s_index= p;
 	flash_vars = "page_code="+code;
 	
// alert(flash_vars);
	m_flash_movie+="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='submenu_flash' name='submenu_flash'>";
	m_flash_movie+="<param name='movie' value="+s_index+">";
	m_flash_movie+="<param name='FlashVars' value='"+flash_vars+"'>";
	m_flash_movie+="<param name='allowScriptAccess' value='always'>";
	m_flash_movie+="<param name='quality' value='high'>";
	m_flash_movie+="<param name='wmode' value='transparent' />";	
	m_flash_movie+="<embed src="+s_index+" wmode='transparent'  quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+w+"' height='"+h+"' allowScriptAccess='always' swLiveConnect=true id='submenu_flash' name='submenu_flash'></embed></object>";	

	document.write(m_flash_movie);
}


// »õÃ¢¶ç¿ì±â Poll
function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

function Anytell_Pop(theURL,winName,features) { 
  window.open('anytell_pop.html','','toolbar=no, menubar=no, resizable=no, scrollbars=no, width=500, height=543');
}

function ResizeImage(tgt, toSize) {
	if(tgt.width > toSize) {
		if(tgt.height) tgt.height = toSize * tgt.height / tgt.width;
		tgt.width = toSize;
		tgt.align = 'center';
	}
}

function ResizeImageDiv(tgt,toSize) {
	var imgs = tgt.getElementsByTagName("IMG");
	for(i=0;i<imgs.length;i++) {
		ResizeImage(imgs[i],toSize);
	}
}

function brand_story01(){
	 window.open('swf/brandstory/main.html','a','width=1014,height=623');
}

function brand_story02(no){
	 window.open('swf/brandstory/mainff1b.html?num=3','b','width=1014,height=623');
}
function myomyo_blog(no){
	 window.open('community/blog/blog_listd803.html?BlogID=6','c');
}


/* »çÀÌµå ½ºÅ©·Ñ µû¶ó´Ù´Ï´Â ½ºÅ©¸³Æ® */ 

var ttmnLEFT = 0; // ¿ÞÂÊ ¿©¹é
var ttmnGAP1 = 400; // À§ÂÊ ¿©¹é
var ttmnGAP2 = 0; // ½ºÅ©·Ñ½Ã ºê¶ó¿ìÀú À§ÂÊ°ú ¶³¾îÁö´Â °Å¸®
var ttmnBASE = -700; // ½ºÅ©·Ñ ½ÃÀÛÀ§Ä¡
var ttmnActivateSpeed = 200;
var ttmnScrollSpeed = 10;//¼Óµµ

var ttmnTimer;

function ReadCookie(name)
{
var label = name + "=";
var labelLen = label.length;
var cLen = document.cookie.length;
var i = 0;

while (i < cLen) {
		var j = i + labelLen;

		if (document.cookie.substring(i, j) == label) {
						var cEnd = document.cookie.indexOf(";", j);
						if (cEnd == -1) cEnd = document.cookie.length;

						return unescape(document.cookie.substring(j, cEnd));
		}

		i++;
}

return "";
}

function SaveCookie(name, value, expire)
{
var eDate = new Date();
eDate.setDate(eDate.getDate() + expire);
document.cookie = name + "=" + value + "; expires=" +  eDate.toGMTString()+ "; path=/";
}

function RefreshStaticMenu()
{
var ttmnStartPoint, ttmnEndPoint, ttmnRefreshTimer;

ttmnStartPoint = parseInt(STATICMENU.style.top, 10);

			if(-document.body.scrollTop + document.body.scrollHeight - document.body.clientHeight < 0)//ÀÌ ¼öÄ¡´Â ¹Ø¿¡¼­ ½ºÅ©·ÑÀ» ¿Ã·ÈÀ»¶§ ÇªÅÍ¸¦ Áö³ª¼­ ÇÏ´Ü¿¡ ºÙÀ» ³ôÀÌ
				ttmnEndPoint = document.body.scrollTop + document.body.clientHeight - "586"//ÇÏ´Ü¿¡¼­ ÀÌ¹ÌÁö À§Ä¡°ª Á¶Á¤
			else
			{
				ttmnEndPoint = document.body.scrollTop + document.body.clientHeight - "435"
			}

if (ttmnEndPoint < ttmnGAP1) ttmnEndPoint = ttmnGAP1;

ttmnRefreshTimer = ttmnActivateSpeed;

if ( ttmnStartPoint != ttmnEndPoint ) {
                ttmnScrollAmount = Math.ceil( Math.abs( ttmnEndPoint - ttmnStartPoint ) / 15 );
                STATICMENU.style.top = parseInt(STATICMENU.style.top, 10) + ( ( ttmnEndPoint<ttmnStartPoint ) ? -ttmnScrollAmount : ttmnScrollAmount );
                ttmnRefreshTimer = ttmnScrollSpeed;
}

ttmnTimer = setTimeout ("RefreshStaticMenu();", ttmnRefreshTimer);
}

function ToggleAnimate2()
{
if (ANIMATE2.checked) {
                RefreshStaticMenu();
                SaveCookie("ANIMATE2", "true", 300);
}
else {
                clearTimeout(ttmnTimer);
                STATICMENU.style.top = ttmnGAP1;
                SaveCookie("ANIMATE2", "false", 300);
}
}

function InitializeStaticMenu()
{
STATICMENU.style.left = ttmnLEFT;

         if (ReadCookie("ANIMATE2") == "false") {
                ANIMATE2.checked = false;
                STATICMENU.style.top = document.body.scrollTop - ttmnGAP1;
}
else {
                ANIMATE2.checked = true;
                STATICMENU.style.top = document.body.scrollTop - ttmnBASE;
                RefreshStaticMenu();
}
}



/* Emoticon Select */

function emotshow(){        
	var open = document.all["emo"].style.display;
    
	if (open == "none"){
		 document.all["emo"].style.display = "";
	}	else{
		document.all["emo"].style.display = "none";
	}
	
}	


function setemot(emot) {
  document.comFrm.myemot.width = 29;
  document.comFrm.myemot.height = 29;
	document.comFrm.myemot.src = "/images/tiiq/select_emoticon_" + emot + ".gif";
	document.comFrm.emoticonType.value =  emot;
	document.all["emo"].style.display = "none";	
}


function PostXMLHTTP(url)
{
	var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	xmlhttp.open("POST.html", url, false);
	xmlhttp.send();
	var responseText = xmlhttp.responseText;
	xmlhttp = null;

	return responseText;
}


// styleSheets control
function getStyleAttributeValue(styleName,attributeName) {
	for(si=0;si<document.styleSheets.length;si++) {
		var ss = document.styleSheets(si);
		for(ri = 0;ri<ss.rules.length;ri++) {
			var rl = ss.rules.item(ri);
			if(rl.selectorText == styleName) {
				return rl.style.getAttribute(attributeName);
			}
		}
	}
	return null;
}

function tabOver(imgEl,num) {
	if(document.getElementById){
    var basicSrc, imgSrc = new String;
    basicSrc = imgEl.src;
    imgSrc = basicSrc.substring(basicSrc.length-7,basicSrc.length);
    if (imgSrc !== "_on.gif")
    {
      var tabSel = new String();
      tabSel = "tab".concat(num);
      document.images[tabSel].src = "/images/tiiq/tab_rank_0" + num + "_on.gif";

      if (num == 2) {
        document.images["tab1"].src = "images/tiiq/tab_rank_01.gif";
        document.getElementById("LayerWrap02").style.display = "";
        document.getElementById("LayerWrap01").style.display = "none";
      }
      else {
        document.images["tab2"].src = "images/tiiq/tab_rank_02.gif";
        document.getElementById("LayerWrap02").style.display="none";
        document.getElementById("LayerWrap01").style.display = "";
      }
    }
  }
}


function SwitchCon(obj){
	if(document.getElementById){
		var el = document.getElementById(obj);
		var ar = document.getElementById("condiv").getElementsByTagName("table"); 
		if(el.style.display != "block"){
				for (var i=0; i<ar.length; i++){
						if (ar[i].className=="conmenu") 
						ar[i].style.display = "none";
	 
				}
				el.style.display = "block";
		}else{
				el.style.display = "none";
		}
	}
}

// For Top Button

var Xpos = 0;
var Ypos = 0;
var Ygravity = 0.9;
var scrollPos = 0;
var oldScrollPos = 0;

function butTop02() {
 docWidth = document.body.clientWidth; // Update document width
 docHeight = document.body.clientHeight; // Update document height
 oldScrollPos = scrollPos;
 scrollPos = document.body.scrollTop; // Update scrollbar position

 Xpos = 932;
 Yboundary = ((scrollPos + docHeight) - butTop.offsetHeight) - 150; //ÇÏ´Ü¿©¹é

 if (butTop.offsetTop < Yboundary - 1) // Object is behind boundary
 Ypos += 2;

 if (butTop.offsetTop > Yboundary + 1) // Object is past boundary
 Ypos -= 1;

 Ypos *= Ygravity; // Slow object down

 butTop.style.pixelLeft = Xpos;
 butTop.style.pixelTop += Ypos; // Make object bounce
}


/*********************************************************************
*   showHideLayers ½ºÅ©¸³Æ®
*********************************************************************/

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}



/* ¿À´Ãº» »óÇ° */
function myTodayshow(){        
	var open = document.all["todayp"].style.display;
    
	if (open == "none"){
		 document.all["todayp"].style.display = "";
	}	else{
		document.all["todayp"].style.display = "none";
	}
	
}

/* À¥Áø »õÃ¢ */

function webzine() {
	window.open('community/webzine/webzine_01.html', 'webzine', 'menubar=no, toolbar=no, scrollbar=no, resizable=no, status=no, width=848, height=628;')
}

/* Png */
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 ''; 
} 