$(document).ready(function() {

	// top hover menu
	$('#dropDown li.headlink').hover(
		function() {
			$('a[class=headlinkTitle]', this).addClass('headlinkActive');
			$('ul', this).css('display', 'block'); 
		},
		function() {
			$('#dropDown li.headlink a').removeClass('headlinkActive');
			$('ul', this).css('display', 'none');
		}
	);


	// top hover menu
	$('#userMenu li.headlink').hover(
		function() {
			$('a[class=headlinkTitle]', this).addClass('headlinkActive');
			$('ul', this).css('display', 'block'); 
		},
		function() {
			$('#userMenu li.headlink a').removeClass('headlinkActive');
			$('ul', this).css('display', 'none');
		}
	);
	


	//eXtended fadeTo because of MSIE 7 ClearType font issue
	jQuery.fn.XfadeTo = function(speed,to,callback) {
	    return this.animate({opacity: to}, speed, function() {
	        if (to == 1 && jQuery.browser.msie)
	            this.style.removeAttribute('filter');
	        if (jQuery.isFunction(callback)) 
	            callback();
	    });
	};

});

function number_format( number, decimals, dec_point, thousands_sep ) 
{
    // http://kevin.vanzonneveld.net
    // +   original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +     bugfix by: Michael White (http://crestidg.com)
    // +     bugfix by: Benjamin Lupton
    // +     bugfix by: Allan Jensen (http://www.winternet.no)
    // +    revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
    // +     bugfix by: Howard Yeend
    // *     example 1: number_format(1234.5678, 2, '.', '');
    // *     returns 1: 1234.57     
 
    var n = number, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals;
    var d = dec_point == undefined ? "." : dec_point;
    var t = thousands_sep == undefined ? "," : thousands_sep, s = n < 0 ? "-" : "";
    var i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0;
    
    return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
}


function getCookie(c_name) 
{
	if (document.cookie.length > 0) {
  		c_start = document.cookie.indexOf(c_name + "=")
  		if (c_start != -1) { 
		    c_start = c_start + c_name.length + 1;
		    c_end = document.cookie.indexOf(";", c_start);
    		if (c_end == -1) c_end = document.cookie.length;
    		return unescape(document.cookie.substring(c_start,c_end));
    	} 
  	}
	return '';
}

function setCookie(c_name, value, expireDate) 
{
	document.cookie = c_name + "=" + escape(value) + ((expireDate == null) ? '' : ";expires=" + expireDate.toGMTString());
}