function $() { return document.getElementById(arguments[0]); }

function addHandler(object, event, handler)
{
	if (object)
	{
		if (typeof(object.addEventListener) != 'undefined')
		{
			object.addEventListener(event, handler, false);
		}
		if (typeof(object.attachEvent) != 'undefined')
		{
			object.attachEvent('on' + event, handler);
		}
	}
}

function showhide(value)
{
	var d = $(value);
	d.style.display = (d.style.display == 'block') ? 'none' : 'block';
	return;
}

function getPage(value)
{
	document.location.href = value;
	return;
}

function fontSize(size) {
	switch (size){
		case -1:	$('ie6').className='ie6 smallfont'; break;
		case 0:		$('ie6').className='ie6 normalfont'; break;
		case 1:		$('ie6').className='ie6 bigfont'; break;
		}
	}


function bookmark() {
   var url = location.href;
   var title = document.title;
   if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) window
.sidebar.addPanel (title, url, "");
   else if (typeof window.external == "object") window.external.AddFavorite(url, title);
   else if (window.opera && document.createElement)
   {
   var a = document.createElement('A');
   if (!a) return false; //IF Opera 6
      a.setAttribute('rel','sidebar');
      a.setAttribute('href',url);
      a.setAttribute('title',title);
      a.click();
   }
      else return false;
  return true;
}


function popitup(url) {
	newwindow=window.open(url,'name','height=600,width=600,directories=no,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}

function fakepopup(url) {
	newwindow=window.open(url,'name','height=600,width=587,location=no,menubar=no,status=yes,toolbar=no,scrollbars=yes,resizable=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}

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);
}


