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)+'_o.'+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);  
}

divover="#FFC600";
color=["#AFB0B3","#FFD16F","#FFE0A8"];
subdivcolor1="#d6dbe7"; // Subdiv non active color
subdivcolor3="#d6dbe7"; // Subdiv active color

function hilitediv(myobj,mode,level){
  if(mode==0){
    name="";
  }
  if(mode==1){
    name="template-menu"+(level+1)+"-o";
    try{ myobj.style.cursor="pointer"; } catch (a){}
    try{ myobj.style.cursor="hand"; } catch (a){}
  }
  if(mode==3){
    name="";
  }
  myobj.className=name;
}

/* What it is ? */
subdivcolor2="green";
subdivcolor4="yellow";
subdivcolor5="black";
subdivcolor6="cyan";

function hilitesubdiv(myobj,mode){
/*  kids = myobj.childNodes;
  if(mode==0){
    color1=subdivcolor1;
    color2=subdivcolor2;
  }
  if(mode==1){
    color1=subdivcolor3;
    color2=subdivcolor4;
    try{ myobj.style.cursor="pointer"; } catch (a){}
    try{ myobj.style.cursor="hand"; } catch (a){}
  }
  if(mode==3){
    color1=subdivcolor5;
    color2=subdivcolor6;
  }
  for(var i=0; i<kids.length; i++){
    if(kids[i].nodeName=='TD'){
      kids[i].style.backgroundColor=color1;
    }
  }*/
}

function opendiv(id){
	var display='none';
	with(document.getElementById("subdiv"+id)){
		if(innerHTML!='<TD></TD>' && (style.display=='none' || style.display=='')) 
			display=(is.ie4)?'block':'table-row';
		style.display=display;
	}
}

function OpenImg(src, width, height, target, scrollbars)
{
 format=src.substr(src.length-3,src.length);
 win=window.open('',target,'width='+width+',height='+height+',hotkeys=1,resizable=yes,scrollbars='+scrollbars);
 win.document.write('<html><head></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.focus();
 win.document.close();
}
