﻿        function NavigationHover() {
            $(varTreeView + " table td.sub_navi:not(.sub_navi_select)").hover(NavigationHover_In,
            NavigationHover_Out);
        }

        function NavigationHover_In() {
            $(this).addClass("sub_navi_hr");
            $(this).parent("tr").find("img").attr("src", "/Style library/AWQAF arabic/navigation/sub_navi_hr_header.gif");
        }

        function NavigationHover_Out() {
            $(this).removeClass("sub_navi_hr");
            $(this).parent("tr").find("img").attr("src", "/Style library/AWQAF arabic/navigation/sub_navi_header.gif");
        }

        function SelectedNavigation()  {
            //$(varTreeView + " table td.sub_navi").parent("tr").find("img").attr("src", "/Style library/AWQAF arabic/navigation/sub_navi_header.gif");
            $(varTreeView + " table td.sub_navi_select").parent("tr").find("img").attr("src", "/Style library/AWQAF arabic/navigation/sub_navi_select_header.gif");
            var oldScript = $(varTreeView + " table td.sub_navi_select").prev().find("a").attr("href");
            oldScript = oldScript + ";onPopulateNode();";
            $(varTreeView + " table td.sub_navi_select").prev().find("a").attr("href", oldScript);
        }
        
        function onPopulateNode()
        {
        setTimeout('bindChangeImage()', 200);
        }

        function bindChangeImage() {
            $(varTreeView + " table td.sub_navi_select").parent("tr").find("img").attr("src", "/Style library/AWQAF arabic/navigation/sub_navi_select_header.gif");
            var oldScript = $(varTreeView + " table td.sub_navi_select").prev().find("a").attr("href");
            oldScript = oldScript + ";changeImage();";
            $(varTreeView + " table td.sub_navi_select").prev().find("a").attr("href", oldScript);
            changeImage();
			setTimeout('changeImage()',100);
			setTimeout('changeImage()',200);
        }

        function changeImage() {
            $(varTreeView + " table td.sub_navi_select").parent("tr").find("img").attr("src", "/Style library/AWQAF arabic/navigation/sub_navi_select_header.gif");
        }
        
		function AddNoExpandImage() {
            $(varTreeView + " table td.sub_navi:not(.sub_navi_select)").parent("tr").find("img").attr("src", "/Style library/AWQAF arabic/navigation/sub_navi_header.gif");
            setTimeout('$(varTreeView + " table td.sub_navi:not(.sub_navi_select)").parent("tr").find("img").attr("src", "/Style library/AWQAF arabic/navigation/sub_navi_header.gif");',200);
        }
        
        function BindAddNoExpandImageScript() {
             $(varTreeView + " table td.sub_navi:not(.sub_navi_select)").prev().find("a").each(function() {
             var oldScript = $(this).attr("href");
             oldScript = oldScript + ";AddNoExpandImage();";
             $(this).attr("href", oldScript);
            });
        } 
        
		function TopNavigationHover() {
            $("#TopNavigation td.CommonBt").hover(TopNavigationHover_In, TopNavigationHover_Out);
			$("#TopNavigation td.homeBt").hover(TopNavigationHover_In, TopNavigationHover_Out);
        }

        function TopNavigationHover_In() {
			if ($(this).attr("class") == "CommonBt") {
            $(this).removeClass("CommonBt");
            $(this).addClass("CommonBt_hr");
            }
            else
            {
            $(this).removeClass("homeBt");
            $(this).addClass("homeBt_hr");
            }
        }

        function TopNavigationHover_Out() {
        	if ($(this).attr("class") == "CommonBt_hr") {
            $(this).removeClass("CommonBt_hr");
            $(this).addClass("CommonBt");
            }
            else {
            $(this).removeClass("homeBt_hr");
            $(this).addClass("homeBt");
            }

        } 
        function CAB_DataBind()
        {
        var emptyTitle = new Array();
        emptyTitle[0] = "&nbsp; ";
        emptyTitle[1] = '<DIV id=cabTitleTarget></DIV>';
        var emptyBody = new Array();
        emptyBody[0] = "<DIV dir=None></DIV>&nbsp; ";
        emptyBody[1] = '<DIV id=cabBodyTarget></DIV>';
        
        var title = $("#CABTitle").html()
        var body = $("#CABBody").html()

                
        if (title == emptyTitle[0] || title == emptyTitle[1]  || title == "" || title == null || body == emptyBody[0] || body == emptyBody[1] || body == "" || body == null )
        {
			return;
        }
        $("span.popupText_hading").html(title);
        $("#CABTitle").html("");
        
        $("span.popupText").html(body);
		$("#CABBody").html("")
       	$("#CAB").show();
        
        }

