function showMask() {
	var maskHeight = $(document).height();
	var maskWidth = $(window).width();
	$('#mask').css({'width':maskWidth,'height':maskHeight});
	$('#mask').fadeTo(50,0);
}

$(window).resize(function() {
	var maskHeight = $(document).height();
	var maskWidth = $(window).width();
	$('#mask').css({'width':maskWidth,'height':maskHeight});	
});

$.fn.center = function(options) {
    var opt = { forceAbsolute: true,
                container: window
              };
    $.extend(opt, options);
   
    return this.each(function(i) {
        var el = $(this);
        var jWin = $(opt.container);
        var isWin = opt.container == window;

        if (opt.forceAbsolute) {
            if (isWin)
                el.remove().appendTo("body");
            else
                el.remove().appendTo(jWin.get(0));
        }

        el.css("position", "absolute");

        var heightFudge = 2.0; //isWin ? 2.0 : 1.8;

        var x = (isWin ? jWin.width() : jWin.outerWidth()) / 2 - el.outerWidth() / 2;
        var y = (isWin ? jWin.height() : jWin.outerHeight()) / heightFudge - el.outerHeight() / 2;

        el.css("left", x + jWin.scrollLeft()-9);
        el.css("top", y + jWin.scrollTop()-35);
    });
};

createXMLDocument = function(s) {
	var browserName = navigator.appName;
	var xmlDoc;
	if (browserName == "Microsoft Internet Explorer") {
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async = "false";
		xmlDoc.loadXML(s);
	} else {
		xmlDoc = (new DOMParser()).parseFromString(s, "text/xml");
	}
	return xmlDoc;
}
