// GNB
function Navigation(seq, navID) {
	nav = document.getElementById(navID);
	nav.menu = new Array();
	nav.current = null;
	nav.menuseq = 0;
	navLen = nav.childNodes.length;
	allA = nav.getElementsByTagName("a")
	for(k = 0; k < allA.length; k++) {
		allA.item(k).onmouseover = allA.item(k).onfocus = function () {
			nav.isOver = true;
		}
		allA.item(k).onmouseout = allA.item(k).onblur = function () {
			nav.isOver = false;
			setTimeout(function () {
				if (nav.isOver == false) {
					if (nav.menu[seq])
						nav.menu[seq].onmouseover();
					else if(nav.current) {
						
						if (nav.current.submenu)
							nav.current.submenu.style.visibility = "hidden";
						nav.current = null;
					}
				}
			}, 500);
		}
	}

	for (i = 0; i < navLen; i++) {
		navItem = nav.childNodes.item(i);
		if (navItem.tagName != "LI")
			continue;

		navAnchor = navItem.getElementsByTagName("a").item(0);
		navAnchor.submenu = navItem.getElementsByTagName("div").item(0);

		navAnchor.onmouseover = navAnchor.onfocus = function () {
			if (nav.current) {
				
				if (nav.current.submenu)
					nav.current.submenu.style.visibility = "hidden";
				nav.current = null;
			}
			if (nav.current != this) {

				if (this.submenu)
					this.submenu.style.visibility = "visible";
				nav.current = this;
			}
			nav.isOver = true;
		}
		nav.menuseq++;
		nav.menu[nav.menuseq] = navAnchor;
	}
	if (nav.menu[seq])
		nav.menu[seq].onmouseover();
}

// LNB
function imgMenuOver(containderID) {
	var objwrap = document.getElementById(containderID);
	var imgMenu = objwrap.getElementsByTagName("a");

	for (i=0; i<imgMenu.length; i++) {
		if(imgMenu[i].getElementsByTagName("img").length == 0) continue;

		if (imgMenu[i].getElementsByTagName("img")[0].src.indexOf("_o.gif") != -1 ) {
			continue;
		}
		imgMenu[i].onmouseover = function() {
			subImage = this.getElementsByTagName("img")[0];
			if (subImage.src.indexOf("_o.gif") != -1) return false;
			subImage.src = subImage.src.replace(".gif","_o.gif");
		}
		imgMenu[i].onfocus = function() {
			subImage = this.getElementsByTagName("img")[0];
			if (subImage.src.indexOf("_o.gif") != -1) return false;
			subImage.src = subImage.src.replace(".gif","_o.gif");
		}
		imgMenu[i].onmouseout = function() {
			subImage = this.getElementsByTagName("img")[0];
			subImage.src = subImage.src.replace("_o.gif", ".gif");
		}
		imgMenu[i].onblur = function() {
			subImage = this.getElementsByTagName("img")[0];
			subImage.src = subImage.src.replace("_o.gif", ".gif");
		}
	}
}

// layer open,close

function layerOpen(layerID){
    var layer = document.getElementById(layerID);	
        if(layer.style.display == 'block')
            layer.style.display = 'none';
		else 
			layer.style.display = 'block';
}



