function setcookie()
  {
    document.cookie="dx";
  }
  
function getcookie()
  {
    var cookie_str=new String(document.cookie);
    var cookie_head="dx";
    var begin_pos=cookie_str.indexOf(cookie_head);
    if(begin_pos!=-1) return 1;
    else return 0;
  }
 
function init()
 {
  var str=new String(document.cookie);    
  cookie_head="dx";
  pos=str.indexOf(cookie_head);
  if(pos!=-1) return 1;
  else{
    setcookie();
    window.open("info/hbb7.htm","info1","width=700,height=500,top=40,left=40,scrollbars=yes");
   }
 }

var id;
var start = new Date();
function clockon(){
	var iM = 0, iS = 0, iH = 0, startTime = 0;
	now = new Date();
	if((startTime = getTimeCookie()) == 0){
		startTime = start.getTime();
		setTimeCookie(startTime);
	}//if((startTime = getTimeCookie()) == 0){
	time = (now.getTime() - startTime) / 1000;//总共合多少秒
	time = Math.floor(time);
	iH = Math.floor(time / 3600);//转化成：时-分-秒后取其中的时(hour)
	time = time % 3600;
	iM = Math.floor(time / 60);//转化成：时-分-秒后取其中的分(minute)
	iS = time % 60;//转化成：时-分-秒后取其中的秒(second)
	if(eval(iS) < 10) iS = "0" + iS;
	if(iM < 10) iM = "0" + iM;
	if(iH < 10) iH = "0" + iH;
	var stayTime = iH + ":" + iM + ":" + iS;
	if(document.all){
		Clock.innerHTML = stayTime;
	}
	if(document.layers){
		document.Clock.document.write('<div id="Clock" >' + thistime + '</div>');
		document.close();
	}//
	id = setTimeout( "clockon()", 1000);
}//end functon clockon

function setTimeCookie(startTime){
    document.cookie = "time:" + startTime;
}//
  
function getTimeCookie(){
    var cookie_str = new String(document.cookie);
    var cookie_head = "time:";
    var begin_pos = cookie_str.indexOf(cookie_head);
    if(begin_pos != -1) return cookie_str.substr(begin_pos+5,13);
    else return 0;
}//
