(function($){$.browserTest=function(a,z){var u='unknown',x='X',m=function(r,h){for(var i=0;i<h.length;i=i+1){r=r.replace(h[i][0],h[i][1]);}return r;},c=function(i,a,b,c){var r={name:m((a.exec(i)||[u,u])[1],b)};r[r.name]=true;r.version=(c.exec(i)||[x,x,x,x])[3];if(r.name.match(/safari/)&&r.version>400){r.version='2.0';}if(r.name==='presto'){r.version=($.browser.version>9.27)?'futhark':'linear_b';}r.versionNumber=parseFloat(r.version,10)||0;r.versionX=(r.version!==x)?(r.version+'').substr(0,1):x;r.className=r.name+r.versionX;return r;};a=(a.match(/Opera|Navigator|Minefield|KHTML|Chrome/)?m(a,[[/(Firefox|MSIE|KHTML,\slike\sGecko|Konqueror)/,''],['Chrome Safari','Chrome'],['KHTML','Konqueror'],['Minefield','Firefox'],['Navigator','Netscape']]):a).toLowerCase();$.browser=$.extend((!z)?$.browser:{},c(a,/(camino|chrome|firefox|netscape|konqueror|lynx|msie|opera|safari)/,[],/(camino|chrome|firefox|netscape|netscape6|opera|version|konqueror|lynx|msie|safari)(\/|\s)([a-z0-9\.\+]*?)(\;|dev|rel|\s|$)/));$.layout=c(a,/(gecko|konqueror|msie|opera|webkit)/,[['konqueror','khtml'],['msie','trident'],['opera','presto']],/(applewebkit|rv|konqueror|msie)(\:|\/|\s)([a-z0-9\.]*?)(\;|\)|\s)/);$.os={name:(/(win|mac|linux|sunos|solaris|iphone)/.exec(navigator.platform.toLowerCase())||[u])[0].replace('sunos','solaris')};if(!z){$('html').addClass([$.os.name,$.browser.name,$.browser.className,$.layout.name,$.layout.className].join(' '));}};$.browserTest(navigator.userAgent);})(jQuery);

function getAddress(i1, i2, i3, t, c) {    
	var m = i1 + "@" + i2 + "." + i3;
	document.write("<" + "a h" + "re" + "f=\"m" + "ai" + "l" + "to:" + m + "\" ti" + "tle=\"" +  t +"\" cla" + "ss=\""+ c + "\">" + m + "</a>");
}

function getWindowDims() {
	var winDim = {width: 0,	height: 0};
	if (typeof(window.innerHeight) == "number") { //!IE
		winDim.width =  window.innerWidth;
		winDim.height = window.innerHeight;
	}
	else{
		if (document.documentElement && document.documentElement.clientHeight) { //IE 6+ in 'standards compliant mode'    
			winDim.width  = document.documentElement.clientWidth;
			winDim.height  = document.documentElement.clientHeight;
		}
		else{
			if( document.body && document.body.clientHeight) { //IE 4 compatible    
				winDim.width  = document.body.clientWidth;
				winDim.height  = document.body.clientHeight;				
			}
		}
	}
	return(winDim);
}

function delayTimer(delay){
     var timer;
     return function(fn){
          timer=clearTimeout(timer);
          if(fn)
               timer=setTimeout(function(){
               fn();
               },delay);
          return timer;
     }
}

var inputDelayer=delayTimer(500);

// THIS HELPS TO HIDE THE NAVIGATiON
$('html').addClass('js');

$(window).load(function(){
		var hm = $('#mid-col').height();
		var hr = $('#rt-col').height();	
		var h = 0;			
		h = (hr >= hm ? hr : hm) * 0.95; 
		$('.footercolumnspacer').height(h);	
		
	// CONTENT HEIGHT
/*	if($("#content").height() < 350){
		$("#content").height(350)
	}*/
		
		
});


$(document).ready(function() {
	// NAVIGATION ROLL DOWN
	var navigationHeight = $("#navigation").height();
	
	$('#navbar a').click(function(e){
			if(navigator.userAgent.search(/ipad/i) > 0) {
				e.preventDefault();
				
			}
			
	});
	


	$("#navigation").height(0).show();
	$("#navigationwrapper").hover(
		function(){
			$("#navigation").stop(true,false).animate({ height: navigationHeight  }, 400 );
		},
		function(){
			$("#navigation").stop(true,false).animate({ height: 0 }, 400 );
		}
	)

	$("div[class^='searchResultList']").click(function() {
		myR = this.id;
		myRShow = "#resultCat_" + myR.replace("MyCat", "");	
		
		$('.myresults').hide()
		$('.myresultsWorld').hide();
		$(myRShow).fadeIn('def');
		
	});

	$("div[class^='searchResultListWorld']").click(function() {
		myR = this.id;
		myRShow = "#resultWorldCat_" + myR.replace("MyCatWorld", "");	

		$('.myresults').hide()
		$('.myresultsWorld').hide();
		$(myRShow).fadeIn('def');
		
	});
	
});
