$(document).ready(
	function () {
	    //fixPNG();
	    initMainMenu();
	    initTopMenu();
	    CaseStudyMenu();
	}
);

function fixPNG(){
	if($(".png").length>0){
		DD_belatedPNG.fix('.png');
	}
}

function initMainMenu(){
	$("ul.mainmenu").children().hover(
		function(){
			$(this).addClass("shover");
		},
		function(){
			$(this).removeClass("shover");
		}
	);
}

function initTopMenu() {
    $("ul.topmenu").children().hover(
		function () {
		    $(this).addClass("shover");
		},
		function () {
		    $(this).removeClass("shover");
		}
	);
}


function ClearText(textbox, text) {
    if (textbox.value == text) {
        textbox.value = "";
    }
}

function PopulateText(textbox, text) {
    if (textbox.value == "") {
        textbox.value = text;
    }
}

function CaseStudyMenu() {
        //hide the all of the element with class msg_body
        $(".msg_body").hide();
        //toggle the componenet with class msg_body
        $(".msg_head").click(function () {
            //alert($(this).parent().next(".msg_body"));
            $(this).parents(".cols01").next(".msg_body").slideToggle(600);
            //alert($(".OpenCloseImage").attr("src"));
            //alert($(this).children(".OpenCloseImage").attr("src"));
            //$(this).next(".OpenCloseImage").attr("src", "/assets/img/open.gif")
            //$(".OpenCloseImage").attr("src", "/assets/img/open.gif")
            if ($(this).attr("src") == "/assets/img/open.gif") {
                $(this).attr("src", "/assets/img/close.gif")
            } else {
                $(this).attr("src", "/assets/img/open.gif")
            }
        });
}
