/* Copyright (c) 2010 Baidu */
window.baidu=window.baidu||{version:"1-0-0",emptyFn:function(){}};baidu.isString=function(a){return(typeof a=="object"&&a&&a.constructor==String)||typeof a=="string"
};baidu.G=function(){for(var b=[],c=arguments.length-1;c>-1;c--){var d=arguments[c];b[c]=null;if(typeof d=="object"&&d&&d.dom){b[c]=d.dom
}else{if((typeof d=="object"&&d&&d.tagName)||d==window||d==document){b[c]=d}else{if(baidu.isString(d)&&(d=document.getElementById(d))){b[c]=d
}}}}return b.length<2?b[0]:b};baidu.each=function(f,b){if(typeof b!="function"){return f}if(f){var a;if(f.length===undefined){for(var c in f){if(c in {}){continue
}a=b.call(f[c],f[c],c);if(a=="break"){break}}}else{for(var d=0,e=f.length;d<e;d++){a=b.call(f[d],f[d],d);if(a=="break"){break
}}}}return f};baidu.hide=function(){baidu.each(arguments,function(a){if(a=baidu.G(a)){a.style.display="none"}})};baidu.on=function(h,f,e,g){if(!(h=baidu.G(h))||typeof e!="function"){return h
}f=f.replace(/^on/i,"").toLowerCase();function b(i){return i||window.event}var d=function(i){e.call(d.src,b(i))};d.src=h;
var c=baidu.on._listeners;var a=[h,f,e,d];c[c.length]=a;if(h.attachEvent){h.attachEvent("on"+f,d)}else{if(h.addEventListener){h.addEventListener(f,d,false)
}}return h};baidu.on._listeners=[];baidu.show=function(){baidu.each(arguments,function(a){if(a=baidu.G(a)){a.style.display=""
}})};baidu.browser=baidu.browser||{};(function(){var a=navigator.userAgent;baidu.firefox=baidu.browser.firefox=/firefox\/(\d+\.\d)/i.test(a)?parseFloat(RegExp["\x241"]):0;
baidu.ie=baidu.browser.ie=/msie (\d+\.\d)/i.test(a)?parseFloat(RegExp["\x241"]):0;baidu.opera=baidu.browser.opera=/opera\/(\d+\.\d)/i.test(a)?parseFloat(RegExp["\x241"]):0;
baidu.safari=baidu.browser.safari=(/(\d+\.\d)(\.\d)?\s+safari/i.test(a)&&!/chrome/i.test(a))?parseFloat(RegExp["\x241"]):0;
try{baidu.browser.maxthon=/(\d+\.\d)/.test(external.max_version)?parseFloat(RegExp["\x241"]):0}catch(b){baidu.browser.maxthon=0
}baidu.maxthon=baidu.browser.maxthon;baidu.isGecko=baidu.browser.isGecko=/gecko/i.test(a)&&!/like gecko/i.test(a);baidu.isStrict=baidu.browser.isStrict=document.compatMode=="CSS1Compat";
baidu.isWebkit=baidu.browser.isWebkit=/webkit/i.test(a)})();baidu.getCurrentStyle=function(a,c){var e=null;if(!(a=baidu.G(a))){return null
}if(e=a.style[c]){return e}else{if(a.currentStyle){e=a.currentStyle[c]}else{var d=a.nodeType==9?a:a.ownerDocument||a.document;
if(d.defaultView&&d.defaultView.getComputedStyle){var b=d.defaultView.getComputedStyle(a,"");if(b){e=b[c]}}}}return e};baidu.dom=baidu.dom||{};
baidu.isElement=function(a){if(a===undefined||a===null){return false}return a&&a.nodeName&&a.nodeType==1};baidu.isDocument=function(a){if(a===undefined||a===null){return false
}return a&&a.nodeType==9};baidu.dom.getDocument=function(a){if(baidu.isElement(a)||baidu.isDocument(a)){return a.nodeType==9?a:a.ownerDocument||a.document
}else{throw new Error("[baidu.dom.getDocument] param must be Element or Document")}};baidu.isElement=function(a){return a&&a.nodeType==1
};baidu.dom.getPosition=function(d){d=baidu.G(d);if(!baidu.isElement(d)){throw new Error("[baidu.dom.getPosition] param must be Element")
}var g=baidu.dom.getDocument(d);var f=baidu.isGecko>0&&g.getBoxObjectFor&&baidu.getCurrentStyle(d,"position")=="absolute"&&(d.style.top===""||d.style.left==="");
var h={left:0,top:0};var b=(baidu.ie&&!baidu.isStrict)?g.body:g.documentElement;if(d==b){return h}var c=null;var e;if(d.getBoundingClientRect){e=d.getBoundingClientRect();
h.left=e.left+Math.max(g.documentElement.scrollLeft,g.body.scrollLeft);h.top=e.top+Math.max(g.documentElement.scrollTop,g.body.scrollTop);
h.left-=g.documentElement.clientLeft;h.top-=g.documentElement.clientTop;if(baidu.ie&&!baidu.isStrict){h.left-=2;h.top-=2}}else{if(g.getBoxObjectFor&&!f){e=g.getBoxObjectFor(d);
var a=g.getBoxObjectFor(b);h.left=e.screenX-a.screenX;h.top=e.screenY-a.screenY}else{c=d;do{h.left+=c.offsetLeft;h.top+=c.offsetTop;
if(baidu.isWebkit>0&&baidu.getCurrentStyle(c,"position")=="fixed"){h.left+=g.body.scrollLeft;h.top+=g.body.scrollTop;break
}c=c.offsetParent}while(c&&c!=d);if(baidu.opera>0||(baidu.isWebkit>0&&baidu.getCurrentStyle(d,"position")=="absolute")){h.top-=g.body.offsetTop
}c=d.offsetParent;while(c&&c!=g.body){h.left-=c.scrollLeft;if(!baidu.opera||c.tagName!="TR"){h.top-=c.scrollTop}c=c.offsetParent
}}}return h};

