function getArticleReadNum(siteid,aid){
	$(function(){
	try{
		$.getJSON(" http://www.csc360.com:12080/netanalyzer/aan.jsp?siteid="+siteid+"&aid=" + aid,
		function(html){
			$("#div123456").append(html);
		});
	}catch(e){}
	});
}

function getAllCount(){
	$(function(){
	try{
		$.getJSON(" http://www.csc360.com:12080/netanalyzer/ac.jsp?siteid=1279613873767",
		function(html){
			$("#div_allcount").append(html);
		});
	}catch(e){}
	});
}

function writeCookie(counterid){
	document.cookie = "jcounterid="+counterid; 
}

function readCookie(){
	try{
		//判断是否有计数Id号.
		if(document.cookie.indexOf("jcounterid=")<0)
			return '';
		//说明存在计数Id好,则读取出来.
		var cookies,cookieArray2;
		if(document.cookie){
			cookieArray=document.cookie.split(";");
			cookieArray2=new Array();
			for(i in cookieArray){
				cookieArray2[cookieArray[i].split("=")[0].replace(/ /g,"")]=cookieArray[i].split("=")[1].replace(/ /g,"");
			}
		}
		return cookieArray2["jcounterid"];
    }catch(e){}
	return '';
} 

function makeCounterId(){
	var the_date = new Date();
	return ''+the_date.getYear() + the_date.getMonth() + the_date.getDate() + the_date. getHours() + the_date.getMinutes() + the_date.getSeconds() + the_date.getMilliseconds() + (Math.floor(Math.random() * 100000000000) + 1);

} 

function counter(colid,aid){
	var id;
	id = readCookie();
	if(id==''){
		id = makeCounterId();
		writeCookie(id);
	}
	document.write("<div style='display:none;'><img src=' http://www.csc360.com:12080/netanalyzer/counter.jsp?siteID=1279613873767&sessionid="+id+"&colid="+colid+"&aid="+aid+"&comefrom="+escape(document.referrer)+"&pageurl="+escape(document.URL)+"' border='0' alt='' width='0' height='0'></div>");
}