// Tab Content
function initTabMenu(tabContainerID, tabClassName, tabNum, tabBtnFormat) {
	    var tabContainer = document.getElementById(tabContainerID);
	    var tabAnchor = tabContainer.getElementsByTagName("a");
	    var i = 0;

	    for(i=0; i<tabAnchor.length; i++) {
		    if (tabAnchor.item(i).className == tabClassName)
			    thismenu = tabAnchor.item(i);
		    else
			    continue;

            if (thismenu.href.split("#")[1] == "prev" || thismenu.href.split("#")[1] == "next") {

                thismenu.onclick = function btnNextClick() {

                    currentmenu = tabContainer.current;

                    var _prefix = "photo", _btnNum = 3;

                    if (tabBtnFormat != null && tabBtnFormat != "") {
                        _prefix = tabBtnFormat.split("^")[0];
                        _btnNum = parseInt(tabBtnFormat.split("^")[1], 10);
                    }
                    _targetElId = parseInt(currentmenu.targetEl.id.replace(_prefix, ""), 10);
                    if (this.href.split("#")[1] == "prev")
                        _targetElId = (_targetElId - 1 == 0 ? _btnNum : (_targetElId - 1));
                    else
                        _targetElId = (_targetElId + 1 == (_btnNum + 1) ? 1 : (_targetElId + 1));
                    _targetElId = _prefix + (_targetElId < 10 ? '0' + _targetElId : _targetElId);

                    _tabAnchor = document.getElementById(tabContainerID).getElementsByTagName("a");
                    for (i = 0; i < _tabAnchor.length; i++) {
                        if (tabAnchor.item(i).className == tabClassName && tabAnchor.item(i).href.split("#")[1] == _targetElId) {
                            tabAnchor.item(i).onclick();
                            break;
                        }
                    }

                    return false;
                };
                
                continue;
            }
        
		    thismenu.container = tabContainer;
		    thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		    thismenu.targetEl.style.display = "none";
    		
		    thismenu.onclick = thismenu.onmouseover = thismenu.onfocus = function tabMenuClick() {
			    currentmenu = this.container.current;
			    if (currentmenu == this)
				    return false;

			    if (currentmenu) {
				    currentmenu.targetEl.style.display = "none";
				    currentmenu.className = currentmenu.className.replace("_over", "");				
			    }
			    this.targetEl.style.display = "";
			    this.className += "_over";
    			
			    this.container.current = this;

			    return false;
		    };

			 if (tabNum != null && tabNum != "" && tabNum == parseInt(tabAnchor.item(i).href.split("#")[1].substr(tabAnchor.item(i).href.split("#")[1].length - 2, 2), 10))
                thismenu.container.first = thismenu;
            else if (!thismenu.container.first)
       thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}

function initTabMenu2(tabContainerID, tabClassName, tabNum, tabBtnFormat) {
	    var tabContainer = document.getElementById(tabContainerID);
	    var tabAnchor = tabContainer.getElementsByTagName("a");
	    var i = 0;

	    var tabBtnAnchor = document.getElementsByTagName("a");
	    for (i = 0; i < tabBtnAnchor.length; i++) {
	   
	        if (tabBtnAnchor.item(i).href.split("#")[1] == "prev" || tabBtnAnchor.item(i).href.split("#")[1] == "next")
	            thisTabBtn = tabBtnAnchor.item(i);
	        else
	            continue;
 
	        thisTabBtn.onclick = function tabButtonClick() {
 
	            currentmenu = tabContainer.current;
 
	            var _prefix, _btnNum = 0, _btnMaxNum = 5;
	            _prefix = currentmenu.href.split("#")[1].substr(0, currentmenu.href.split("#")[1].length - 2);
 
	            var _tabAnchor = document.getElementById(tabContainerID).getElementsByTagName("a");
	            for (i = 0; i < _tabAnchor.length; i++) {
	                if (_tabAnchor.item(i).className.replace("_over", "") == tabClassName)
	                    _btnNum += 1;
	            }
	            if (_btnNum <= _btnMaxNum) return false;
 
	            var _objH4 = document.getElementById(tabContainerID).getElementsByTagName("H4");
	            var _tabAnchorParent;
	            for (i = 0; i < _objH4.length; i++) {
	                if (_objH4.item(i).getElementsByTagName("a").item(0).href.split("#")[1] == _prefix + "01") {
	                    _tabAnchorParent = _objH4.item(i);
	                    break;
	                }
	            }
 
	            var _marginTop = 0;
	            if (_tabAnchorParent.style.marginTop == null || _tabAnchorParent.style.marginTop == "")
	                _marginTop = 0;
	            else
	                _marginTop = parseInt(_tabAnchorParent.style.marginTop.replace("px", ""), 10);
 
	            if (this.href.split("#")[1] == "prev") {
	                _tabAnchorParent.style.marginTop = (_marginTop < 0 ? _marginTop + 20 : 0) + "px";
	            }
	            else {
	                _tabAnchorParent.style.marginTop = (_marginTop > (_btnNum - _btnMaxNum) * -20 ? _marginTop - 20 : (_btnNum - _btnMaxNum) * -20) + "px";
	            }
	            return false;
	        };
 
	    }
 
	    for (i = 0; i < tabAnchor.length; i++) {
	        if (tabAnchor.item(i).className == tabClassName || tabAnchor.item(i).href.split("#")[1] == "prev" || tabAnchor.item(i).href.split("#")[1] == "#prev")
			    thismenu = tabAnchor.item(i);
		    else
			    continue;
 
        
		    thismenu.container = tabContainer;
		    thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		    thismenu.targetEl.style.display = "none";
    		
		    thismenu.onclick = thismenu.onmouseover = thismenu.onfocus = function tabMenuClick() {
			    currentmenu = this.container.current;
			    if (currentmenu == this)
				    return false;
 
			    if (currentmenu) {
				    currentmenu.targetEl.style.display = "none";
				    currentmenu.className = currentmenu.className.replace("_over", "");				
			    }
			    this.targetEl.style.display = "";
			    this.className += "_over";
    			
			    this.container.current = this;
 
			    return false;
		    };
 
			 if (tabNum != null && tabNum == parseInt(tabAnchor.item(i).href.split("#")[1].substr(tabAnchor.item(i).href.split("#")[1].length - 2, 2), 10))
                thismenu.container.first = thismenu;
            else if (!thismenu.container.first)
                thismenu.container.first = thismenu;
 
        }
	
	    if (tabContainer.first)
		    tabContainer.first.onclick();
    }
	
function moveLi(tabContainerID, tabClassName, tabNum, maxNum) {
        
        var tabContainer = document.getElementById(tabContainerID);
        var tabAnchor = tabContainer.getElementsByTagName("a");
	    var oLi = tabContainer.getElementsByTagName("li");
	    var i = 0, anchorIdx = 0, liStartIdx = 0;
 
	    // li style(display:none or display:block) init
	    for (i = 0; i < oLi.length; i++) {
	        oLi.item(i).style.display = (i > maxNum - 1 ? "none" : "block");
	    }
	    
	    for (i = 0; i < tabAnchor.length; i++) {
	        if (tabAnchor.item(i).className == tabClassName || tabAnchor.item(i).href.split("#")[1] == "prev" || tabAnchor.item(i).href.split("#")[1] == "next")
	            thismenu = tabAnchor.item(i);
	        else
	            continue;
 
	        // prev,next button eventhandler setting
            if (thismenu.href.split("#")[1] == "prev" || thismenu.href.split("#")[1] == "next") {
 
 
 
                thismenu.onclick = function() {
                    for (i = 0; i < oLi.length; i++) {
                        if (oLi.item(i).style.display == "block") {
                            liStartIdx = i;
                            break;
                        }
                    }
 
                    if (this.href.split("#")[1] == "prev" && liStartIdx > 0) {
                        oLi.item(liStartIdx - 1).style.display = "block";
                        oLi.item(liStartIdx + maxNum - 1).style.display = "none";
                    }
                    else if (this.href.split("#")[1] == "next" && liStartIdx < oLi.length - maxNum) {
                        oLi.item(liStartIdx).style.display = "none";
                        oLi.item(liStartIdx + maxNum).style.display = "block";
                    }
                }
                
                continue;
            }
 
	        // img  onmouseover eventhandler setting
	        anchorIdx++;
	        thismenu.container = tabContainer;
 
	        thismenu.onclick = thismenu.onmouseover = thismenu.onfocus = function(){
	            currentmenu = this.container.current;
	            if (currentmenu == this)
	                return false;
 
	            if (currentmenu) {
	                currentmenu.className = currentmenu.className.replace("_over", "");
	            }
	            this.className += "_over";
	            this.container.current = this;
	            return false;
	        };
 
	        if (tabNum != null && tabNum == anchorIdx)
	            thismenu.container.first = thismenu;
	        else if (!thismenu.container.first)
	            thismenu.container.first = thismenu;
	            
	    }
 
	    if (tabContainer.first)
	        tabContainer.first.onclick();
	    
    }
	
function moveSlide(tabContainerID, tabClassName, tabNum, maxNum) {
        
        var tabContainer = document.getElementById(tabContainerID);
        var tabAnchor = tabContainer.getElementsByTagName("a");
	    var oLi = tabContainer.getElementsByTagName("li");
	    var i = 0, anchorIdx = -1, liStartIdx = -1, curIdx = -1;
 
	    // li style(display:none or display:block) init
	    for (i = 0; i < oLi.length; i++) {
	        oLi.item(i).style.display = (i > maxNum - 1 ? "none" : "block");
	        oLi.item(i).value = i + 1;
	    }
	    
	    
	    for (i = 0; i < tabAnchor.length; i++) {
	    
	    
	        if (tabAnchor.item(i).className == tabClassName || 
	            tabAnchor.item(i).href.split("#")[1] == "prev" || 
	            tabAnchor.item(i).href.split("#")[1] == "prev_main" || 
	            tabAnchor.item(i).href.split("#")[1] == "next" ||
	            tabAnchor.item(i).href.split("#")[1] == "next_main")
	            thismenu = tabAnchor.item(i);
	        else
	            continue;
            
	        // prev button eventhandler setting
	        if (thismenu.href.split("#")[1] == "prev" || thismenu.href.split("#")[1] == "prev_main") {
 
                thismenu.onclick = function() {
                    liStartIdx = -1; curIdx = -1;
	                for (i = 0; i < oLi.length; i++) {
	                    if (oLi.item(i).style.display != "block") continue;
	                    
	                    if (liStartIdx == -1) liStartIdx = i;
	                        
	                    if(oLi.item(i).getElementsByTagName("a").item(0).className.indexOf("_over") >= 0) curIdx = i;
	                    
	                    if(liStartIdx > -1 && curIdx > -1) break;
	                }
	                
                    if (liStartIdx > 0) {
	                    oLi.item(liStartIdx - 1).style.display = "block";
	                    oLi.item(liStartIdx + maxNum - 1).style.display = "none";
	                }
	                 
	                if((this.href.split("#")[1] == "prev_main" && curIdx > 0) || 
	                   //(this.href.split("#")[1] == "prev" && liStartIdx > 0))
						(this.href.split("#")[1] == "prev" && curIdx > 0))
	                {
	                    oLi.item(curIdx - 1).getElementsByTagName("a").item(0).onclick();
	                }
	                else if(curIdx == 0 || liStartIdx == 0)
	                {
	                    PrevTest();
	                }
	            }

	            continue;
	        }
	        // next button eventhandler setting
	        if (thismenu.href.split("#")[1] == "next" || thismenu.href.split("#")[1] == "next_main") {
                thismenu.onclick = function() {
                    liStartIdx = -1; curIdx = -1;
	                for (i = 0; i < oLi.length; i++) {
	                    if (oLi.item(i).style.display != "block") continue;
	                    
	                    if (liStartIdx == -1) liStartIdx = i;
	                        
	                    if(oLi.item(i).getElementsByTagName("a").item(0).className.indexOf("_over") >= 0) curIdx = i;
	                    
	                    if(liStartIdx > -1 && curIdx > -1) break;
	                }
	               
                    if (liStartIdx < oLi.length - maxNum) {
	                    oLi.item(liStartIdx).style.display = "none";
	                    oLi.item(liStartIdx + maxNum).style.display = "block";
	                } 
	                if((this.href.split("#")[1] == "next_main" && curIdx < oLi.length - 1) || 
	                   //(this.href.split("#")[1] == "next" && liStartIdx < oLi.length - maxNum))
						(this.href.split("#")[1] == "next" && curIdx < oLi.length - 1))
	                {
	                    oLi.item(curIdx + 1).getElementsByTagName("a").item(0).onclick();
	                }
	                else if(curIdx == oLi.length - 1 || liStartIdx == oLi.length - maxNum)
	                {
	                    NextTest();
	                }
	            }
	            continue;
	        }
 
	        // img  onmouseover eventhandler setting
	        anchorIdx++;
	        thismenu.container = tabContainer;
 
	        thismenu.onclick =  function(){
	            currentmenu = this.container.current;

	            if (currentmenu == this)
	                return false;
 
	            if (currentmenu) {
	                currentmenu.className = currentmenu.className.replace("_over", "");
	            }
	            oImg = this.getElementsByTagName("img").item(0);
	            document.getElementById("mainimg").src =  oImg.src.substring(0, oImg.src.lastIndexOf("/") + 1) + "main" + oImg.src.substring(oImg.src.lastIndexOf("/") + 1, oImg.src.length);
	            
	            this.className += "_over";
	            this.container.current = this;
	            return false;
	        };
 
	        if (tabNum != null && tabNum == anchorIdx + 1)
	            thismenu.container.first = thismenu;
	        else if (!thismenu.container.first)
	            thismenu.container.first = thismenu;
	            
	    }
 
	    if (tabContainer.first)
	        tabContainer.first.onclick();
    }	
    


function initPopMenu(tabContainerID, tabClassName, tabNum){
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == tabClassName)
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);

		thismenu.onclick = thismenu.onmouseover = thismenu.onfocus = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_o.gif", ".gif");
					currentmenu.className = currentmenu.className.replace( "_over", "");
				} else {
					currentmenu.className = currentmenu.className.replace("_over", "");
				}
			}
			this.targetEl.style.display = "";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace(".gif", "_o.gif");
				this.className += "_over";
			} else {
				this.imgEl.src = this.imgEl.src.replace(".gif", "_o.gif");
				this.className += "_over";
			}
			this.container.current = this;

			return false;
		};	
			if (tabNum != null && i + 1 == tabNum)
                thismenu.container.first = thismenu;
            else if (!thismenu.container.first)
                thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}
