// JavaScript Document

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

//²Ëµ¥
function SetActiveMenu()
{
  var ls=menu.getElementsByTagName('a')
  var theURL=window.location.pathname
  if(theURL.indexOf(".aspx")==-1)
    theURL="menu_home"
  if(theURL.indexOf("Default")>0)
    theURL="menu_home"
  
  for(i=0;i<ls.length;i++)
    {
      //alert(theURL+'   '+ls[i].id)
	  if(theURL.indexOf(ls[i].id)!=-1)
	   ls[i].className='here' 
	  else
       ls[i].className='' 
	}
}


addLoadEvent(SetActiveMenu);

//µ×²¿¿ØÖÆ

function footposition() {
	if(!document.getElementById("foot")) return false;
	var foot = document.getElementById("foot");
	if(document.all) {
		if(document.body.clientHeight < document.documentElement.offsetHeight) {
			foot.style.position = 'absolute';
			foot.style.bottom = '0';
		}
	}
	if(window.opera&&navigator.userAgent.match(/opera/gi)) {
		foot.style.position = '';
		foot.style.bottom = '';
	}
	if(document.body.clientHeight < window.innerHeight) {
		foot.style.position = 'absolute';
		foot.style.bottom = '0';
	}
}

addLoadEvent(footposition);

//»ÃµÆÆ¬

function slideMouse(imgname,imgpath) {
	var banner_title = document.getElementById("banner_title");
	var imgurl = document.getElementById("imgurl");
	for(var im=0; im<imgname.length; im++) {
		imgname[im] = imgpath + imgname[im];
	}
	var links = banner_title.getElementsByTagName("a");
	for(var i=0; i<links.length; i++) {
		links[i].name = i;
		links[i].onmouseover = function() {
			clearClassName();
			this.className = "slidenow";
			imgurl.href = this.href;
			imgurl.firstChild.src = imgname[this.name];
		}
	}
}

function clearClassName() {
	var banner_title = document.getElementById("banner_title");
	var links = banner_title.getElementsByTagName("a");
	for(var j=0; j<links.length; j++) {
		links[j].className = "";
	}
}

var nowspace = 0;

function slideLoop() {
	var banner_title = document.getElementById("banner_title");
	var imgurl = document.getElementById("imgurl");
	var links = banner_title.getElementsByTagName("a");
	if(nowspace == links.length - 1) {
		nowspace = 0;
	} else {
		nowspace += 1;
	}
	clearClassName();
	imgurl.href = links[nowspace].href;
	links[nowspace].className = "slidenow";
	imgurl.firstChild.src = arguments[0][nowspace];
}


function popShow(text) {
    if(text!='')  popup.SetContentHTML(text);
    popup.ShowAtElement(this);
        //popup.SetContentUrl(url);
//document.form1.getElementById("postValue").Value
    }

