var Browsers = {
	Other	: 0,
	Gecko	: 1,
	MSIE		: 2,
	Opera	: 3
}


var browser = Browsers.Other;
    
if (window.opera) {
    browser = Browsers.Opera;
} else if (navigator.userAgent.match(/Gecko/)) {
    browser = Browsers.Gecko;
} else if(window.clipboardData) {
    browser = Browsers.MSIE;
}

//------------------------------------------------------------------------------
function ExtendClass(superClass, baseClass) // {{{
{
    function inheritance() {}
    inheritance.prototype = baseClass.prototype;
    superClass.prototype = new inheritance();
    superClass.prototype.constructor = superClass;
} // }}}

//------------------------------------------------------------------------------
//  DomNode $(id)
//  Return dom node by id.  
//------------------------------------------------------------------------------
function $(id)
{
    return document.getElementById(id);
}

function registerStartupFunction(func) {
	
	var currentOnLoadFunc = window.onload;
	
	if (! window.onload) {
		window.onload = func;
	} else {
		window.onload = function() {
			currentOnLoadFunc();
			func();
		}
	}
}

///////////////////////////////////////////////////////////////////////////////////////

//	Get absolute left of object
//
function getAbsoluteLeft( obj ) {
	objLeft = obj.offsetLeft;
	while( obj.offsetParent != null) {
		objParent = obj.offsetParent;
		objLeft += objParent.offsetLeft;
		obj = objParent;
	}
	return objLeft;
}

//	Get absolute top of object
//
function getAbsoluteTop( obj ) {
     objTop = obj.offsetTop;
     while( obj.offsetParent != null) {
          objParent = obj.offsetParent;
          objTop += objParent.offsetTop;
          obj = objParent;
     }
     return objTop;
}


//function resizeText( multiplier ) {
 // if (document.body.style.fontSize == "") {
 //   document.body.style.fontSize = "95%";
 // }
 // document.body.style.fontSize = parseFloat( document.body.style.fontSize ) + ( multiplier * 4 ) + '%';
//}



function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else var expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

function eraseCookie(name) {
  createCookie(name,"",-1);
}

function resizeText( multiplier ){   
  var fontSize = "95%";
     
  if( readCookie( 'site_font_size' ) ) {
    fontSize = readCookie('site_font_size');   
  }   
  
  fontSize = parseFloat( fontSize ) + (multiplier * 4 ) + "%";   
  
  document.body.style.fontSize = fontSize;    
  
  var myCookie = createCookie('site_font_size', fontSize, 365 );
  
  
   
} 

