// cross navigator functions
	
var isIE =  ((navigator.userAgent.indexOf("MSIE") > -1) ? true : false);
var isMac =  ((navigator.userAgent.indexOf("Mac") > -1) ? true : false);
var isGecko = ((navigator.userAgent.indexOf("Gecko") > -1) ? true : false);

var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
var isDyn = (isDOM || isIE4 || isNS4);

function getTag(id){
 if (isDOM) return document.getElementById(id);
 if (isIE4) return document.all[id];
 if (isNS4) return document.layers[id];
}

function getTagStyle(id){
 return (isNS4 ? getTag(id) : getTag(id).style);
} 

//*****************************************************************
// pop up
//*****************************************************************

function openNewWindow(URLtoOpen, windowName, windowFeatures) {
	if (windowFeatures.search(/scrollbars/) == -1) {
		windowFeatures = windowFeatures + ",scrollbars=0";
	}
	if (windowFeatures.search(/toolbar/) == -1) {
		windowFeatures = windowFeatures + ",toolbar=0";
	}
	if (windowFeatures.search(/titlebar/) == -1) {
		windowFeatures = windowFeatures + ",titlebar=0";
	}
	if (windowFeatures.search(/status/) == -1) {
		windowFeatures = windowFeatures + ",status=0";
	}
	if (windowFeatures.search(/resizable/) == -1) {
		windowFeatures = windowFeatures + ",resizable=0";
	}
	if (windowFeatures.search(/location/) == -1) {
		windowFeatures = windowFeatures + ",location=0";
	}
	if (windowFeatures.search(/left/) == -1) {
		windowFeatures = windowFeatures + ",left=30";
	}
	if (windowFeatures.search(/top/) == -1) {
		windowFeatures = windowFeatures + ",top=50";
	}
	window.open(URLtoOpen, windowName, windowFeatures); 
}
//*************************************************************

//*****************************************************************
// tooltip
//*****************************************************************

this.tooltip = function(){	
	/* CONFIG */		
		xOffset = -10;
		yOffset = 20;		


	$("a.tooltip").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		$("#tooltip").remove();
    });	
	$("a.tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};



// starting the script on page load
$(document).ready(function(){
	tooltip();
});

