// SiteHelm Menus, Version 1.0
// By David Leigh Christy
// www.dlchristy.com
//
// Derived from David Christy's SiteHelm, 
// a full-featured web site management system and CMS
// www.sitehelm.com
//
// JavaScript portion based on scripts by
// Project Seven, www.projectseven.com
//
// LICENSE:
// Copyright © 2004 David Leigh Christy
// All rights reserved.
// 
// Redistribution and use in source and binary forms,
// with or without modification, are permitted provided
// that the following conditions are met:
// 
// * Redistributions of source code must retain the above
//   copyright notice, this list of conditions and the
//   following disclaimer.
// * Redistributions in binary form must reproduce the above
//   copyright notice, this list of conditions and the 
//   following disclaimer in the documentation and/or other 
//   materials provided with the distribution.
// * Neither the name SiteHelm, David Leigh Christy, nor the 
//   names of its contributors may be used to endorse or
//   promote products derived from this software without
//   specific prior written permission.
// 
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

function ddMenu(menuID)
{
 this.menuID         = menuID;

 this.menuTimer      = null;
 this.hideFlag       = false;
 this.menusOn        = new Array();
 this.menuClasses    = new Array();
 this.menuImages     = new Array();
 this.menuPos        = new Array();

//Configuration
 this.nameItem       = 'Item';
 this.nameImage      = 'Image';
 this.nameMenu       = '';
 this.imageON        = '';
 this.imageEmptyON   = '';
 this.menuPos[1]     = new Array(0,20);

 this.showMenu          = ddMenu_showMenu;
 this.hideMenus         = ddMenu_hideMenus;
 this.autoLayers        = ddMenu_autoLayers;
 this.snap              = ddMenu_snap;

 this._doHideMenus      = ddMenu_doHideMenus;
 this._resetItems       = ddmenu_resetItems;
}
var hidden_inputs = new Array();
var dd_inputs = new Array();   // drop-down-boxes to be hidden in IE
var dd_objW = 0, dd_objH = 0,  // width and height of dd_obj
	  dd_objX = 0, dd_objY = 0;
	  var dd_db = (document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body? document.body : null,
dd_n = navigator.userAgent.toLowerCase();

// Browser flags
var dd_op = !!(window.opera && document.getElementById),
dd_op6 = dd_op && !document.defaultView,
dd_ie = dd_n.indexOf("msie") != -1 && document.all && dd_db && !dd_op,
dd_n4 = (document.layers && typeof document.classes != "undefined"),
dd_n6 = (!dd_op && document.defaultView && typeof document.defaultView.getComputedStyle != "undefined"),
dd_w3c = !dd_ie && !dd_n6 && !dd_op && document.getElementById;

dd_n = "";
function ddMenu_autoLayers() {
 var g,b,k,f,args=ddMenu_autoLayers.arguments,largs=new Array();
 a=parseInt(args[0]);
 if(isNaN(a))a=0;
 if(!document.p7setc){
  p7c=new Array();
  document.p7setc=true;
  for(var u=0;u<10;u++){
   p7c[u]=new Array();
  }
 }
 for(k=0;k<p7c[a].length;k++){
  if((g=ddMenu_findObj(p7c[a][k]))!=null){
  b=(document.layers)?g:g.style;
  b.visibility="hidden";
  //dd_ShowSelects();
  
  }
 }
 largs = (typeof args[1] == "object") ? args[1] : args;
 for(k=1;k<largs.length;k++){
  if((g=ddMenu_findObj(largs[k]))!=null){
   b=(document.layers)?g:g.style;
   b.visibility="visible";
  // alert(g.id+':'+b.visibility);
   /***********************************************
begin input mod
**********************************************/

  

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}
function widthTest(someObject){

      if (someObject.style.width){
         return someObject.style.width;
      }

      else if (someObject.style.pixelWidth){
        return  someObject.style.pixelWidth;
      }

      else if (someObject.offsetWidth){
         return  someObject.offsetWidth;
      }

      else if (document.defaultView && document.defaultView.getComputedStyle) {
          return document.defaultView.getComputedStyle(someObject,'').getPropertyValue('width');
      }

   }
function heightTest(someObject){

      if (someObject.style.height){
         return someObject.style.height;
      }

      else if (someObject.style.pixelHeight){
        return  someObject.style.pixelHeight;
      }

      else if (someObject.offsetHeight){
         return  someObject.offsetHeight;
      }

      else if (document.defaultView && document.defaultView.getComputedStyle) {
          return document.defaultView.getComputedStyle(someObject,'').getPropertyValue('height');
      }

   }
function dd_HideInput(b,g)
{
    // i don't know what this code does, so I'm taking it out
	if (!(dd_ie || dd_op6) || !dd_inputs) {
    
    return;
    }
	var t_o;
	var t_i = dd_inputs.length; while (t_i--)
	{
		t_o = dd_inputs[t_i];
        // If the tooltip is visible - dd_vis
        // If the tooltip X coordinate plus it's width
        // is greater than the t_o x value
        // If the tooltips X coordinate is less than
        // the t_o x value plus it's offsetWidth
        // If the 
        //alert(mit);
        
        //mdiv=ddMenu_findObj(mim); // this gets our obj
       // alert(mim);
        
        // check to see if object exists so we don't throw an error
        // then we check to see if the menu is visible or not
        var dd_x,dd_y,dd_b,dd_r;
        var t_o_x,t_o_y,t_o_b,t_o_r;
        
        dd_width=widthTest(g);
        dd_height=heightTest(g);
        to_width=widthTest(t_o);
        to_height=heightTest(t_o);
        
        dd_x=findPosX(g); // left side
        dd_y=findPosY(g); // top side
        dd_r=dd_x + dd_width; // right side
        dd_b=dd_y + dd_height; // bottom side
        
        
        
        dd_objW = parseInt(b.width);
		dd_objH = b.pixelHeight;
		
        t_o_x=findPosX(t_o);
        t_o_y=findPosY(t_o);
        t_o_b=t_o_y + to_height;
        t_o_r=t_o_x + to_width;
		
       // alert('w-'+to_height);
        
        if(b){
            if (b.visibility=='visible')dd_vis=true;
            else dd_vis=false;
        }
        
        // if all of these conditions exist they must overlap
		// dd_b < toy
        // dd_r > tox
        // dd_x < tor
        // dd_y > tob
        
        //alert (g.id+"( " + dd_vis + " && 1("+dd_b+" > "+t_o_y+") && 2("+dd_r+" < "+t_o_x+") && 3("+dd_x+" > "+t_o_r+") && 4("+dd_y+ "<" +t_o_b+"))"+"\r");
        
        if (dd_vis && (dd_b > t_o_y) && (dd_r > t_o_x) && (dd_x < t_o_r) && (dd_y < t_o_b))
        { 
			t_o.style.visibility = 'hidden';
            
        }
		//else t_o.style.visibility = 'visible';
	}
}

function dd_GetSelects()
{
	if (!dd_op6 && !dd_ie) return;
	var t_s = dd_op6? "input" : "select";
	if (document.all)
	{
		var t_i = document.all.tags(t_s).length; while (t_i--)
			dd_inputs[t_i] = document.all.tags(t_s)[t_i];
	}
	else if (document.getElementsByTagName)
	{
		var t_i = document.getElementsByTagName(t_s).length; while (t_i--)
			dd_inputs[t_i] = document.getElementsByTagName(t_s)[t_i];
	}
	var t_i = dd_inputs.length; 
    while (t_i--)
	{
		dd_inputs[t_i].x = 0;
		dd_inputs[t_i].y = 0;
		var t_o = dd_inputs[t_i];
		while (t_o)
		{
			dd_inputs[t_i].x += t_o.offsetLeft || 0;
			dd_inputs[t_i].y += t_o.offsetTop|| 0;
			 t_o = t_o.offsetParent;
			 
		}
	}
}


dd_GetSelects();
dd_HideInput(b,g);
/***********************************************
end input mod
**********************************************/

   f=false;
   for(var j=0;j<p7c[a].length;j++){
    if(largs[k]==p7c[a][j]) {
     f=true;
    }
   }
   if(!f){
    p7c[a][p7c[a].length++]=largs[k];
   }
  }
 }

}
function dd_HideInput()
{
    // i don't know what this code does, so I'm taking it out
	if (!(dd_ie || dd_op6) || !dd_inputs) {
    
    return;
    }
	var t_o;
	var t_i = dd_inputs.length; while (t_i--)
	{
		t_o = dd_inputs[t_i];
        
        
        t_o.style.visibility = 'visible';
	}
}
function ddMenu_snap() {
 var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,tw,q0,xx,yy,w1,pa='px',args=ddMenu_snap.arguments;a=parseInt(a);
 if(document.layers||window.opera){pa='';}for(k=0;k<(args.length);k+=4){
 if((g=ddMenu_findObj(args[k]))!=null){if((el=ddMenu_findObj(args[k+1]))!=null){
 a=parseInt(args[k+2]);b=parseInt(args[k+3]);x=0;y=0;ox=0;oy=0;p="";tx=1;
 da="document.all['"+args[k]+"']";if(document.getElementById){
 d="document.getElementsByName('"+args[k]+"')[0]";if(!eval(d)){
 d="document.getElementById('"+args[k]+"')";if(!eval(d)){d=da;}}
 }else if(document.all){d=da;}if(document.all||document.getElementById){while(tx==1){
 p+=".offsetParent";if(eval(d+p)){x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
 }else{tx=0;}}ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);tw=x+ox+y+oy;
 if(tw==0||(navigator.appVersion.indexOf("MSIE 4")>-1&&navigator.appVersion.indexOf("Mac")>-1)){
  ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);}else{
  w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
  x=document.body.scrollLeft+event.clientX+bx;y=document.body.scrollTop+event.clientY;}}
 }else if(document.layers){x=g.x;y=g.y;q0=document.layers,dd="";for(var s=0;s<q0.length;s++){
  dd='document.'+q0[s].name;if(eval(dd+'.document.'+args[k])){x+=eval(dd+'.left');y+=eval(dd+'.top');
  break;}}}e=(document.layers)?el:el.style;xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
 if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
  xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);}
 e.left=xx+pa;e.top=yy+pa;}}}
}

