
jQuery(document).ready(function(){
	var p = getscriptpath("script.js");
	jQuery.get(p + "/get_twitter.php",null,function(data){
		jQuery("#twitfeed").html(data);
	});
	jQuery("#twitter").hover(function(){
		jQuery("#twitfeed").fadeIn(100);
	},
	function(){
		jQuery("#twitfeed").fadeOut(400);
	});
	jQuery("#twitfeed").hover(function(){
		jQuery("#twitfeed").fadeIn(1);
			},function(){
	 	jQuery("#twitfeed").fadeOut(100);
	});
	jQuery("#twitfeed").fadeOut(1);
	jQuery(".additional_description").slideUp(1);
});


function basename (path, suffix) {
    // Returns the filename component of the path  
    // 
    // version: 909.322
    // discuss at: http://phpjs.org/functions/basename
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Ash Searle (http://hexmen.com/blog/)
    // +   improved by: Lincoln Ramsay
    // +   improved by: djmix
    // *     example 1: basename('/www/site/home.htm', '.htm');
    // *     returns 1: 'home'
    var b = path.replace(/^.*[\/\\]/g, '');
    
    if (typeof(suffix) == 'string' && b.substr(b.length-suffix.length) == suffix) {
        b = b.substr(0, b.length-suffix.length);
    }
    
    return b;
}


function getscriptpath(scriptname){
		// Check document for our script
		scriptobjects = document.getElementsByTagName('script');
		for (i=0; i<scriptobjects.length; i++) {
			var sp = scriptobjects[i].src.split("?");
			if(basename(sp[0])==scriptname){
				// we found our script.. lets get the path
				return scriptobjects[i].src.substring(0, scriptobjects[i].src.lastIndexOf('/'));
			};
		}
		return "";
}


