	function mouseX(event) {
		event = event || window.event;
		if (event.pageX) return event.pageX;
		if (event.clientX)
		   return event.clientX + (document.documentElement.scrollLeft ?
		   document.documentElement.scrollLeft :
		   document.body.scrollLeft);
		else return null;
	}
	function mouseY(event) {
		event = event || window.event;
		if (event.pageY) return event.pageY;
		if (event.clientY)
		   return event.clientY + (document.documentElement.scrollTop ?
		   document.documentElement.scrollTop :
		   document.body.scrollTop);
		else return null;
	}

	/*
	 * Pops up an infobox (appends div to document.body)
	 * style it with css class ".infobox"
	 *
	 * @param elementid			dom id for the infobox
	 * @param content			contents of the infobox
	 * @param x,y,width	position and dimensions (absoulute)	 *
	*/
	function createBox(elementid,content,x,y,width, display) {

		if(document.getElementById(elementid)){
			return false;
		}
	 	//postion: left of cursor, if there's enough place
	 	x = x - width;
		z = document.documentElement.scrollLeft ?
	 		document.documentElement.scrollLeft :
			document.body.scrollLeft;
		if ( x < z ) {
	 		x = z;
	 	}

	 	// +/-10: close-link should be right below cursor now
	 	//var dstyle = "position: absolute; top:" + (y-10) + "px; left:" + (x+10) + "px; width:" + width + "px; height:" + height + "px; background-color:#FF0000;";
	 	//var dstyle = "position: absolute; top:" + (y-10) + "px; left:" + (x+10) + "px; width:" + width + "%; height:" + height + "%;";
	 	var styleDisplay = '';
	 	if(display){
	 		var styleDisplay = 'display:' + display + ';';
	 	}
	 	var dstyle = "position: absolute; top:" + (y-10) + "px; left:" + (x+10) + "px; width:" + width + "px;" + styleDisplay;

	 	var infobox=document.createElement('div');
	 	infobox.setAttribute('id',elementid);

		var isIE = ( navigator.userAgent.match(/MSIE/) && !navigator.userAgent.match(/Opera/) );
	 	if (isIE) {
	 		infobox.setAttribute('className','widget');
	 		infobox.style.cssText = dstyle;
	 	} else {
	 		infobox.setAttribute('class','widget');
		    infobox.setAttribute('style',dstyle);
	 	}

		infobox.innerHTML=content;
	    document.body.appendChild(infobox);
	}

	function remove_div(elementid) {
		var el=document.getElementById(elementid);
		document.body.removeChild(el);
	}

	function toggle_display(obj, type) {

		var status = document.getElementById(obj).style.display;

	   	if (status == 'none') {
			document.getElementById(obj).style.display = type;
		}else{
			document.getElementById(obj).style.display = 'none';
		}
	}
	function toggle_class_name(obj, class1, class2) {

		var css_class = document.getElementById(obj).className;

	   	if (css_class == class1) {
			document.getElementById(obj).className = class2;
		}else{
			document.getElementById(obj).className = class1;
		}
	}

function ShowLightbox(){

	if($('lightbox')){

		var x = 0, y = 0;
		if( typeof( window.pageYOffset ) == 'number' ) {
			//Netscape compliant
		  	var y = window.pageYOffset;
		  	var x = window.pageXOffset;
		} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		  	//DOM compliant
		  	var y = document.body.scrollTop;
		  	var x = document.body.scrollLeft;
		} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		  	//IE6 standards compliant mode
		 	var y = document.documentElement.scrollTop;
		  	var x = document.documentElement.scrollLeft;
		}

		if($('lightbox-body')){
			//var top = y + 30;
			//alert(top);
			var top = y;
			//alert(top);
			$('lightbox-body').style.top = top + 'px';
		}

		Effect.Appear('lightbox');
	}
}

function HideLightbox(){

	if($('lightbox')){
		Effect.Fade('lightbox');
	}
}
