/*切换样式*/
var str='<link title="color_blue" href="img/color_blue.css" rel="stylesheet" type="text/css" disabled="disabled" /><link title="color_purple" href="img/color_purple.css" rel="stylesheet" type="text/css" disabled="disabled" /><link title="color_pink" href="img/color_pink.css" rel="stylesheet" type="text/css" disabled="disabled" /><link title="color_brown" href="img/color_brown.css" rel="stylesheet" type="text/css" disabled="disabled" /><link title="color_green" href="img/color_green.css" rel="stylesheet" type="text/css" disabled="disabled" />';
function setStyle(title,obj) {
	var i, links;
	links = document.getElementsByTagName("link");
	for(i=1; links[i]; i++) {
		if(links[i].getAttribute("rel").indexOf("style") != -1&& links[i].getAttribute("title")) {
			links[i].disabled = true;
			if(links[i].getAttribute("title").indexOf(title) != -1){
			links[i].disabled = false}
		}
	}
	if(document.getElementById('themeList')){
		var themeList = document.getElementById('themeList');
		themeListLi = themeList.getElementsByTagName('li');
		for(i in themeListLi){
			themeListLi[i].className = '';
		}
		obj.parentNode.className = 'active';
	}
}





/* 广告*/

if (!$) var $=function(s) { return typeof s =="string" ? document.getElementById(s) : s ;}

var v=navigator.appVersion.match(/MSIE (\d\.\d)/)?parseInt(navigator.appVersion.match(/MSIE (\d\.\d)/)[1]) : 100;
/*
* Get the class string from the object
* @param object o the DOM object 
* @return string the class string of the object
*/
var getClassName=function(o){
	return o.className;
}
/*
* Set the class string from the object
* @param string cls the class string to be set
* @param object o the DOM object where the class string to be set to
*/
var setClassName=function(cls,o){
	o.className=cls;
}
/*
* Parse the classes list to array by split(" ")
* @param string cl a string of class or a list of classes
* @return array with the element of class name
*/
var getClassArray=function(cl){
	if(cl && typeof(cl)=="string")
	return cl.split(" ");
	else return cl;
}
/*
* If the class is listed in the classes list ,return true
* @param string cl a single class name 
* @param string cls class name list
* @return true if the class is listed in the classes list.else return false.
*/
var matchClass=function(cl,cls){
	if(!cls) return false;
	cls= getClassArray(cls);
	for(var c in cls) if(cl==cls[c]) return true;
	return cl==cls;
}
/*
* remove one of the classes from the object
* @param string cl a single class name 
* @param string cls class name list
*/
var removeClass=function(cl,o){
	var cls=getClassArray(getClassName(o));
	var _cls="";
	for(var i in cls) if (cl!=cls[i]) _cls+=" "+cls[i];
	setClassName(_cls,o);
}
/*
* add a classe to the object
* @param string cl a single class name 
* @param object o the DOM object where the class string to be ADD to
*/
var addClass=function(cl,o){
	removeClass(cl,o);
	setClassName(getClassName(o)+" "+cl,o);
}

var pictureMainShow=function(){
	var pics=$("MainShow").getElementsByTagName("li");
	var thums=$("MainShowThum").getElementsByTagName("li");
	
	var _toggle=function(i){
		i= i || 0;
		for (var c in pics){
			if (pics[i] && pics[c].nodeName)
				pics[c].style.display="none";
		}
		if (pics[i] && pics[i].nodeName)
		pics[i].style.display="";
	}
	_toggle();
	var _toggleHover=function(i){
		i= i || 0;
		for (var c in thums){
			removeClass("thum_hover",thums[c]);
		}
		addClass("thum_hover",thums[i]);
	}
	_toggleHover();
	var delegate=function(fn,params,obj){//代理方法
        return function(){
            fn.apply(obj||window,params)
		}
	}
	var intervalInt=null;
	var delay=2000;
	var currShow=0;
	var scrollShow=function(){
		currShow=parseInt(currShow)>thums.length-2 ? 0 : parseInt(currShow)+1;
		_toggle(currShow);
		_toggleHover(currShow);
	}
	
	var _interval=function(){
		intervalInt=window.setInterval(scrollShow,delay);
	}
	_interval();
	
	for (i in thums){
		if (!thums[i].nodeName) continue;
		thums[i].onmouseover=delegate(function(i){
				_toggleHover(i);
				_toggle(i);
				currShow=i;
				window.clearInterval(intervalInt);
			},[i],thums[i]);
		
		thums[i].onmouseout=function(){
			_interval();
		}
	}

}

function showNews(str,htt,clen,beg,end,t1,tr){
var l,str,htt,clen,beg,end,t1,tr;
begin(clen);
str = str;
l = str.length;
if(l>clen){
 //document.write("no");
}else{
document.write("<"+beg+">"+"<a href='"+htt+"' target='_blank'>"+t1+str+tr+"</a> "+"</"+end+">");
}
}
function begin(clen){
var clen;
var str0="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
var l = str0.length;
if(l>clen){
 //document.write("no");
}else{
document.write("<a href='#' target='_blank'>"+str0+"</a> ");
}
}



