
function p$(string) {
	document.write(string);
}
function $(id) {
	return document.getElementById(id);
}
function change_menu(id, content_id, num, total_ztc_menu, menu_on, menu_off) {
	for (var i = 1; i <= total_ztc_menu; i++) {
		$(id + i).className = menu_off;
		$(content_id + i).style.display = "none";
	}
	$(id + num).className = menu_on;
	$(content_id + num).style.display = "block";
}

//可修改区域
var _timeOut_ = 5000;
var show_text = true; //是否显示焦点文字
var timeOut = _timeOut_;
var timeOut2 = _timeOut_ / 2;//onmouseout img后需要切换的时间
var nowpic = 0;
var target = "_blank";   //打开方式
var button_on = "on";
var button_off = "";

//不可修改区域
var imgUrl = new Array();
var imgText = new Array();
var imgLink = new Array();
var imgAlt = new Array();
var menuList = new Array();
var ver = 2; //兼容浏览器版本 2为非ie
var firstTime = true;
var n = -1;


//菜单menu
menuList[++n] = "XX";
imgUrl[n] = "/pagepic/01.jpg";
imgText[n] = "<a href=\"http://www.gycoop.com/guest/index_show.shtml?id=5a861bb3345c6f9801345fecde4d0032\" target=\"_blank\">市委常委、副市长黄正富拜访省供销社领导</a>";
imgLink[n] = "http://www.gycoop.com/guest/index_show.shtml?id=5a861bb3345c6f9801345fecde4d0032";
imgAlt[n] = "市委常委、副市长黄正富拜访省供销社领导";//图片提示
menuList[++n] = "XX";
imgUrl[n] = "/pagepic/02.jpg";
imgText[n] = "<a href=\"http://www.gycoop.com/guest/index_show.shtml?id=5a861bb334807c220134822f59650002\" target=\"_blank\">温家宝出席全国粮食生产表彰奖励大会</a>";
imgLink[n] = "http://www.gycoop.com/guest/index_show.shtml?id=5a861bb334807c220134822f59650002";
imgAlt[n] = "温家宝出席全国粮食生产表彰奖励大会";
menuList[++n] = "XX";
imgUrl[n] = "/pagepic/03.jpg";
imgText[n] = "<a href=\"http://www.gycoop.com/guest/index_show.shtml?id=5a861bb3345c6f9801345e5bcdf9000b\" target=\"_blank\">旺苍县供销社召开党员民主生活会</a>";
imgLink[n] = "http://www.gycoop.com/guest/index_show.shtml?id=5a861bb3345c6f9801345e5bcdf9000b";
imgAlt[n] = "旺苍县供销社召开党员民主生活会";
menuList[++n] = "XX";
imgUrl[n] = "/pagepic/04.jpg";
imgText[n] = "<a href=\"http://www.gycoop.com/guest/index_show.shtml?id=5a861bb33331bea3013333759dbe000b\" target=\"_blank\">苍溪红心果圆农户致富梦</a>";
imgLink[n] = "http://www.gycoop.com/guest/index_show.shtml?id=5a861bb33331bea3013333759dbe000b";
imgAlt[n] = "苍溪红心果圆农户致富梦";
menuList[++n] = "XX";
imgUrl[n] = "/pagepic/05.jpg";
imgText[n] = "<a href=\"http://www.gycoop.com/guest/index_show.shtml?id=5a861bb33438632501343b5fe1550018\" target=\"_blank\">旺苍县供销社检查烟花爆竹企业安全工作</a>";
imgLink[n] = "http://www.gycoop.com/guest/index_show.shtml?id=5a861bb33438632501343b5fe1550018";
imgAlt[n] = "旺苍县供销社检查烟花爆竹企业安全工作";
var count = 0;
for (var i = 0; i < imgUrl.length; i++) {
	if ((imgUrl[i] != "") && (imgText[i] != "") && (imgLink[i] != "") && (imgAlt[i] != "")) {
		count++;
	} else {
		break;
	}
}
var each_width = Math.ceil((316 - (count - 1)) / count);
var last_width = 316 - each_width * (count - 1) - (count) + 1;
function change() {
	if (ver == 1) {
		with ($("f_img").filters[0]) {
			Transition = 1;
			apply();
			play();
		}
	}
	if (firstTime) {
		firstTime = false;
		timeOut = _timeOut_ / 1000;
	} else {
		$("f_img").src = imgUrl[nowpic];
		$("f_img").alt = imgAlt[nowpic];
		$("f_imgLink").href = imgLink[nowpic];
		if (show_text) {
			$("f_text").innerHTML = imgText[nowpic];
		}
		for (var i = 0; i < count; i++) {
			$("b" + i).className = "button";
		}
		$("b" + nowpic).className = "on";
		nowpic = (nowpic >= imgUrl.length - 1) ? 0 : nowpic + 1;
		timeOut = _timeOut_;
	}
	theTimer = setTimeout("change()", timeOut);
}
function b_change(num) {
	window.clearInterval(theTimer);
	nowpic = num;
	firstTime = false;
	change();
}
function draw_line() {
	var div = document.createElement("div");
	div.id = "f_line";
	$("f_infoDiv").insertBefore(div, $("f_infoDiv").childNodes.item(0));
}
var a = document.createElement("a");
a.id = "f_imgLink";
a.target = target;
a.href = imgLink[nowpic];
$("f_imgDiv").appendChild(a);
var img = document.createElement("img");
img.id = "f_img";
img.src = imgUrl[nowpic];
img.alt = imgAlt[nowpic];
a.appendChild(img);
for (var i = count - 1; i >= 0; i--) {
	var div_bg = document.createElement("div");
	div_bg.id = "div_bg" + i;
	div_bg.className = "bg";
	$("f_buttonDiv").appendChild(div_bg);
	var a = document.createElement("a");
	a.id = "b" + i;
	a.className = (i == nowpic + 1) ? "button_on" : "button_off";
	a.title = imgAlt[i];
	a.innerHTML = i + 1;
	a.href = "javascript:b_change(" + i + ")";
	$("div_bg" + i).appendChild(a);
	var div = document.createElement("div");
	$("f_buttonDiv").appendChild(div);
}
if (show_text) {
	$("f_text").innerHTML = imgText[nowpic];
}
$("f_img").onmouseover = function () {
	window.clearInterval(theTimer);
};
$("f_img").onmouseout = function () {
	theTimer = setTimeout("change()", timeOut2);
};
try {
	new ActiveXObject("DXImageTransform.Microsoft.Fade");
	$("f_img").filters[0].play();
	ver = 1;
	draw_line();
}
catch (e) {
	ver = 2;
}
var theTimer = setTimeout("change()", _timeOut_ / 1000);


