// 1k DHTML API - standards version
d=document;l=d.layers;op=navigator.userAgent.indexOf('Opera')!=-1;px='px';
function gE(e,f){if(l){f=(f)?f:self;var V=f.document.layers;if(V[e])return V[e];for(var W=0;W<V.length;)t=gE(e,V[W++]);return t;}if(d.all)return d.all[e];return d.getElementById(e);}
function sE(e){l?e.visibility='show':e.style.visibility='visible';}
function hE(e){l?e.visibility='hide':e.style.visibility='hidden';}
function sZ(e,z){l?e.zIndex=z:e.style.zIndex=z;}
function sX(e,x){l?e.left=x:op?e.style.pixelLeft=x:e.style.left=x+px;}
function sY(e,y){l?e.top=y:op?e.style.pixelTop=y:e.style.top=y+px;}
function sW(e,w){l?e.clip.width=w:op?e.style.pixelWidth=w:e.style.width=w+px;}
function sH(e,h){l?e.clip.height=h:op?e.style.pixelHeight=h:e.style.height=h+px;}
function sC(e,t,r,b,x){l?(X=e.clip,X.top=t,X.right=r,X.bottom=b,X.left=x):e.style.clip='rect('+t+px+' '+r+px+' '+b+px+' '+x+px+')';}
function wH(e,h){if(l){Y=e.document;Y.open();Y.write(h);Y.close();}if(e.innerHTML)e.innerHTML=h;}

//added by Infinite Reality
//get clip
function gC(elem)
{
	return elem.coords.split(",");	
}

function gVis(e)
{
return l?(e.visibility=='show'):(e.style.visibility=='visible');

}

//get event element
function gEvtE(evt)
{
	evt = (evt) ? evt : event;
	return (evt.target) ? evt.target : evt.srcElement;
}

//get element ID
function gEname(e)
{
	return e.id;
}

//add

function getW(e){

    if (e.style.width)
      return(e.style.width);
    else
      return(e.offsetWidth);
		 
}
function getH(e){

    if (false && e.style.height)
      return(e.style.height);
    else
      return(e.offsetHeight);

}

function setOp(el,opacity)
{
    if (browser.isIE)
    {
    	el.style['filter'] = 'alpha(opacity: ' + opacity + ')';
    }else
    if (browser.isGecko)
    {
    	//el.style['MozOpacity'] = opacity / 100;
	el.style.setProperty("-moz-opacity", opacity / 100, "");
    }else
    {
    	el.style['KhtmlOpacity'] = opacity;
    	el.style['opacity'] = opacity;
    }

/*	if (el.filters)
	if( el.filters.alpha ) {
			el.filters.alpha.opacity = opacity;
	}
	if (!document.all && el.style.setProperty) el.style.setProperty("-moz-opacity", opacity / 100, "");
*/
}




function getMouseXY(e)
{
// www.quirksmode.org
    var point = { x: 0, y: 0 };
    //alert(evt);
    
	if (!e) var e = window.event;
	if (e.pageX || e.pageY)
	{
		point.x = e.pageX;
		point.y = e.pageY;
	}
	else if (e.clientX || e.clientY)
	{
		point.x = e.clientX + document.body.scrollLeft;
		point.y = e.clientY + document.body.scrollTop;
	}
	
//    point.x = evt.clientX,
//    point.y = evt.clientY;
    //point.x = evt.pageX;
    //point.y = evt.pageY;
    return point;
}

//Stolen from Netscape DevEdge; Modified

function getPageXY(elm)
{
  var point = { x: 0, y: 0 };
  while (elm)
  {
    point.x += elm.offsetLeft;
    point.y += elm.offsetTop;
    elm = elm.offsetParent;
  }
  return point;
}

function setPageXY(elm, x, y)
{
  var parentXY = {x: 0, y: 0 };

  if (elm.offsetParent)
  {
    parentXY = getPageXY(elm.offsetParent);
  }

  elm.style.left = (x - parentXY.x ) + 'px';
  elm.style.top  = (y - parentXY.y ) + 'px';
}
//-------------------------------------------------------------------------------------
// className functions
// Dean Edwards 2004.10.24

function addClass(element, className) {

    if (!hasClass(element, className)) {
        if (element.className) element.className += " " + className;
        else element.className = className;
    }
};