function openmenu(menuname,posobj){
	  closemenu();

      var menudiv = document.getElementById(menuname);
	  var posleft=posobj.offsetLeft;
	  var menuwidth= 116;
	  var submenuwidth= parseInt(menudiv.style.width);
	  var screenwidth = document.body.clientWidth;
	  var leftspace = 0;
	  if(screenwidth>1000){
		  leftspace = (screenwidth-1000)/2;
	  }
	  var leftpage = posleft+menuwidth/2;
	  var leftpos = leftspace+leftpage-submenuwidth/2;
	  if(leftpos<leftspace) leftpos=leftspace
	  if(leftpos+submenuwidth>leftspace+1000) leftpos=leftspace+1000-submenuwidth;
	  menudiv.style.left=leftpos+"px";

      var Sys = {}; 
      var ua = navigator.userAgent.toLowerCase(); 
      var s; 
        (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] : 
        (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] : 
        (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] : 
        (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] : 
        (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0; 
      //以下进行测试 
      menudiv.style.top="155px";
      if (Sys.ie){
		  if(parseInt(Sys.ie)<8){
     	    menudiv.style.top="165px";
		  }
	  }
//      if (Sys.ie) alert('IE: ' + Sys.ie); 
//      if (Sys.firefox) alert('Firefox: ' + Sys.firefox); 
//      if (Sys.chrome) alert('Chrome: ' + Sys.chrome); 
//      if (Sys.opera) alert('Opera: ' + Sys.opera); 
//      if (Sys.safari) alert('Safari: ' + Sys.safari); 
      menudiv.style.display='block';
}

function closemenu(){
	  document.getElementById('xwzx').style.display='none';
	  document.getElementById('cgjs').style.display='none';
	  document.getElementById('kpjy').style.display='none';
	  document.getElementById('kpxx').style.display='none';
	  document.getElementById('yyjs').style.display='none';
	  document.getElementById('fwzx').style.display='none';
}

function printment(){
	var str =this.location.href;
	var pos1= str.indexOf('/',8)+1;
	var pos2= str.indexOf('index.html',0);
	var pos3= str.indexOf('big5/index.html',0);
	if(pos1==pos2||pos1==pos3){
	document.write('<div id="xwzx" style="padding-top:5px;position:absolute; left:302px; top:155px; width: 200px; height: 23px; display:none; background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="./gndt/index.html">馆内动态</a>　<a href="./hdgg/index.html">活动公告</a>　<a href="./mtjj/index.html">媒体聚焦</a></div>');
	document.write('<div id="cgjs" style="padding-top:5px;position:absolute; left:440px; top:155px; width: 180px; height: 23px; display:none;background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="./cgjs/index.html">场馆简介</a>　<a href="./aq/index.html">A区</a>　<a href="./bq/index.html">B区</a></div>');
	document.write('<div id="kpjy" style="padding-top:5px;position:absolute; left:440px; top:155px; width: 400px; height: 23px; display:none;background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="./gxjh/index.html">馆校结合</a>　<a href="./kpjc/index.html">科普剧场</a>　<a href="./kphd/index.html">科普活动</a>　<a href="./jypx/index.html">教育培训</a>　<a href="./kjrwdjt/index.html">科技•人文大讲坛</a>　<a href="./lszl/index.html">临时展览</a></div>');
	document.write('<div id="kpxx" style="padding-top:5px;position:absolute; left:680px; top:155px; width: 150px; height: 23px; display:none;background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="./kjqy/index.html">科技前沿</a>　<a href="./kpzs/index.html">科普知识</a></div>');
	document.write('<div id="yyjs" style="padding-top:5px;position:absolute; left:760px; top:155px; width: 150px; height: 23px; display:none;background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="./yyjs/index.html">影院介绍</a>　<a href="./syyp/index.html">影片介绍</a></div>');
	document.write('<div id="fwzx" style="padding-top:5px;position:absolute; left:400px; top:155px; width: 600px; height: 23px; display:none;background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="./qnzyz/index.html">志愿者服务</a>　<a href="./hyszt/index.html">会议室</a>　<a href="./fwrx/index.html">服务热线</a>　<a href="./dlwz/index.html">地理位置</a>　<a href="./cclx/index.html">乘车路线</a>　<a href="./kgsj/index.html">开馆时间</a>　<a href="./pwxx/index.html">票务信息</a>　<a href="./cgts/index.html">参观提示</a>　<a href="./cjwt/index.html">常见问题</a>　<a href="./lyjy/index.html">留言建议</a></div>');
	}else{
	document.write('<div id="xwzx" style="padding-top:5px;position:absolute; left:302px; top:155px; width: 200px; height: 23px; display:none; background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="../gndt/index.html">馆内动态</a>　<a href="../hdgg/index.html">活动公告</a>　<a href="../mtjj/index.html">媒体聚焦</a></div>');
	document.write('<div id="cgjs" style="padding-top:5px;position:absolute; left:440px; top:155px; width: 180px; height: 23px; display:none;background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="../cgjs/index.html">场馆简介</a>　<a href="../aq/index.html">A区</a>　<a href="../bq/index.html">B区</a></div>');
	document.write('<div id="kpjy" style="padding-top:5px;position:absolute; left:440px; top:155px; width: 400px; height: 23px; display:none;background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="../gxjh/index.html">馆校结合</a>　<a href="../kpjc/index.html">科普剧场</a>　<a href="../kphd/index.html">科普活动</a>　<a href="../jypx/index.html">教育培训</a>　<a href="../kjrwdjt/index.html">科技•人文大讲坛</a>　<a href="../lszl/index.html">临时展览</a></div>');
	document.write('<div id="kpxx" style="padding-top:5px;position:absolute; left:680px; top:155px; width: 150px; height: 23px; display:none;background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="../kjqy/index.html">科技前沿</a>　<a href="../kpzs/index.html">科普知识</a></div>');
	document.write('<div id="yyjs" style="padding-top:5px;position:absolute; left:760px; top:155px; width: 150px; height: 23px; display:none;background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="../yyjs/index.html">影院介绍</a>　<a href="../syyp/index.html">影片介绍</a></div>');
	document.write('<div id="fwzx" style="padding-top:5px;position:absolute; left:400px; top:155px; width: 600px; height: 23px; display:none;background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="../qnzyz/index.html">志愿者服务</a>　<a href="../hyszt/index.html">会议室</a>　<a href="../fwrx/index.html">服务热线</a>　<a href="../dlwz/index.html">地理位置</a>　<a href="../cclx/index.html">乘车路线</a>　<a href="../kgsj/index.html">开馆时间</a>　<a href="../pwxx/index.html">票务信息</a>　<a href="../cgts/index.html">参观提示</a>　<a href="../cjwt/index.html">常见问题</a>　<a href="../lyjy/index.html">留言建议</a></div>');
	}
}

function printenmenu(){
	document.write('<div id="halls" style="padding-top:5px;position:absolute; left:302px; top:155px; width: 770px; height: 23px; display:none; background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="../2010-08-27/1282029107939.html">Life Hall</a>　<a href="../2010-08-27/1282029107926.html">Children’s Hall</a>　<a href="../2010-08-27/1282029107913.html">Disaster Defense Hall</a>　<a href="../2010-08-27/1282029107900.html">Transport Hall</a>　<a href="../2010-08-27/1282029107887.html">National Defense Hall</a>　<a href="../2010-08-27/1282029107874.html">Fundamentals Hall</a>　<a href="../2010-08-27/1282029107861.html">Astronomy Hall</a></div>');
	document.write('<div id="theaters" style="padding-top:5px;position:absolute; left:440px; top:155px; width: 360px; height: 23px; display:none;background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="../2010-08-27/1282029108026.html">The 4D dynamic theatre</a>　<a href="../2010-08-27/1282029108013.html">The IMAX 3D huge-screen theatre</a></div>');
	document.write('<div id="edu" style="padding-top:5px;position:absolute; left:440px; top:155px; width: 800px; height: 23px; display:none;background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="../2010-09-02/1282029110049.html">Popular Science Theater</a>　<a href="../2010-09-01/1282029109549.html">Popular Science Activity</a>　<a href="../2010-09-01/1282029109534.html">Education & Training</a>　<a href="../2010-09-01/1282029109525.html">Technology • Humanity” Forum</a>　<a href="../2010-09-02/1282029110066.html">Temporary Exhibition</a></div>');
}

function printkrmenu(){
	document.write('<div id="halls" style="padding-top:5px;position:absolute; left:302px; top:155px; width: 770px; height: 23px; display:none; background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="../2010-09-20/1284035969029.html">기초과학 전시홀</a>　<a href="../2010-09-20/1284035969017.html">국방과학기술 전시홀</a>　<a href="../2010-09-20/1284035969003.html">교통 과학기술 전시홀</a>　<a href="../2010-09-20/1284035968991.html">재해 예방 과학기술 전시홀</a>　<a href="../2010-09-20/1284035968977.html">아이과학 랜드</a>　<a href="../2010-09-20/1284035968965.html">생활과학기술 전시홀</a>　<a href="../2010-09-20/1284035969041.html">우항 전시홀</a></div>');
	document.write('<div id="theaters" style="padding-top:5px;position:absolute; left:440px; top:155px; width: 360px; height: 23px; display:none;background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="../2010-09-20/1284035969225.html">IMAX 영화관</a>　<a href="../2010-09-20/1284035969213.html">4D동감 영화관</a></div>');
	document.write('<div id="edu" style="padding-top:5px;position:absolute; left:440px; top:155px; width: 800px; height: 23px; display:none;background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="../2010-09-20/1284035969091.html">‘과학 기술, 인문’ 강좌</a>　<a href="../2010-09-20/1284035969077.html">과학보급 활동</a>　<a href="../2010-09-20/1284035969065.html">임시 전시홀</a>　<a href="../2010-09-20/1284035969053.html">과학보급</a>　<a href="../2010-09-20/1284035969089.html">과학보급 연수</a></div>');
}

function printjpmenu(){
	document.write('<div id="halls" style="padding-top:5px;position:absolute; left:302px; top:155px; width: 770px; height: 23px; display:none; background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="../2010-11-18/1289358276428.html">生活展示ホール</a>　<a href="../2010-11-18/1289358276430.html">子供科学楽園</a>　<a href="../2010-11-18/1289358276433.html">防災展示ホール</a>　<a href="../2010-11-18/1289358276435.html">交通展示ホール</a>　<a href="../2010-11-18/1289358276437.html">国防展示ホール</a>　<a href="../2010-11-18/1289358276439.html">科学の基礎展示ホール</a>　<a href="../2010-11-18/1289358276441.html">宇宙科学展示ホール</a></div>');
	document.write('<div id="theaters" style="padding-top:5px;position:absolute; left:440px; top:155px; width: 360px; height: 23px; display:none;background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="../2010-11-18/1289358276443.html">4D シアター</a>　<a href="../2010-11-18/1289358276445.html">IMAX 3D 大型スクリーンシアター</a></div>');
	document.write('<div id="edu" style="padding-top:5px;position:absolute; left:440px; top:155px; width: 800px; height: 23px; display:none;background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="../2010-11-18/1289358276451.html">科学劇</a>　<a href="../2010-11-18/1289358276455.html">科学普及のための教育活動</a>　<a href="../2010-11-18/1289358276457.html">科学普及のための育成訓練</a>　<a href="../2010-11-18/1289358276417.html">科学技術と人材育成</a>　<a  href="../2010-11-18/1289358276447.html">臨時展示ホール</a></div>');
}

function printfrmenu(){
	document.write('<div id="halls" style="padding-top:5px;position:absolute; left:302px; top:155px; width: 770px; height: 23px; display:none; background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="../2010-11-19/1290151506761.html">Salle de Vie Scientifique</a>　<a href="../2010-11-19/1290151506773.html">Salle scientifique d’Enfants</a>　<a href="../2010-11-19/1290151506785.html">Salle de Défense du Désastre</a>　<a href="../2010-11-19/1290151506797.html">Salle de Transports</a>　<a href="../2010-11-19/1290151506809.html">Salle de Défense Nationale</a>　<a href="../2010-11-19/1290151506821.html">Salle de Science Fondamentale</a>　<a href="../2010-11-19/1290151506833.html">Salle d’Aérospatiale</a></div>');
	document.write('<div id="theaters" style="padding-top:5px;position:absolute; left:440px; top:155px; width: 360px; height: 23px; display:none;background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="../2010-11-19/1290151506857.html">Introduction du Cinéma 4D</a>　<a href="../2010-11-19/1290151506845.html">Introduction du Cinéma IMAX</a></div>');
	document.write('<div id="edu" style="padding-top:5px;position:absolute; left:440px; top:155px; width: 800px; height: 23px; display:none;background-color:#f5fdff;filter:alpha(opacity=90);" align="center"><a href="../2010-11-18/1289358276626.html">Forum des Sciences Humaines</a>　<a href="../2010-11-18/1289358276624.html">Formation sur la vulgarisation scientifique</a>　<a href="../2010-11-18/1289358276622.html">Education sur la Vulgarisation des Sciences</a>　<a href="../2010-11-18/1289358276620.html">Les expositions temporaires</a>　<a href="../2010-11-18/1289358276618.html">Le Théâtre de la Vulgarisation des Sciences</a></div>');
}

function closeenmenu(){
	  document.getElementById('halls').style.display='none';
	  document.getElementById('theaters').style.display='none';
	  document.getElementById('edu').style.display='none';
}

function openenmenu(menuname,posobj){
	  closeenmenu();

      var menudiv = document.getElementById(menuname);
	  var posleft=posobj.offsetLeft;
	  var menuwidth= 116;
	  var submenuwidth= parseInt(menudiv.style.width);
	  var screenwidth = document.body.clientWidth;
	  var leftspace = 0;
	  if(screenwidth>1000){
		  leftspace = (screenwidth-1000)/2;
	  }
	  var leftpage = posleft+menuwidth/2;
	  var leftpos = leftspace+leftpage-submenuwidth/2;
	  if(leftpos<leftspace) leftpos=leftspace
	  if(leftpos+submenuwidth>leftspace+1000) leftpos=leftspace+1000-submenuwidth;
	  menudiv.style.left=leftpos+"px";

      var Sys = {}; 
      var ua = navigator.userAgent.toLowerCase(); 
      var s; 
        (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] : 
        (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] : 
        (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] : 
        (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] : 
        (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0; 
      //以下进行测试 
      menudiv.style.top="155px";
      if (Sys.ie){
		  if(parseInt(Sys.ie)<8){
     	    menudiv.style.top="165px";
		  }
	  }
//      if (Sys.ie) alert('IE: ' + Sys.ie); 
//      if (Sys.firefox) alert('Firefox: ' + Sys.firefox); 
//      if (Sys.chrome) alert('Chrome: ' + Sys.chrome); 
//      if (Sys.opera) alert('Opera: ' + Sys.opera); 
//      if (Sys.safari) alert('Safari: ' + Sys.safari); 
      menudiv.style.display='block';
}

function AddFavorite(sURL, sTitle)
{
  try{
    window.external.addFavorite(sURL, sTitle);
  }catch (e){
    try{window.sidebar.addPanel(sTitle, sURL, "");}catch (e){alert("加入收藏失败，请使用Ctrl+D进行添加");}
  }
}
function SetHome(obj,vrl){
  try{
    obj.style.behavior='url(#default#homepage)';
	obj.setHomePage(vrl);
  }catch(e){
    if(window.netscape) {
      try{
		netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
      }catch (e) {
        alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");
      }
      var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
      prefs.setCharPref('browser.startup.homepage',vrl);
    }
  }
}

