
function CLMF(){	
		
	//dodawanie 'cienia' do textow pod ie (nie obsluguje 'text-shadow')	
	this.jsShadow = function(elem){
	    var elemColor;
		$(elem).each(function(){
			$(this).addClass('jsShadow').append('<em>' + $(this).html() + '</em>');
		});
};
	
	this.imageBoxIeFix = function(){		
		if($('.imageBox')){
			var imageWidth = $('.imageBox img').eq(0).width();
			$('.imageBox').width(imageWidth);
		}
	};
	
	this.menuActive = function(elem){
	    $('.mainMenu .'+elem).addClass('active');	  
	}
	
	this.pagination = function(){
	    if('.container .content .pagination li'){
	        $('.container .content .pagination li:first').addClass('first');
	    }
	}
	
};

var clmf = new CLMF();

$('document').ready(function(){

	if ($.browser.msie && ($.browser.version <= 6)) {
	    clmf.imageBoxIeFix();	    
	}	
	
	if ($.browser.msie) {
	    clmf.jsShadow($('.rightCol .whiteBox h3, #homepage .newsBox h4, .rightCol .artistInfo h5.concertInfo'));    
	}	
	
	clmf.pagination();
	
});


String.prototype.IsNullOrEmptyOrUndefined = function() {
    if (this == undefined || this == null || this == '')
        return true;
    else
        return false;
}

function IsNullOrEmptyOrUndefined(object) {
    if (object == undefined || object == null || object == '')
        return true;
    else
        return false;
}

function Format(text) {
    for (i = 1; i < arguments.length; i++) {
        text = text.replace('{' + (i - 1) + '}', arguments[i]);
    }
    return text;
}

function CreateCookie(cookieName, cookieValue) {
    CreateCookie(cookieName, cookieValue, 0);
}

function CreateCookie(cookieName, cookieValue, expiresInDays) {
    if (expiresInDays > 0) {
        var expiresDate = new Date();
        expiresDate.setTime(expiresDate.getTime() + (expiresInDays * 24 * 60 * 60 * 1000));
        document.cookie = Format('{0}={1}; expires={2}; path=/', cookieName, cookieValue, expiresDate.toGMTString());
    }
    else
        document.cookie = Format('{0}={1}; path=/', cookieName, cookieValue);
}

function EraseCookie(cookieName) {
    var expiresDate = new Date();

    document.cookie = Format('{0}={1}; expires={2}; path=/', cookieName, '', expiresDate.toGMTString());
}

function ReadCookie(cookieName) {
    var nameEQ = cookieName + "=";
    var cookies = document.cookie.split(';');

    for (var i = 0; i < cookies.length; i++) {
        while (cookies[i].charAt(0) == ' ')
            cookies[i] = cookies[i].substring(1, cookies[i].length);

        if (cookies[i].indexOf(nameEQ) == 0)
            return cookies[i].substring(nameEQ.length, cookies[i].length);
    }
    return null;
}