var user_agent = navigator.userAgent.toLowerCase()
var browserName = navigator.appName;
var dhtml         = null; 
var dhtml1        = null; 
var isOver        = true;
var isOver1       = true;
var myTimer = setTimeout("HideDHTML('DHTLMenu')",300);
var myTimer1 = setTimeout("HideDHTML('DHTLMenu1')",300);
var tempEl
var parentObj
var blinkTimer 

var dom = (document.getElementById)? true:false
var ns4 = (document.layers)? true:false
var ie4 = (document.all && !dom)? true:false
var mac = (user_agent.indexOf("mac")!=-1)? true:false

function PopUp() {
	clearTimeout(myTimer);
	var layHTML=''
	dhtml = findObj('DHTLMenu')
	items = arguments[0]
	parentObj = findObj(arguments[1])

	for (var i=0; i<items.length; i++)
	{
		layHTML += "<tr id='m_tr_ID"+i+"' class='hand' style='color:#333399; background:#CEEDFF; padding:5px 5px' "+
				   "onmouseOver=\"this.style.background='#82bbf3';"+( (items[i][1])?"PopUp1(items["+i+"][1],'m_tr_ID"+i+"')":"" )+"\""+
				   "onmouseOut=\"this.style.background='#CEEDFF'\" "+
				   "onclick='"+((items[i][1])?"dhtml1.style.visibility=\"hidden\"":"")+";dhtml.style.visibility=\"hidden\";location.href=\""+items[i][0][1]+"\"' "+
				   "><td "+((items[i][1])?"":"colspan='2'")+">"+items[i][0][0]+"</td>"+((items[i][1])?"<td align='right'>&raquo;</td>":"")+"</tr>"
	}		
	dhtml.innerHTML = "<table width='100%' background='#ABE5AA' cellspacing='0' cellpadding='4'>"+layHTML+"</table>"
	dhtml.onmouseover = OverDHTML;
	dhtml.onmouseout = OutDHTML;
	dhtml.style.left = getRealLeft(parentObj)
	dhtml.style.top = getRealTop(parentObj)+35
	OverDHTML();
	dhtml.style.visibility = "visible";
}
function OverDHTML() { 
	clearTimeout(myTimer); 
	isOver = true; 
}
function OutDHTML() { 
	clearTimeout(myTimer);
	isOver = false; 
	myTimer = setTimeout("HideDHTML('DHTLMenu')",300);
	OutDHTML1()
}
function HideDHTML(id) {
	if (!isOver) { 
		dhtml = findObj(id)
		dhtml.style.visibility = "hidden" 
	}
}

function PopUp1() {
	clearTimeout(myTimer1);
	var layHTML=''
	dhtml1 = findObj('DHTLMenu1')
	items1 = arguments[0]
	parentObj = findObj(arguments[1])

	for (var i=0; i<items1.length; i++)
	{
		layHTML += "<div class='hand' style='color:#333399; padding:5px 5px' onmouseOver=\"this.style.background='#CEEDFF'\""+
				   "onmouseOut=\"this.style.background='#CEEDFF'\" "+
				   "onclick='dhtml.style.visibility=\"hidden\";dhtml1.style.visibility=\"hidden\";location.href=\""+items1[i][1]+"\"' "+
				   ">"+items1[i][0]+"</div>"
	}		
	dhtml1.innerHTML = layHTML
	dhtml1.onmouseover = OverDHTML1;
	dhtml1.onmouseout = OutDHTML1;
	dhtml1.style.left = getRealLeft(parentObj)+parentObj.offsetWidth-30
	dhtml1.style.top = getRealTop(parentObj)
	OverDHTML1();
	dhtml1.style.visibility = "visible";
}
function OverDHTML1() { 
	clearTimeout(myTimer1); 
	isOver1 = true; 
	isOver = true; 
}
function OutDHTML1() { 
	clearTimeout(myTimer1);
	isOver1 = false; 
	isOver = false; 
	myTimer1 = setTimeout("HideDHTML1('DHTLMenu1')",300);
	myTimer = setTimeout("HideDHTML('DHTLMenu')",300);
}