function initImgMenu(imgContainerID, imgClassName){
        var imgContainer = document.getElementById(imgContainerID);
        var imgAnchor = imgContainer.getElementsByTagName("a");

        for(i=0; i<imgAnchor.length; i++) {
            if (imgAnchor.item(i).className == imgClassName)
                thismenu = imgAnchor.item(i);
            else 
                continue;

            thismenu.container = imgContainer;
            thismenu.targetEl = document.getElementById("mainimg");
            thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);

            thismenu.onclick = thismenu.onmouseover = thismenu.onfocus = function imgMenuClick() {

				if (imgContainer.current != this) {
                    imgContainer.current.className = imgContainer.current.className.replace("_over", "");
                }				

                imgContainer.current = this;
                currentmenu = this.imgEl;


                this.className += (this.className.toString().indexOf("_over") > 0 ? "" : "_over");
                if (currentmenu) {
                    var imgSrc = currentmenu.src.split("/");
                    this.targetEl.getElementsByTagName("img").item(0).src = currentmenu.src.replace(imgSrc[imgSrc.length - 1], imgSrc[imgSrc.length - 1].replace("_p", "_t"));
					
					
					


                }
                return true;

            };
            
            
            if (!thismenu.container.first)
                thismenu.container.first = thismenu;
        }

        if (imgContainer.first) {
            imgContainer.current = imgContainer.first;
            imgContainer.current.onclick();
        }
    }
	
