document.getElementsByClassName = function (needle)
{
  var         my_array = document.getElementsByTagName("*");
  var         retvalue = new Array();
  var        i;
  var        j;

  for (i = 0, j = 0; i < my_array.length; i++)
  {
    var c = " " + my_array[i].className + " ";
    if (c.indexOf(" " + needle + " ") != -1)
      retvalue[j++] = my_array[i];
  }
  return retvalue;
}
function addEvent(obj, evType, fn)
{
	if (obj.addEventListener)
	{
		obj.addEventListener(evType, fn, true);
		return true;
	} 
	else if (obj.attachEvent)
	{
		var r = obj.attachEvent("on"+evType, fn);
		return r;
	} 
	else 
	{
		return false;
	}
}

function HelpHover()
{
	if(this._hoverContents)
	{
		this._mousePosX = 0;
		this._mousePosY = 0;
		this._hoverItem = null;
		this._hoverContents = null;
	}
}

HelpHover.prototype.init = function()
{
	var hh = this;
	var helpItems = document.getElementsByClassName('hasHelp');
	for (var i=0; i<helpItems.length; i++)
	{
		helpItems[i].onmousemove = function(e)
		{
			if (!e) var e = window.event;
			if (e.pageX || e.pageY)
			{
				hh.mousePosX = e.pageX;
				hh.mousePosY = e.pageY;
			}
			else if (e.clientX || e.clientY)
			{
			//tricky part, added by me
				if (typeof document.body.style.maxHeight != "undefined") {
				  // IE 7, mozilla, safari, opera 9
					hh.mousePosX = e.clientX + document.documentElement.scrollLeft;
					hh.mousePosY = e.clientY + document.documentElement.scrollTop;
				} else {
				  // IE6, older browsers
					hh.mousePosX = -9000;
					hh.mousePosY = -9000;
				}

			}
			hh._hoverItem = this;
			hh._hoverContents = document.getElementById(this.id+'Help');
			hh.move();
		}
		helpItems[i].onmouseout = function (e)
		{
			hh.out();
		}
	}
}  

HelpHover.prototype.out = function()
{
	if(this._hoverContents)
	{
		this._hoverContents.style.top = -10000+'px';
		this._hoverContents.style.left = -10000+'px';
		this._hoverItem = null;
		this._hoverContents = null;
	}
}

HelpHover.prototype.move = function()
{
	this._hoverContents.style.top = this.mousePosY+10+'px';
	this._hoverContents.style.left = this.mousePosX-180+'px';
	//alert(this._hoverContents.style.width);
	//this._hoverContents.style.left = this.mousePosX-this._hoverContents.style.width+'px';
}

addEvent(window, 'load', function()
{
	var hh = new HelpHover();
	hh.init();
});




function addFav(title, url) {
	if (document.all)
		window.external.AddFavorite(url, title);
	else if (window.sidebar)
		window.sidebar.addPanel(title, url, "")
}



 function CreateBookmarkLink(title,url) {

  // Blogger - Replace with <$BlogItemTitle$> 
  // MovableType - Replace with <$MTEntryTitle$>

  // Blogger - Replace with <$BlogItemPermalinkURL$> 
  // MovableType - Replace with <$MTEntryPermalink$>
  // WordPress - <?php bloginfo('url'); ?>

	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
 }
 
 
function checkform ( form )
{

  // ** START **
  if (form.searchString.value == "") {
    alert( "Please input something to search for..." );
    form.searchString.focus();
    return false ;
  }
  if (form.searchString.value == "input something to search for") {
    alert( "Please input something to search for..." );
    form.searchString.focus();
    return false ;
  }
  // ** END **
  
  return true ;
}

function emailCheck (emailStr) {
	var x = emailStr;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)) return true;
	else return false;
}



// MANAGE BREAKING OUT OF FRAMES
if (parent.frames.length > 0) 
{
parent.location.href = location.href;
}
// MANAGE BREAKING OUT OF FRAMES