function removeClass(element, className) {
    var regexp = new RegExp("(^|\\s)" + className + "(\\s|$)");
    element.className = element.className.replace(regexp, "$2");
};

function hasClass(element, className) {
    var regexp = new RegExp("(^|\\s)" + className + "(\\s|$)");
    return regexp.test(element.className);
};
//-------------------------------------------------------------------------------------
function MXtoggle(e)
{
	if (e.expcol != true)
	{
		e.mxexpand = e.style.display;
		e.expcol = true;
		e.style.display = "none";
	}else
	{		
		e.expcol = false;
		e.style.display = e.mxexpand;		
	}
	
	
}
//-------------------------------------------------------------------------------------
function MXcollapse(e)
{
	if (e.expcol != true)
	{
		MXexpcol(e);
	}
	e.style.display = "none";
}
function MXexpand(e)
{
	e.style.display = e.mxexpand;
}
function MXexpcol(e)
{
	e.mxexpand = e.style.display;
	e.expcol = true;
}
//-------------------------------------------------------------------------------------
function MXfindparent(e,tagname)
{
	if (!browser.isDOM1)
	{
		return false;
	}
	var parent = e.parentNode;
	if (parent.nodeName == tagname)
	{
		return parent;
	}else{
		return MXfindparent(parent,tagname);
	}	
}
//-------------------------------------------------------------------------------------
function MXqform(qob)
{
    els = qob._fields;
    
	//alert(els.length);    
    
    for (ti=0;ti<els.length;ti++) {
        el = els[ti];
        ff = qob._pointers[el.toLowerCase()];
        e = gE(el);
        if (e)
        {
        	ff.description = e.description;
       		//alert( ff.description);
       	}
    }
	
}
//-------------------------------------------------------------------------------------
function MXparseDate(strD)
{
	//only for date format: 2004-08-15
	//new Date(y, m, d, hr, min, 0)	
	var dat = strD.split(" ");
	var pieces = dat[0].split("-");
	var y = pieces[0];
	var m = pieces[1] - 1;	
	var d = pieces[2];	
	
	var pieces = dat[1].split(":");
	var H = pieces[0];
	var M = pieces[1];
	
	
	return new Date(y, m, d, H, M, 0);
}
//-------------------------------------------------------------------------------------
// Browser Detect Lite  v2.1.4
// http://www.dithered.com/javascript/browser_detect/index.html
// modified by Chris Nott (chris@NOSPAMdithered.com - remove NOSPAM)
//-------------------------------------------------------------------------------------
function BrowserDetectLite() {
   var ua = navigator.userAgent.toLowerCase(); 

   // browser name
   this.isGecko     = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -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.isSafari    = (ua.indexOf('safari') != - 1);
   this.isOpera     = (ua.indexOf('opera') != -1); 
   this.isKonqueror = (ua.indexOf('konqueror') != -1 && !this.isSafari); 
   this.isIcab      = (ua.indexOf('icab') != -1); 
   this.isAol       = (ua.indexOf('aol') != -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
   if (this.isNS && this.isGecko) {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) );
   }
   else if (this.isIE && this.versionMinor >= 4) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
   }
   else if (this.isMozilla) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) );
   }
   else if (this.isSafari) {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) );
   }
   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 ) );
      }
   }
   else if (this.isKonqueror) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) );
   }
   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 ) );
      }
   }
   
   this.versionMajor = parseInt(this.versionMinor); 
   this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
	//  GECKO REVISION
	this.geckoRevision = -1;
	if (this.isGecko) {
		temp = ua.split("rv:");
		this.geckoRevision = parseFloat(temp[1]);
	}
   
   // dom support
   this.isDOM1 = (document.getElementById);
   this.isDOM2Event = (document.addEventListener && document.removeEventListener);
   
   // css compatibility mode
   this.mode = document.compatMode ? document.compatMode : 'BackCompat';

   // 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 || ua.indexOf('xp') != -1) );
   this.isMac   = (ua.indexOf('mac') != -1);
   this.isUnix  = (ua.indexOf('unix') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1)
   this.isLinux = (ua.indexOf('linux') != -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.isNS7x = (this.isNS && this.versionMajor == 7);
   this.isNS7up = (this.isNS && this.versionMajor >= 7);
   
   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.isIE55up = (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();