function ddMenu_hideMenus() {
  this.menuTimer = setTimeout(this.menuID+"._doHideMenus()", 800);
  this.hideFlag = true;
  //dd_ShowSelects();
  
}

function ddMenu_doHideMenus() {
  if (!this.hideFlag) return;
  this.autoLayers(0);
  this._resetItems();
  var b,g;
  dd_HideInput(b,g);
  
  
}

function ddmenu_resetItems() {
 var mit, mim;
 if (this.menusOn.length > 0) {
  for(key in this.menusOn) {
   mit = this.menuID + this.nameItem + this.menusOn[key];
   mim = this.menuID + this.nameImage + this.menusOn[key];
   if ( (h = ddMenu_findObj(mit) ) != null ) {
    h.className = this.menuClasses[key];
   }
   if ( this.menuImages[key] && (h = ddMenu_findObj(mim) ) != null ) {
    h.src = this.menuImages[key];
   }
  }
 }
}

function ddMenu_showMenu() {
  var bn, ml, mit, mim, mm, img, x=0, y=0, mex="", al, args=ddMenu_showMenu.arguments, bns=new Array(), bnsc=new Array(), bnsi=new Array(), menus=new Array();
// More Levels?
  ml =  args[0];
// Turn off all items
  this._resetItems();
// Build Menus
  al = args.length;
  for(k=1; k<al; k++) {
   bn = args[k];
   mex += "_" + bn;
   mit = this.menuID + this.nameItem + mex;
   mim = this.menuID + this.nameImage + mex;
   mm  = this.menuID + this.nameMenu + mex;
   if ( (g = ddMenu_findObj(mit) ) != null ) {
    bns[k]  = mex;    
    bnsc[k] = g.className;    
    g.className = bnsc[k] + "ON";
   }
   if (k<(al-1) || ml) {
    menus[k] = mm;
    if (this.menuPos[k]) {
     x=this.menuPos[k][0];
     y=this.menuPos[k][1];
    }
    this.snap(mim,mm,x,y);
    img=this.imageON;
   } else {
    img=this.imageEmptyON;
   }
   if ( img && (g = ddMenu_findObj(mim) ) != null ) {
    bnsi[k] = g.src;    
    g.src = img;
   }
  }
  this.menusOn     = bns;
  this.menuClasses = bnsc;
  this.menuImages  = bnsi;
  
  // Reset Menu Hiding
  if (this.menuTimer) {
   clearTimeout(this.menuTimer);
  }
  this.menuTimer = null;
  this.hideFlag  = false;

  if (menus.length > 0) {
   this.autoLayers(0, menus);
  } else {
   this.autoLayers(0);
  }
 
}

