﻿$(document).ready(function() {
    Cufon.replace('.rightColumnHl');
    Cufon.replace('#centerColumnContentContainer h1');
    Cufon.replace('h2.az');
});

$(window).load(function() {
    $('.pagecontent_3').cycle({
		fx: 'fade'
	});
});

//Comments
function saveComment_Callback(res) {
    if (res.error != null) {
        $("#statusBox").msgbox({ msg: res.error.Message, type: "error", time: 3000 });
    } else {
        var cssClass = "";
        if (res.value["Counter"] == 0) {
            cssClass = "commentItem even";
        } else {
            cssClass = "commentItem uneven";
        }
        $("#statusBox").msgbox({ msg: "Tak for din mmentar", tkoype: "success", time: 3000 });
        $(".commentContainer").append(
            $("<div>")
            .addClass(cssClass)
            .append(
                $("<div>")
                .addClass("commentLeft")
                .html(res.value["Name"] + "<br />" + res.value["DateCreated"])
            )
            .append(
                $("<div>")
                .addClass("commentRight")
                .html(res.value["Comment"])
            ).append(
                $("<div>")
                .addClass("clear")
            )
        );
    }
}