// JavaScript Document

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

//²Ëµ¥

function menuhover() {
	var menu = document.getElementById("menu");
	var links = menu.getElementsByTagName("a");
	for(c=0; c<links.length; c++) {
		links[c].onmouseover = function() {
			for(m=0; m<links.length; m++) {
				links[m].className = '';
			}
			this.className = 'here';
		}
		links[c].onmouseout = function() {
			for(m=0; m<links.length; m++) {
				links[m].className = '';
			}
			links[0].className = 'here';
		}
	}
}

addLoadEvent(menuhover);

//µ×²¿¿ØÖÆ

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);

//»ÃµÆÆ¬

var tti = 6000;
var i = 0;
var j = 0;
var group = new Array();
group[0] = new Array();
group[0][0] = "/Article/ContentList.aspx?ID=14";
group[0][1] = "/Images/v2/index_banner1.jpg";
group[1] = new Array();
group[1][0] = "/Article/ContentList.aspx?ID=26";
group[1][1] = "/Images/v2/index_banner2.jpg";
group[2] = new Array();
group[2][0] = "/Article/ContentList.aspx?ID=15";
group[2][1] = "/Images/v2/index_banner3.jpg";
group[3] = new Array();
group[3][0] = "/Article/ContentList.aspx?ID=28";
group[3][1] = "/Images/v2/index_banner4.jpg";
group[4] = new Array();
group[4][0] = "/Article/ContentList.aspx?ID=31";
group[4][1] = "/Images/v2/index_banner5.jpg";

function operation() {
	var slide_img = document.getElementById("slide_img");
	var imgurl = document.getElementById("imgurl");
	var banner_title = document.getElementById("banner_title");
	var righturl = banner_title.getElementsByTagName("a");
	for(g=0; g<righturl.length; g++) {
			if(righturl[g].href.indexOf(imgurl.href) != -1) {
				righturl[g].className = 'slidenow';
			}
			else {
				righturl[g].className = '';
			}
			righturl[g].onmouseover = function () {
				window.clearInterval(slide);
				for(e=0; e<righturl.length; e++) {
					righturl[e].className = '';
				}
				imgurl.href = this.href;
				for(f=0; f<group.length; f++) {
					if(this.href.indexOf(group[f][0]) != -1) slide_img.src = group[f][1];
				}
				this.className = 'slidenow';
			}
			righturl[g].onmouseout = function () {
				this.className = '';
				slide = setInterval(changeimg,tti);
			}
		}
}

function changeimg() {
	var slide_img = document.getElementById("slide_img");
	var imgurl = document.getElementById("imgurl");
	var banner_title = document.getElementById("banner_title");
	var righturl = banner_title.getElementsByTagName("a");
	if (i==group.length-1) 
    {
       i=0;
    }
    else
    {
       i+=1;
    }
	slide_img.src = group[i][1];
	imgurl.href = group[i][0];
	operation();
}

slide = setInterval(changeimg,tti);
addLoadEvent(operation);