function ddMenu_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=ddMenu_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

// Browser Detect Lite  v2.1
// http://www.dithered.com/javascript/browser_detect/index.html
// modified by Chris Nott (chris@NOSPAMdithered.com - remove NOSPAM)
//
// modified by Michael Lovitt to include OmniWeb and Dreamcast

function BrowserDetectLite() {
	var ua = navigator.userAgent.toLowerCase(); 
	this.ua = ua;

	// browser name
	this.isGecko     = (ua.indexOf('gecko') != -1);
	this.isMozilla   = (this.isGecko && ua.indexOf("gecko/") + 14 == ua.length);
	this.isNS        = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) );
	this.isIE        = ( (ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1) ); 
	this.isOpera     = (ua.indexOf("opera") != -1); 
	this.isKonqueror = (ua.indexOf("konqueror") != -1); 
	this.isIcab      = (ua.indexOf("icab") != -1); 
	this.isAol       = (ua.indexOf("aol") != -1); 
	this.isWebtv     = (ua.indexOf("webtv") != -1); 
	this.isOmniweb   = (ua.indexOf("omniweb") != -1);
	this.isDreamcast   = (ua.indexOf("dreamcast") != -1);
	
	// spoofing and compatible browsers
	this.isIECompatible = ( (ua.indexOf("msie") != -1) && !this.isIE);
	this.isNSCompatible = ( (ua.indexOf("mozilla") != -1) && !this.isNS && !this.isMozilla);
	
	// browser version
	this.versionMinor = parseFloat(navigator.appVersion); 
	
	// correct version number for NS6+ 
	if (this.isNS && this.isGecko) {
		this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) );
	}
	
	// correct version number for IE4+ 
	else if (this.isIE && this.versionMinor >= 4) {
		this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
	}
	
	// correct version number for Opera 
	else if (this.isOpera) {
		if (ua.indexOf('opera/') != -1) {
			this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera/') + 6 ) );
		}
		else {
			this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera ') + 6 ) );
		}
	}
	
	// correct version number for Konqueror
	else if (this.isKonqueror) {
		this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) );
	}
	
	// correct version number for iCab 
	else if (this.isIcab) {
		if (ua.indexOf('icab/') != -1) {
			this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab/') + 6 ) );
		}
		else {
			this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab ') + 6 ) );
		}
	}
	
	// correct version number for WebTV
	else if (this.isWebtv) {
		this.versionMinor = parseFloat( ua.substring( ua.indexOf('webtv/') + 6 ) );
	}
	
	this.versionMajor = parseInt(this.versionMinor); 
	this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
	
	// platform
	this.isWin   = (ua.indexOf('win') != -1);
	this.isWin32 = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1) );
	this.isMac   = (ua.indexOf('mac') != -1);
	this.isUnix  = (ua.indexOf('unix') != -1 || ua.indexOf('linux') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1)
	
	// specific browser shortcuts
	this.isNS4x = (this.isNS && this.versionMajor == 4);
	this.isNS40x = (this.isNS4x && this.versionMinor < 4.5);
	this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7);
	this.isNS4up = (this.isNS && this.versionMinor >= 4);
	this.isNS6x = (this.isNS && this.versionMajor == 6);
	this.isNS6up = (this.isNS && this.versionMajor >= 6);
	
	this.isIE4x = (this.isIE && this.versionMajor == 4);
	this.isIE4up = (this.isIE && this.versionMajor >= 4);
	this.isIE5x = (this.isIE && this.versionMajor == 5);
	this.isIE55 = (this.isIE && this.versionMinor == 5.5);
	this.isIE5up = (this.isIE && this.versionMajor >= 5);
	this.isIE6x = (this.isIE && this.versionMajor == 6);
	this.isIE6up = (this.isIE && this.versionMajor >= 6);
	
	this.isIE4xMac = (this.isIE4x && this.isMac);
}
var browser = new BrowserDetectLite();

