function slideUp(id)
{
	toggleOff(id); // deprecated
}
function fadeIn(id)
{
	toggleOn(id); // deprecated
}
function fadeOut(id)
{
	$('#' + id + '').fadeOut(200);
}
function toggleOff(id)
{
	var e = document.getElementById(id);
	e.style.display = "none";
}
function toggleOn(id)
{
	var e = document.getElementById(id);
	e.style.display = "";
}
function quickinfo(id)
{
	var winH = $(window).height();
	var winW = $(window).width();
	$('#' + id + '').css('top',  winH/2-$(id).height()/2);
	$('#' + id + '').css('left', winW/2-$(id).width()/2);
	$('#' + id + '').fadeIn(1000);
}
function highlight(id,flag,color)
{
	if(flag == 1) { 
		var target = document.getElementById(id);
		target.style.background = "#" + color + "";
	} else { 
	    var target = document.getElementById(id);
		target.style.background = "#fff";
	}	
}
function getAjax()
{
	var ajaxReq;
	try { // Firefox, Opera
	ajaxReq = new XMLHttpRequest();
	}
	catch (e) { // IE
	try{
	ajaxReq = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (e) {
	try{ 
	  ajaxReq = new ActiveXObject("Microsoft.XMLHTTP");
	  }
	catch (e) {
	  alert("The Web site does use JavaScript. Please enable JavaScript through your browser preferences.");
	  return false;
	  }
	}
	}	
	return ajaxReq;
}


function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}
