// The idea borrowed from dynamicDrive.com
	var initialtab = [1, "sc1"]
	var previoustab = "";
	var intv;

//Bgid an Dom Object,Set the background image and color.
function navOn(Bgid){ 

	for(i=1;i<7;i++)
	{
	document.getElementById("toplink_"+i).style.backgroundImage="";
	document.getElementById("toplink_"+i).style.color="#ffffff";
	};	

	Bgid.style.backgroundImage="url(http://www.hbqnb.com/news/Templets/index/toplink.jpg)";
	Bgid.style.color="#006E91";

}

function expandcontent(cid,aobject){
	stopTimer();
	highlighttab(aobject);

	if (previoustab != ""){
	document.getElementById(previoustab).style.display = "none";
	document.getElementById(cid).style.display = "block";
	previoustab = cid;
	}
}

function highlighttab(aobject){
	stopTimer();

	if (typeof tabobjlinks == "undefined"){
	collectddimagetabs();}

	for (i = 0; i < tabobjlinks.length; i++){
		tabobjlinks[i].className = "";
		aobject.className = "current";
	}
}

function collectddimagetabs(){
	var tabobj = document.getElementById("ddimagetabs");
	tabobjlinks = tabobj.getElementsByTagName("A");
}

function do_onload(){
	collectddimagetabs();
	expandcontent(initialtab[1], tabobjlinks[initialtab[0] - 1]);
}

function startTimer(){
	intv = setTimeout("expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1])", 2000);
}

function stopTimer(){
	clearTimeout(intv);
}

//Event.observe(window, 'load', do_onload, false);
//Event.observe('xcx_tabmenu', 'mouseover', function(event){
//	stopTimer();
//	},
//	false
//);
//
//Event.observe('xcx_tabmenu', 'mouseout', function(event){
//	var reltg = (event.relatedTarget) ? event.relatedTarget : event.toElement;
//	var tg = (window.event) ? event.srcElement : event.target;
//
//	if (tg.nodeName != 'DIV')
//	return;
//
//	while (reltg != tg && reltg.nodeName != 'BODY'){
//		reltg = reltg.parentNode;
//
//		if (reltg.id == "xcx_tabmenu")
//		return;
//	}
//
//	if (reltg == tg)
//	return;
//
//	stopTimer();
//	startTimer();
//	}, 
//	false
//);

//setHomepage and add to Favarite
	function setHomePage(obj){
	var aUrls=document.URL.split("/");
	var vDomainName="http://"+aUrls[2]+"/";
	try{//IE
		obj.style.behavior="url(#default#homepage)";
		obj.setHomePage(vDomainName);
	}catch(e){//other
		if(window.netscape) {//ff
			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',vDomainName);
		 }
	}
	if(window.netscape)alert("ff");
	}
		
		function addFavorite(){
		var aUrls=document.URL.split("/");
		var vDomainName="http://"+aUrls[2]+"/";
		var description=document.title;
		try{//IE
			window.external.AddFavorite(vDomainName,description);
		}catch(e){//FF
			window.sidebar.addPanel(description,vDomainName,"");
		}
	}
	
	

function show(tips,flag,url){
var my_tips=document.all.mytips;
if(flag){
     my_tips.style.display="";
     if (url!=null){my_tips.innerHTML="<div  style='padding-top:0px; margin:0px; '><img src='"+url+"' align=center width=250></div>";}
     else{ my_tips.innerHTML=tips;}
     my_tips.style.left=event.clientX-0;
     my_tips.style.top=event.clientY+0;
    }
else 
   {
    my_tips.style.display="none";
    }
}

function setDivDisplay ( ElementID , pDisplay ) {
  getElement(ElementID).style.display = pDisplay;
 }
 function changeClass ( ElementID , className ) {
  getElement(ElementID)["className"] = className;
 }
 function getElement ( ElementID ) {
  return document.getElementById(ElementID);
 }