//---------------------------------------------------------------
// Opacity Displayer, Version 1.0
// Copyright Michael Lovitt, 6/2002.
// Distribute freely, but please leave this notice intact.
//---------------------------------------------------------------

//---------------------------------------------------------------
// OPACITY OBJECT
//
// Instantiates the object, defines the properties and methods.
function OpacityObject(divId, strPath) {
	this.id = divId;
	this.path = strPath;
	if (ns){
		if (browserVersion>=5) {
			this.layerObject = document.getElementById(divId).style;
		} else { 
			this.layerObject = eval("document."+divId);
		}
	} else {
		this.layerObject = eval(divId + ".style");
	}
	this.setBackground = od_object_setBackground;
}
// Uses AlphaImageLoader filter, or the css background property,
// as appropriate, to apply a PNG or GIF as the background of the layerObject.
function od_object_setBackground() {	
	if (pngAlpha) {
		this.layerObject.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.path+".png', sizingMethod='scale')";
	} else if (pngNormal) {
		this.layerObject.backgroundImage = 'url('+this.path+'.png)';
	} else {
		this.layerObject.backgroundImage = 'url('+this.path+'.gif)';
	}
}
//---------------------------------------------------------------

//---------------------------------------------------------------
// OPACITY DISPLAY FUNCTION
// Outputs the image as a div with the AlphaImageLoader, or with
// a standard image tag.
function od_displayImage(strId, strPath, intWidth, intHeight, strClass, strAlt) {	
	if (pngAlpha) {
		document.write('<div style="height:'+intHeight+'px;width:'+intWidth+'px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+strPath+'.png\', sizingMethod=\'scale\')" id="'+strId+'" class="'+strClass+'"></div>');
	} else if (pngNormal) {
		document.write('<img src="'+strPath+'.png" width="'+intWidth+'" height="'+intHeight+'" name="'+strId+'" border="0" class="'+strClass+'" alt="'+strAlt+'" />');
	} else {
		document.write('<img src="'+strPath+'.gif" width="'+intWidth+'" height="'+intHeight+'" name="'+strId+'" border="0" class="'+strClass+'" alt="'+strAlt+'" />');
	}
}
//---------------------------------------------------------------

