//1k DHTML API
// ----- 1. BROWSER DETECTION ----- //

var dyn = (document.all || document.layers || document.getElementById) ? true : false;

var ie = (navigator.appName.indexOf('Microsoft') != -1) ? true : false;
var ie4 = (ie && document.all && !document.getElementById) ? true : false;
var ie5 = (ie && document.getElementById && navigator.userAgent.indexOf('MSIE 6.0') == -1) ? true : false;
var ie6 = (ie && document.getElementById && !ie5) ? true : false;
var ie4Min = (ie4 || ie5 || ie6) ? true : false;
var ie5Min = (ie5 || ie6) ? true : false;
var ie6Min = ie6;

var ns = (navigator.appName.indexOf('Netscape') != -1) ? true : false;
var ns4 = (ns && document.layers) ? true : false;
var ns6 = (ns && document.getElementById) ? true : false;
var ns4Min = (ns4 || ns6) ? true : false;
var ns6Min = ns6;

// ----- 2. CURSOR ----- //

var cursorPageX, cursorPageY;
var cursorWinX, cursorWinY;

d=document;l=d.layers;op=navigator.userAgent.indexOf('Opera')!=-1;
function initbdfd() {
	initbd();
	initfd();
}
function initbd() {
	bd = parent.bodypart.document;
}
function initfd() {
	fd = parent.footerpart.document;
}
function initcd() {
	cd = parent.contents.document;
}
function hideCLayers(){
	var i;
	initcd();
	for(i=0;i<cln;i++){
		hE(getLayerObj(clayers[i],cd));
	}
}

function isBlank(STR) {
   if (dyn) {
      if (STR == null) STR = '';
      STR += '';
      STR = STR.replace(/^\s+|\s+$/g,'');
      return (STR == '') ? true : false;
      }
   }
function moveLayerTo(LAYEROBJ,LEFT,TOP) {
   if (ns4) {
      if (isBlank(LEFT)) LEFT = getLayerLeft(LAYEROBJ);
      if (isBlank(TOP)) TOP = getLayerTop(LAYEROBJ);
      LAYEROBJ.moveTo(LEFT,TOP);
      }
   else if (dyn) {
      if (!isBlank(LEFT)) LAYEROBJ.style.left = LEFT + 'px';
      if (!isBlank(TOP)) LAYEROBJ.style.top = TOP + 'px';
      }
   }

function getX(e) {
  if (dyn) {
      if (ie) {
         cursorWinX = e.clientX - 2;
         cursorPageX = cursorWinX + document.body.scrollLeft;
         }
      else {
         cursorPageX = e.pageX;
         cursorWinX = cursorPageX - window.pageXOffset;
         }
	return (cursorPageX);
}
}
function getY(e) {
  if (dyn) {
      	if (ie) {
         	cursorWinY = e.clientY - 2;
         	cursorPageY = cursorWinY + document.body.scrollTop;
	} else {
		cursorPageY = e.pageY;
         	cursorWinY = cursorPageY - window.pageYOffset;
	}
	return (cursorPageY);
  }
}
function mCE(l,ev, z) {
	var ex = 0;
	var ey = 0;
	if(ev) {
		ex = eval(getX(ev) + '+' + '4');
		ey = getY(ev);
//		ex = ev.layerX;
//		ey = ev.layerY;
	}
//	alert(z);
	moveLayerTo(l,30*z,ey);
	return l;
}
function mE(l,ev) {
	var ex = 0;
	var ey = 0;
	if(ev) {
		ex = eval(getX(ev) + '-' + '100');
		ey = getY(ev);
//		ex = ev.layerX;
//		ey = ev.layerY;
	}
	moveLayerTo(l,ex,0);
	return l;
}
function getLayerObj(LAYERID,dtbs) {
//      alert( parent);
//      alert( arguments[1]);
//	initbdfd();

   if(!dtbs) dtbs = document;
//   alert(dtbs);
   if (ie4) return dtbs.all[LAYERID];
   else if (ns4) {
      var tempLayerObj = null;
      //var tempParentObj = (arguments.length == 1) ? document : arguments[1];
      var tempParentObj = dtbs;
      for (var tempLayerLoop in tempParentObj.layers) {
         var tempObj = tempParentObj.layers[tempLayerLoop];
         var tempConstructor = tempObj.constructor + '';
         if (tempConstructor.indexOf('function Layer()') != -1) {
            if (tempLayerLoop == LAYERID) return tempObj;
            else if (tempObj.document.layers.length > 0) tempLayerObj = getLayerObj(LAYERID,tempObj);
            }
         }
      return tempLayerObj;
      }
   else if (dyn) return dtbs.getElementById(LAYERID);
}
function setLayerHTML(LAYEROBJ,STR) {
   if (navigator.userAgent.indexOf('MSIE 5.0') && navigator.userAgent.indexOf('Mac') != -1) STR += '\n';
   if (ns4) {
      LAYEROBJ.document.open();
      LAYEROBJ.document.write(STR);
      LAYEROBJ.document.close();
      }
   else if (dyn) LAYEROBJ.innerHTML = STR;
}
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;}
function sY(e,y){l?e.top=y:op?e.style.pixelTop=y:e.style.top=y;}
function sW(e,w){l?e.clip.width=w:op?e.style.pixelWidth=w:e.style.width=w;}
function sH(e,h){l?e.clip.height=h:op?e.style.pixelHeight=h:e.style.height=h;}
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+' '+r+' '+b+' '+x+')';}
function wH(e,h){if(l){Y=e.document;Y.open();Y.write(h);Y.close();}else if(e.innerHTML)e.innerHTML=h;}
function glowit(which){
	if (document.all.glowtext[which].filters[0].strength==3)
		document.all.glowtext[which].filters[0].strength=2
	else
		document.all.glowtext[which].filters[0].strength=3
}

function glowit2(which){
	if (document.all.glowtext.filters[0].strength==3)
		document.all.glowtext.filters[0].strength=2
	else
		document.all.glowtext.filters[0].strength=3
}

function startglowing(){
	if (document.all.glowtext&&glowtext.length){
		for (i=0;i<glowtext.length;i++)
			eval('setInterval("glowit('+i+')",250)')
	}
	else if (glowtext)
		setInterval("glowit2(0)",250)
}

if (document.all)
	window.onload=startglowing