function HideDHTML1(id) {
	if (!isOver1) { 
		dhtml = findObj(id)
		dhtml.style.visibility = "hidden" 
	}
}




function getRealLeft(imgElem){
	if(ns4){xPos=imgElem.x;}
	else if(!exclude){
		xPos=eval(imgElem).offsetLeft;
		tempEl=eval(imgElem).offsetParent;
		while(tempEl!=null){
			xPos+=tempEl.offsetLeft;
			tempEl=tempEl.offsetParent;
		}
	} if(mac&&ie5){
		xPos+=parseInt(document.body.leftMargin);
	}return xPos;
}
	
function getRealTop(imgElem){
	if(ns4){yPos=imgElem.y;}
	else if(!exclude){
		yPos=eval(imgElem).offsetTop;
		tempEl=eval(imgElem).offsetParent;
		while(tempEl!=null){
			yPos+=tempEl.offsetTop;
			tempEl=tempEl.offsetParent;
		}
	}if(mac&&ie5){
		yPos+=parseInt(document.body.topMargin);
	}return yPos;
}


preloadImages('pic/bg2_.gif')

function findObj(id) { 
	if (document.getElementById) {	
		return document.getElementById(id);
	} else if (document.all) {
		return document.all[id];
	}
}

function chgBack(id, v) {
	obj = findObj(id)
	obj.style.background = v
}

function preloadImages() {
  var d=document; 
  if(d.images){ 
	  if(!d.p) d.p=new Array();
		var i,j=d.p.length,a=preloadImages.arguments; 
			for(i=0; i<a.length; i++)
				if (a[i].indexOf("#")!=0){ 
					d.p[j]=new Image; d.p[j++].src=a[i];
				}
			}
}

function MyOpenWindow(h, w, cnt, caption) {
	str =	'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><title>-</title>'+
			'<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head>'+
			'<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">'+cnt+
			'<div style="height:33px; background:#D9D9D9; padding:5px; font: 10px Verdana,Tahoma,sans-serif; border-top:1px solid white" align="right">'+caption+'</div></body>'
	w = window.open('','','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+w+',height='+(h+33))
	w.document.write(str)
}

function DIV_block(name) {

	d = findObj(name).style.display;
	if (d!='block')
	{
		findObj(name).style.display = 'block';
	}
	else 
	{
		findObj(name).style.display = 'none';
	}

/*	if (o.style.display=='none')
	{
		o.style.display='block'
	}*/
//	(o.style.display!='none')?o.style.display='none':o.style.display='block'
}

function blinker() {
	clearTimeout(blinkTimer)
	obj = findObj('blink')
	obj.style.color='red'
	blinkTimer = setTimeout("cngColor()",200)
}
function cngColor() {
	clearTimeout(blinkTimer)
	obj = findObj('blink')
	obj.style.color = 'black'
	blinkTimer = setTimeout("blinker()",800)
}



//Specify the marquee's width (in pixels)

var marqueewidth=200

//Specify the marquee's height

var marqueeheight=20

//Specify the marquee's scroll speed (larger is faster)

var speed=5

//Specify the marquee contents

function scrollerDraw(txt_Scroll) { 
	document.write('<marquee direction="left" scrollAmount='+speed+' style="width:100%; height:'+marqueeheight+'px"><b>'+txt_Scroll+' • '+txt_Scroll+' • '+txt_Scroll+' • '+txt_Scroll+' • '+txt_Scroll+' • '+txt_Scroll+' • '+txt_Scroll+' • '+txt_Scroll+' • '+txt_Scroll+' • '+txt_Scroll+' • '+txt_Scroll+' • '+txt_Scroll+' • '+txt_Scroll+' • '+txt_Scroll+' • '+txt_Scroll+' • '+'</b></marquee>')
}