﻿
Cufon.replace('div.buzzwords p');
$("html").addClass("JS")

$(function(){
	Cufon.now();
	$(".buzzwords").fadeIn()	
	// search field nicer (more style in the future)
	$("#topSearch label:first").hide()
	var searchText = $("#topSearch label:first").text();
	$("#topSearch input:first").val(searchText);
	$("#topSearch input:first").focus(function(){
		if($(this).val() == searchText){
			$(this).val("")
		}
	});
	$("#topSearch input:first").blur(function(){
		if(jQuery.trim($(this).val()) == ""){
			$(this).val(searchText)
		}
	});
	
	
	// links to new windows and popups
	$("a[rel=external]").attr("title",windowTitle);
	$("a[rel=external]").attr("target","_blank");
	$("a[rel=popup]").attr("title",popupTitle);
	$("a[rel=popup]").click(function(){
		theHref = $(this).attr("href");
		$(this).attr("href","javascript:void(0)");
		var popupWidth, popupHeight
		var relSplit = $(this).attr("rel").split("|");
		if(relSplit[1]){
			popupWidth = relSplit[1];
			popupHeight = relSplit[2];
		} else {
			popupWidth = 435;
			popupHeight = 350;
		}
		popMeUp(theHref,popupWidth,popupHeight)
		
		
		
	});	
	
	
	$("abbr[title]").each(function(){
		$(this).css("position","relative");
		$(this).append("<span>" + $(this).attr("title") + "</span>");
		$(this).attr("title","")
		$("span",this).css("position","absolute");
		$("span",this).css("background","#EEC");
		$("span",this).css("border","1px solid #ddb");
		$("span",this).css("position","absolute");
		$("span",this).css("right","-1em");
		$("span",this).css("top","1.7em");
		$("span",this).css("z-index","3");
		$("span",this).css("width","17em");
		$("span",this).css("padding","0.2em 1em");	
		$("span",this).hide();
		$(this).hover(function(){
			$("span",this).fadeIn("200");
			$(this).css("z-index","2");
		},function(){
			$("span",this).fadeOut("400");
			$(this).css("z-index","1");
		})

	})
})


// functions

function popMeUp(strURL,strWidth,strHeight) {
	theWin = window.open(strURL, 'popupWin', "scrollbars,resizable,height=" + strHeight + ",width=" + strWidth);
	theWin.focus()
}
