
function getParameter(name){
    var search = document.location.search;
    var pattern = new RegExp("[?&]"+name+"\=([^&]+)", "g");
    var matcher = pattern.exec(search);
    var items = null;
    if(null != matcher){
        items = decodeURIComponent(matcher[1]);
    }
    return items;
}


/*ppp add*/
var B=BigNews={
	current:0,
	next:0,
	scrollInterval:0,
	autoScroller:0
};
BigNews.turn=function(index){
	clearInterval(BigNews.autoScroller);
	BigNews.scroll(index);
}
BigNews.scroll=function(index){
	if(!$('ul_big_news_item')){
		clearInterval(BigNews.autoScroller);
		return;
	}
	var count=0;
	var step=180;
	var duration=16;
	var b=BigNews;
	b.next=index;
	if(index!=b.current&&count>duration/8){
		return;
	}
	clearInterval(b.scrollInterval);
	var items=$('ul_big_news_item').getElementsByTagName('li');
	for(var i=0;i<4;i++){//头条新闻条数
		items[i].className='';
	}
	items[index].className='up';
	var span=index-b.current;
	var begin_value=$('div_big_news_img').scrollTop;
	var chang_in_value=span*step+(b.current*step-begin_value);
	b.scrollInterval=setInterval(function(){doit(begin_value,chang_in_value)},10);
	function doit(b,c){
		$('div_big_news_img').scrollTop=cpu(count,b,c,duration);
		count++;
		if(count==duration){
			clearInterval(BigNews.scrollInterval);
			scrollInterval=0;
			count=0;
			$('div_big_news_img').scrollTop=b+c;
			BigNews.current=index;
		}
	}
	function cpu(t,b,c,d) {return c*((t=t/d-1)*t*t+1)+b;};
}
BigNews.auto=function(){
	clearInterval(BigNews.autoScroller);
	BigNews.autoScroller=setInterval(function(){
		BigNews.scroll(BigNews.current==3?0:BigNews.current+1);
	},5000);
}
window.attachEvent('onload',BigNews.auto);

function $(s){return document.getElementById(s);}function $P(child,parent){return parent?parent.appendChild(child):document.body.appendChild(child);}function $C(s){return document.createElement(s);};function $R(child,parent){return parent?parent.removeChild(child):document.body.removeChild(child);};var E=new Object;E.add=function(o,t,f){if(o.addEventListener){o.addEventListener(t,f,false)}else if(o.attachEvent){o.attachEvent("on"+t,f)}else{o["on"+t]=f}};E.remove=function(o,t,f){if(o.removeEventListener){o.removeEventListener(t,f,false)}else if(o.detachEvent){o.detachEvent("on"+t,f)}else{o["on"+t]=null}};E.formatEvent=function(e){if(isIE&&isWin){e.charCode=(e.type=="keypress")?e.keyCode:0;e.eventPhase=2;e.isChar=(e.charCode>0);e.pageX=e.clientX+document.body.scrollLeft;e.pageY=e.clientY+document.body.scrollTop;e.preventDefault=function(){this.returnValue=false};if(e.type=="mouseout"){e.relatedTarget=e.toElement}else if(e.type=="mouseover"){e.relatedTarget=e.fromElement}e.stopPropagation=function(){this.cancelBubble=true};e.target=e.srcElement;e.time=(new Date).getTime()}return e};E.get=function(){if(window.event){return this.formatEvent(window.event)}else{return E.get.caller.arguments[0]}};function GetDataByIframe(url,cbf,err,para){if((cbf[0]&&typeof(cbf[0])!='function')||typeof(cbf)!='function'){return alert('cbf function is in error!')}if(url instanceof Array){for(var i=0;i<arr_url.length;i++){doWork(url[i],cbf[i],para[i])}}else if(typeof(url)=='string'){doWork(url,cbf,para)}function doWork(u,cb,p){var idp=$C('iframe');idp.style.display='none';idp.src=u;E.add(idp,'load',icb);function icb(){E.remove(idp,'load',icb);var json=idp.contentWindow.jsonObj;if(!json){if(typeof(err)=='function'){$R(idp);return err();}else{$R(idp);return;}}$R(idp);cb(json,p)}$P(idp)}};


