/*
 | Browser object
 */
function yg_Browser() {
 d=document;
 this.agt=navigator.userAgent.toLowerCase();
 this.major=parseInt(navigator.appVersion);
 this.dom=( _proxy_jslib_handle(d, 'getElementById', '', 0, 0));
 this.ns=(d.layers);
 this.ns4up=(this.ns && this.major>=4);
 this.ns6=(this.dom&&navigator.appName=="Netscape");
 this.op=(window.opera);
 if(d.all)this.ie=1;else this.ie=0;
 this.ie4=(d.all&&!this.dom);
 this.ie4up=(this.ie&&this.major>=4);
 this.ie5=(d.all&&this.dom);
 this.ie6=(d.nodeType);
 this.sf=(this.agt.indexOf("safari")!=-1);
 this.win=((this.agt.indexOf("win")!=-1)||(this.agt.indexOf("16bit")!=-1));
 this.winme=(this.agt.indexOf("win 9x 4.90")!=-1);
 this.xpsp2=(this.agt.indexOf("sv1")!=-1);
 this.mac=(this.agt.indexOf("mac")!=-1);
}
var oBw=new (yg_Browser)();

// like to optimize this further
function yg_getObj(id,d) {
  var i,x;  if(!d) d=document; 
  if(!(x= _proxy_jslib_handle(d, (id), 0, 0))&&d.all) x= _proxy_jslib_handle(d.all, (id), 0, 0); 
  for (i=0;!x&&i<d.forms.length;i++) x= _proxy_jslib_handle(d.forms[(i)], (id), 0, 0);
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=yg_getObj(id,d.layers[(i)].document);
  if(!x &&  _proxy_jslib_handle(document, 'getElementById', '', 0, 0)) x= _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(id); 
  return x;
}

/* begin new */
function yg_getH(o) { return (oBw.ns)?((o.height)?o.height:o.clip.height):((oBw.op&&typeof o.style.pixelHeight!='undefined')?o.style.pixelHeight:o.offsetHeight); }
function yg_setH(o,h) { if(o.clip) o.clip.height=h; else if(oBw.op && typeof o.style.pixelHeight != 'undefined') o.style.pixelHeight=h; else o.style.height=h; }
function yg_getW(o) { return (oBw.ns)?((o.width)?o.width:o.clip.width):((oBw.op&&typeof o.style.pixelWidth!='undefined')?w=o.style.pixelWidth:o.offsetWidth); }
function yg_setW(o,w) { if(o.clip) o.clip.width=w; else if(oBw.op && typeof o.style.pixelWidth != 'undefined') o.style.pixelWidth=w; else o.style.width=w; }
function yg_getX(o) { return (oBw.ns)?o.left:((o.style.pixelLeft)?o.style.pixelLeft:o.offsetLeft); }
function ylib_setX(o,x) {
	if (oBw.ns) { 
		o.left=x;
	} else if (typeof o.style.pixelLeft != 'undefined') {
		o.style.pixelLeft=x;
	} else {
		thisPos = parseInt(x);			// preventing NS UNcaught Exception Error in strict.dtd mode: converting value to integer in case passed as string
		thisPos += "px";
		o.style.left = thisPos;
	}
}

function yg_getY(o) { return (oBw.ns)? _proxy_jslib_handle(o, 'top', '', 0, 0):((o.style.pixelTop)?o.style.pixelTop:o.offsetTop); }
function ylib_setY(o,y) {
	if (oBw.ns) {
		 _proxy_jslib_assign('', o, 'top', '=', (y));
	} else if (typeof o.style.pixelTop != 'undefined') {
		o.style.pixelTop=y;
	} else {
		thisPos = parseInt(y);			// preventing NS UNcaught Exception Error in strict.dtd mode: converting value to integer in case passed as string
		thisPos += "px";
		 _proxy_jslib_assign('', o.style, 'top', '=', ( thisPos));
	}
}

function yg_getPageX(o) { var x=0; if(oBw.ns) x=o.pageX; else { while(eval(_proxy_jslib_proxify_js((o), 0, 0) )) { x+=o.offsetLeft; o=o.offsetParent; } } return x; }
function yg_getPageY(o) { var y=0; if(oBw.ns) y=o.pageY; else { while(eval(_proxy_jslib_proxify_js((o), 0, 0) )) { y+=o.offsetTop; o=o.offsetParent; } } return y; }
function yg_getZ(o) { return (oBw.ns)?o.zIndex:o.style.zIndex; }
/* end new */

function yg_moveTo(o,x,y) { yg_setX(o,x);yg_setY(o,y); }
function yg_moveBy(o,x,y) { yg_setX(o,yg_getPageX(o)+x);yg_setY(o,yg_getPageY(o)+y); }

function yg_setZ(o,z) { if(oBw.ns)o.zIndex=z;else o.style.zIndex=z; }

function yg_setClip(o) { }

function yg_show(o,disp) { 
 (oBw.ns)? '':(!disp)? o.style.display="inline":o.style.display=disp;
 (oBw.ns)? o.visibility='show':o.style.visibility='visible';  
}
function yg_hide(o,disp) { 
 (oBw.ns)? '':(arguments.length!=2)? o.style.display="none":o.style.display=disp;
 (oBw.ns)? o.visibility='hide':o.style.visibility='hidden';  
}

function yg_setStyle(o,s,v) { if(oBw.ie5||oBw.dom) eval(_proxy_jslib_proxify_js(("o.style."+s+" = '" + v +"'"), 0, 0) ); }
function yg_getStyle(o,s) { if(oBw.ie5||oBw.dom) return eval(_proxy_jslib_proxify_js(("o.style."+s), 0, 0) ); }

function yg_getDocW() { }
function yg_getDocH() { }

function yg_addEvt(o,e,f,c) { if(o.addEventListener)o.addEventListener(e,f,c);else if(o.attachEvent)o.attachEvent("on"+e,f);else eval(_proxy_jslib_proxify_js(("o.on"+e+"="+f), 0, 0) )}

function yg_writeHTML(o,h) { 
 if(oBw.ns){var doc=o.document; _proxy_jslib_handle(doc, 'write', '', 1, 0)(h); _proxy_jslib_handle(doc, 'close', '', 1, 0)();return false;}
 if( _proxy_jslib_handle(o, 'innerHTML', '', 0, 0)) _proxy_jslib_assign('', o, 'innerHTML', '=', (h)); 
}

// w - beforeBegin,afterBegin,beforeEnd,afterEnd
// width - for ns 4 only
function yg_insertHTML(o,h,w) {
 if (oBw.op) return;
 if ( _proxy_jslib_handle(o, 'insertAdjacentHTML', '', 0, 0)) { 
   _proxy_jslib_handle(o, 'insertAdjacentHTML', '', 1, 0)(w,h);
  return;
 }
 if (oBw.ns) {
  yg_writeHTML(o,h);
  return;
 }
 // mozilla
 var r = o.ownerDocument.createRange();
	r.setStartBefore(o);
	var frag = r.createContextualFragment(h);
	yg_insertObj(o,w,frag)
}


function yg_insertObj(o,w,node) {
	switch (w){
	case 'beforeBegin':
		o.parentNode.insertBefore(node,o)
 break;
	case 'afterBegin':
		o.insertBefore(node,o.firstChild);
		break;
	case 'beforeEnd':
		o.appendChild(node);
		break;
	case 'afterEnd':
		if (o.nextSibling){
			o.parentNode.insertBefore(node,o.nextSibling);
		} else {
			o.parentNode.appendChild(node)
 }
		break;
	}
}
 ;
_proxy_jslib_flush_write_buffers() ;