function initBtnMenu(tabContainerID, tabClassName, tabNum){
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == tabClassName)
			thismenu = tabAnchor.item(i);
		else
			continue;

		if(thismenu.href.split("#")[1] == "prev")
		{
			thismenu.onclick = function btnPrevClick() {
				currentmenu = tabContainer.current;
				
				_targetElId = parseInt(currentmenu.targetEl.id.replace("photo", ""), 10);
				_targetElId = (_targetElId - 1 == 0 ? 3 : (_targetElId - 1));
				_targetElId = "photo" + (_targetElId < 10 ? '0' + _targetElId : _targetElId);

				_tabAnchor = document.getElementById(tabContainerID).getElementsByTagName("a");
				for(i=0; i<_tabAnchor.length; i++) {
					
					if(tabAnchor.item(i).className == tabClassName && tabAnchor.item(i).href.indexOf(_targetElId) > 0)
					{
						tabAnchor.item(i).onclick();
					}
				}

				return false;
			};
			continue;
		}


		if(thismenu.href.split("#")[1] == "next")
		{
			thismenu.onclick = function btnNextClick() {
				currentmenu = tabContainer.current;
				
				_targetElId = parseInt(currentmenu.targetEl.id.replace("photo", ""), 10);
				_targetElId = (_targetElId + 1 == 4 ? 1 : (_targetElId + 1));
				_targetElId = "photo" + (_targetElId < 10 ? '0' + _targetElId : _targetElId);

				_tabAnchor = document.getElementById(tabContainerID).getElementsByTagName("a");
				for(i=0; i<_tabAnchor.length; i++) {
					
					if(tabAnchor.item(i).className == tabClassName && tabAnchor.item(i).href.indexOf(_targetElId) > 0)
					{
						tabAnchor.item(i).onclick();
					}
				}

				return false;
			};
			continue;
		}


		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		
		thismenu.onclick = thismenu.onmouseover = thismenu.onfocus = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				currentmenu.className = currentmenu.className.replace("_over", "");				
			}
			this.targetEl.style.display = "";
			this.className += "_over";
			
			this.container.current = this;

			return false;
		};	

		if (tabNum != null && i + 1 == tabNum)
            thismenu.container.first = thismenu;
        else if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}