//---------------------------------------------------------------
// OPACITY ROLL-OVER FUNCTIONS
function od_rollOver(strId, strColor) {	
	if (pngAlpha) {
		document.getElementById(strId).style.backgroundColor = strColor;
	} else {
	    if (document.images && (flag == true)) {
	        document[strId].src = eval(strId + "on.src");
	    }
	}
}
function od_rollOut(strId, strColor) {	
	if (pngAlpha) {
		document.getElementById(strId).style.backgroundColor = strColor;
	} else {
	    if (document.images) {
	        document[strId].src = eval(strId + "off.src");
	    }
	}
}
//---------------------------------------------------------------

//---------------------------------------------------------------
// global variables

// if IE5.5+ on win32, then display PNGs with AlphaImageLoader
if ((browser.isIE55 || browser.isIE6up) && browser.isWin32) {
	var pngAlpha = true;
	var strExt = ".png";
// else, if the browser can display PNGs normally, then do that. that list includes:
	//     -Gecko Engine: Netscape 6 or Mozilla, Mac or PC
	//     -IE5+ Mac (OpacityObject applies the background image at 100% opacity)
	//     -Opera 6+ PC
	//     -Opera 5+ Mac (Doesn't support dynamically-set background images)
	//     -Opera 6+ Linux 
	//     -Omniweb 3.1+ 
	//     -Icab 1.9+ 
	//     -WebTV 
	//     -Sega Dreamcast
} else if ((browser.isGecko) || (browser.isIE5up && browser.isMac) || (browser.isOpera && browser.isWin && browser.versionMajor >= 6) || (browser.isOpera && browser.isUnix && browser.versionMajor >= 6) || (browser.isOpera && browser.isMac && browser.versionMajor >= 5) || (browser.isOmniweb && browser.versionMinor >= 3.1) || (browser.isIcab && browser.versionMinor >= 1.9) || (browser.isWebtv) || (browser.isDreamcast)) {
	var pngNormal = true;
	var strExt = ".png";
	// otherwise, we use plain old GIFs
} else {
	var strExt = ".gif";
}

var ns = (document.all)?false:true;
var browserVersion = parseFloat(navigator.appVersion );
//---------------------------------------------------------------
