if(document.getElementById) document.write('<style type="text/css">TR.subdiv{display:none }</style>');
var is = new Is();
function Is(){
  this.agent=navigator.userAgent.toLowerCase();
  this.opera = (this.agent.indexOf('opera')!=-1) ? true:false;
  this.ie4 = ((this.agent.indexOf('msie')!=-1) && (this.agent.indexOf('opera')==-1)) ? true:false;
  this.ns6 = ((this.agent.indexOf('gecko')!=-1) && (this.agent.indexOf('opera')==-1)) ? true:false;
  this.ns4 = ((this.agent.indexOf('mozilla')!=-1) && (this.agent.indexOf('opera')==-1) && (this.agent.indexOf('msie')==-1) && (this.agent.indexOf('gecko')==-1)) ? true:false;
}

function SwapImage(id,mode){
  var img = document.images[id].src;
  if(mode==1) document.images[id].src=img.substr(0,img.length-4)+'_a.'+img.substr(img.length-3,img.length);
  if(mode==0) document.images[id].src=img.substr(0,img.length-6)+'.'+img.substr(img.length-3,img.length);  
}

/* menu */
var t=null; 
var oni=""; 
var onj="";
var path="";
var hiding=false;
var pad_v=5;
var pad_h=10;

function GetWindowWidth(){
	return((is.ie4)? document.body.clientWidth: window.innerWidth);
}

function SetTimer(){ 
	StopTimer();
	t = setTimeout('HideMenu()', 500);
}

function StopTimer(){
if(t!=null){ 
	clearTimeout(t);
	t=null;
}
return (true);
}

function HideMenu(){
if(t!=null) StopTimer();
if(oni!=""){
	if(onj!="")DeSelect(oni,onj);
	if (path!=""){
		arr1=path.split("_");
		var tohide=arr1[0];
		for (k=1;k<arr1.length;k++){
			tohide=tohide+"_"+arr1[k];
			HideNext(tohide);
		}
		document.getElementById("s"+arr1[0]).style.visibility='hidden';
		document.getElementById("m"+arr1[0]).firstChild.style.color='#344C64';
		path="";
	}else{
		document.getElementById("s"+oni).style.visibility='hidden';
		document.getElementById("m"+oni).firstChild.style.color='#344C64';
	}
	oni="";
}
}

function ShowNext(elid){
	var arr=elid.split("_");
	arr.length=arr.length-1;
	//var temp=arr.pop();
	s_obj=document.getElementById("s"+arr.join("_"));
	var t1=s_obj.offsetTop+document.getElementById("t"+elid).offsetTop;
	if (t1-1<parseInt(s_obj.style.top))
		t1=t1+1;
	var l1=s_obj.offsetLeft+s_obj.offsetWidth-1;
	var winwid=GetWindowWidth();
	var subwid=document.getElementById("t"+elid).offsetWidth;
	if (l1+subwid>winwid){
		l1=l1-document.getElementById("s"+elid).offsetWidth-subwid+2+pad_h*2;
		//t1+=document.getElementById("t"+elid).offsetHeight;
	}
	with(document.getElementById("s"+elid).style){
		top=t1-1+pad_v;
		left= l1-pad_h;
		visibility="visible";
		path=elid;
	}
}

function HideNext(id){
	if ((obj=document.getElementById("s"+id)) && !hiding){
		hiding=true;
		obj.style.visibility='hidden';
		if (path.search("_")){
			arr=path.split("_");
			//arr.pop();
			arr.length=arr.length-1;
			path=arr.join("_")
		}
		hiding=false;
	}
}

function ShowMenu(id){
StopTimer();
if(oni!=id) {
	HideMenu();
	var winwid=GetWindowWidth();
	var subwid=document.getElementById("t"+id).offsetWidth;
	var menu_height=document.getElementById("tsub").offsetHeight;
	var height2menu=document.getElementById("menu2").offsetTop+1;
	with (document.getElementById("m"+id)){
	    try{ style.cursor="pointer"; } catch (a){}
	    try{ style.cursor="hand"; } catch (a){}
		firstChild.style.color="#344C64";
		//var l = offsetLeft-1;
		var l = offsetLeft-6;
		var t = height2menu+menu_height;
		var w=offsetWidth;
		if (l+subwid>winwid-(is.ns6?10:0)){
			//l=winwid-subwid-5;
			l=winwid-subwid-(is.ns6?30:10);
		}
		if (l<0)
			l=0;

	}
	//if (id==1)
		//l=l-document.getElementById("t"+id).offsetWidth+document.getElementById("m"+id).offsetWidth+1;
	with(document.getElementById("t"+id)){
		//width=w+12;
		width=w+23;
	}
	with(document.getElementById("s"+id).style){
		top=t-1;
		left= l;
		visibility="visible";
	}
	oni=id; 
	onj="";
}
}	

function DeSelect(i,j){
with(document.getElementById("t"+i+"_"+j).style){
	backgroundColor="#FAD164";
	//color='#344C64';
}
//onj=0;
}

function HideSequence(first,last){
	rest=last.substr(first.length+1);
	var ar=rest.split("_");
	for(var k=0;k<ar.length;k++){
		first=first+"_"+ar[k];
		HideNext(first);
	}
}
function Select(i,j){
if ((oni!="") && (onj!="")) DeSelect(oni,onj);
with(document.getElementById("t"+i+"_"+j).style){
    try{ cursor="pointer"; } catch (a){}
    try{ cursor="hand"; } catch (a){}
	backgroundColor='#6292E9';
	//color="#4C4CB2";
}
if (i==oni && j==onj)
	return "";
/*if (onj==j && i!=oni+"_"+onj){
	HideNext(path);
}else if (onj!=j && oni+"_"+j!=path){
	HideNext(oni+"_"+onj);
}*/
oni=oni.toString();
ar1=oni.split("_");
ar2=i.split("_");
if (ar1.length-ar2.length>0){
	//ar1.pop();
	HideSequence(i,path);
}else if (oni==i && path!=oni && i+"_"+j!=path){
	HideNext(path);
}
onj=j;
oni=i;
}

function GoTo(url,target){
	if (url!=''){
		if (target!='')
			window.open(url);
		else
			window.location=url;
	}
}

function OpenImg(src, width, height, target, scrollbars,title)
{
 format=src.substr(src.length-3,src.length);
 if (title!=undefined)
 	title="<title>"+title+"</title>";
 else
 	title="";
 win=window.open('',target,'screenX='+Math.floor((screen.availWidth-width)/2)+', screenY='+Math.floor((screen.availHeight-height)/2)+', left='+Math.floor((screen.availWidth-width)/2)+', top='+Math.floor((screen.availHeight-height)/2)+', width='+(width)+',height='+(height)+',hotkeys=1,resizable=yes,scrollbars='+scrollbars);
 win.document.write('<html><head>'+title+'</head><body marginwidth=0 marginheight=0 style="margin:0 0 0 0; padding:0 0 0 0;">');
 if(format!="swf") win.document.write('<IMG src="'+src+'" alt="" width="'+width+'" height="'+height+'">');
 else win.document.write('<OBJECT  classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" HEIGHT="'+height+'" WIDTH="'+width+'"><PARAM NAME=movie VALUE="'+src+'"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE="#FFFFFF"><EMBED  src="'+src+'" quality=high  HEIGHT="'+height+'" WIDTH="'+width+'"    TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>');
 win.document.write("</body></html>");
 win_height=((is.ie4)? document.body.clientHeight: window.innerHeight);
 if (height>win_height)
 	win.resizeTo(width,win_height);
 win.focus();
 win.document.close();
}