// JavaScript Document
var picRotation = {
	
	pics : new Array(),
	
	dots : new Array(),
	
	Rotation : null,
	
	picContainer : 'pic_container',
	
	dotContainer : 'dot_container',
	
	showClassName : 'showPic',
	
	hideClassName : 'hidePic',
	
	delay : 3,
	
	init : function(){
		
		picRotation.picContainer = document.getElementById(picRotation.picContainer);
		
		picRotation.dotContainer = document.getElementById(picRotation.dotContainer);
		
		var pictures = picRotation.picContainer.getElementsByTagName('img');
		
		for(var i = 0; i<pictures.length; i++)picRotation.pics.push(pictures[i]);
		
		var obj = null;
		
		for(var j = 0; j<picRotation.pics.length; j++){
			
			obj = document.createElement('input');
			
			obj.type = 'button';
			
			if(picRotation.pics[j].className == picRotation.showClassName)obj.className = 'solidot';
			
			else obj.className = 'hollowdot';
			
			(function(j){
			
				obj.onclick = function(){
					
					picRotation.dotClick(j)
					
				}
			})(j);
			
			obj.onfocus = function(){this.blur();}
			
			picRotation.dotContainer.appendChild(obj);
			
			picRotation.dots.push(obj);
				
		}		
		
		picRotation.start();
		
	},
	
	getPicNum : function(num){
				
		var num = 0;
		
		for(var i = 0; i < picRotation.pics.length; i++){
			
			if(picRotation.pics[i].className == picRotation.showClassName){
				
				num	= i;
				
				break;
				
			}
				
		}
		
		if(num >= (picRotation.pics.length-1)){
			
			num = 0;
			
		}else{ 
			
			num++;
			
		}
				
		return num;
		
	},
	
	showPic : function(num){
		
		num == null ? num = picRotation.getPicNum() : num;
		
		for(var i = 0; i < picRotation.pics.length; i++){
		
			if(i ==  num){				
				
				picRotation.pics[i].className = picRotation.showClassName;	
				
				picRotation.dots[i].className = 'solidot';
				
			}else{
				
				picRotation.pics[i].className = picRotation.hideClassName;	
				
				picRotation.dots[i].className = 'hollowdot';
			}
		}
	},
	
	start : function(){
		
		if(picRotation.Rotation == null){
		
			picRotation.Rotation = window.setInterval('picRotation.showPic()',picRotation.delay * 1000);
			
		}
		
	},
	
	dotClick : function(num){
		
		picRotation.clear();
		
		picRotation.showPic(num);
		
		picRotation.start();
		
	},
	
	clear : function(){
			
		window.clearInterval(picRotation.Rotation);		
		
		picRotation.Rotation = null;
	}
	
}

function isIE(){
	var isIE=!+'\v1';
    var isIE6=isIE && /MSIE (\d)\./.test(navigator.userAgent) && parseInt(RegExp.$1) < 7;
    return isIE6;
}

function getElementPos(el) {
			 var ua = navigator.userAgent.toLowerCase();
			 var isOpera = (ua.indexOf('opera') != -1);
			 var isIE = (ua.indexOf('msie') != -1 && !isOpera); // not opera spoof
			 if(el.parentNode === null || el.style.display == 'none') {
			  return false;
			 }      
			 var parent = null;
			 var pos = [];     
			 var box;     
			 if(el.getBoundingClientRect)    //IE 
			 {         
			  box = el.getBoundingClientRect();
			  var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
			  var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
			  return {x:box.left + scrollLeft, y:box.top + scrollTop};
			 }else if(document.getBoxObjectFor)    // gecko    
			 {
			  box = document.getBoxObjectFor(el); 
			  var borderLeft = (el.style.borderLeftWidth)?parseInt(el.style.borderLeftWidth):0; 
			  var borderTop = (el.style.borderTopWidth)?parseInt(el.style.borderTopWidth):0; 
			  pos = [box.x - borderLeft, box.y - borderTop];
			 } else    // safari & opera    
			 {
			  pos = [el.offsetLeft, el.offsetTop];
			  parent = el.offsetParent;     
			  if (parent != el) { 
			   while (parent) {  
				pos[0] += parent.offsetLeft; 
				pos[1] += parent.offsetTop; 
				parent = parent.offsetParent;
			   }  
			  }   
			  if (ua.indexOf('opera') != -1 || ( ua.indexOf('safari') != -1 && el.style.position == 'absolute' )) { 
			   pos[0] -= document.body.offsetLeft;
			   pos[1] -= document.body.offsetTop;         
			  }    
			 }              
			 if (el.parentNode) { 
				parent = el.parentNode;
			   } else {
				parent = null;
			   }
			 while (parent && parent.tagName != 'BODY' && parent.tagName != 'HTML') { // account for any scrolled ancestors
			  pos[0] -= parent.scrollLeft;
			  pos[1] -= parent.scrollTop;
			  if (parent.parentNode) {
			   parent = parent.parentNode;
			  } else {
			   parent = null;
			  }
			 }
			 return {x:pos[0], y:pos[1]};
}

function toUrl(url){
	window.open(url,'download');
}
baidu.on(window,'load',function(){
	var tags=['a'];
	var atags=null;
	for(var i=0;i<tags.length;i++){
		atags=document.getElementsByTagName(tags[i]);
		for(var j=0;j<atags.length;j++){
			atags[j].onfocus=function(){this.blur();}	
		}
	}
});