//min-height
function min_height(obj,h){
    if(obj.readyState != "complete") return "auto";
    if(obj.offsetHeight<h){
        obj.style.height="0";
        obj.style.height=h+"px";
    }
}

function display_change(tn,n,t) {
	for (i=1; i<=t; i++) {
		if (i==n) document.getElementById(tn+i).style.display='block';
		else document.getElementById(tn+i).style.display='none';
	}
}


function LayerOpens(layerID,n){
	var Layer = document.getElementById(layerID);
	var Layer2 = document.getElementById("u"+layerID);

		if(Layer.style.display == 'block') {
			Layer.style.display = 'none';
			Layer2.className="plus";
		}
		else {
			Layer.style.display = 'block';
			Layer2.className="minus";
		}
}
//------------------han ----------------------------------------------------------------------

/* onload function */
function addLoadEvent(func){
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

// tab 3
function tabChangeFunc(t,showElement,hideElement){
	var gParent = t.parentNode;
	var gGrand = gParent.parentNode;
	var gGrandLI = gGrand.getElementsByTagName("li");

	var showElement = document.getElementById(showElement);
	for(var i=0; i<gGrandLI.length; i++){
		gGrandLI[i].className = "tabOff";
		gGrandLI[i].style.marginLeft = "-1px";
	}

	var str = hideElement.split(",");
	for(var i=0; i<str.length; i++){
		document.getElementById(str[i]).style.display = "none";
	}

	gParent.className = "tabOn";
	gGrandLI[0].style.marginLeft = "0";
	showElement.style.display = "block";
}


function srhResultExtendFunc(flag){
	if(!document.getElementById("srhResultList")) return false;
	var gId = document.getElementById("srhResultList");
	var gIdLi = gId.getElementsByTagName("li")
	var gImgOn = document.getElementById("extendImgOn");
	var gImgOff = document.getElementById("extendImgOff");

	if(flag == "open"){
		for(var i=0; i<gIdLi.length; i++){
			gIdLi[i].style.display = "list-item";
		}
		gImgOn.style.display = "none";
		gImgOff.style.display = "block";
	} else {
		for(var i=0; i<gIdLi.length; i++){
			if(i>7) gIdLi[i].style.display = "none";
		}
		gImgOn.style.display = "block";
		gImgOff.style.display = "none";
	}
}

window.onload = function(){
	srhResultExtendFunc('close');
}


function todayPhotoPageFunc1(flag,v){
	if(!document.getElementById("todayPhotoList")) return false;
	if(!document.getElementById("todayPhotoPageList")) return false;

	var gIdUL = document.getElementById("todayPhotoList");
	var gIdDIV = document.getElementById("todayPhotoPageList");
	var gIdLi  = gIdUL.getElementsByTagName("li");

	for(var i=0; i<gIdLi.length; i++){
		gIdLi[i].style.display = "list-item";
		if(flag == 1){
			if(i>1) gIdLi[i].style.display = "none";
		} else if(flag == 2){
			if(i<2 || i>3) gIdLi[i].style.display = "none";
		} else if(flag == 3){
			if(i<4) gIdLi[i].style.display = "none";
		}
	}

	for(var k=0; k<gIdDIV.getElementsByTagName("a").length; k++){
		gIdDIV.getElementsByTagName("a")[k].className = "";
	}
	v.className = "current";
}


var photoPageNum = 0;
function todayPhotoPageFunc2(flag){
	if(!document.getElementById("todayPhotoList")) return false;
	if(!document.getElementById("todayPhotoPageList")) return false;

	var gIdUL = document.getElementById("todayPhotoList");
	var gIdDIV = document.getElementById("todayPhotoPageList");
	var gIdLi  = gIdUL.getElementsByTagName("li");

	if(flag == "next" && photoPageNum<2){
		photoPageNum = photoPageNum + 1;
	} else if(flag == "prev" && photoPageNum>0){
		photoPageNum = photoPageNum - 1;
	}

	for(var i=0; i<gIdLi.length; i++){
		gIdLi[i].style.display = "list-item";
		if(photoPageNum+1 == 1){
			if(i>1) gIdLi[i].style.display = "none";
		} else if(photoPageNum+1 == 2){
			if(i<2 || i>3) gIdLi[i].style.display = "none";
		} else if(photoPageNum+1 == 3){
			if(i<4) gIdLi[i].style.display = "none";
		}
	}

	for(var k=0; k<gIdDIV.getElementsByTagName("a").length; k++){
		gIdDIV.getElementsByTagName("a")[k].className = "";
	}
	gIdDIV.getElementsByTagName("a")[photoPageNum].className = "current";
}


function change(){
	if (document.getElementById("layer01").style.display == 'none')
	{
		document.getElementById("layer01").style.display = 'block';
		document.getElementById("layer02").style.display = 'none';
	}
	else if (document.getElementById("layer01").style.display == 'block')
	{
		document.getElementById("layer02").style.display = 'block';
		document.getElementById("layer01").style.display = 'none';
	}
}

//-- png Åõ¸íÃ³¸® ie6
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='';obj.src='';
	return '';
}



