function mainmenu(){
$(" #nav ul ").css({display: "none"}); // Opera Fix
$(" #nav li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(400);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
}

 
 
 $(document).ready(function(){					
	mainmenu();
});

//(function($) {
//    $(document).ready(function() {
//        jQuery('table.tb1 tbody tr:odd').addClass('odd');
//        jQuery('table.tb1 tbody tr:even').addClass('even');

//        $("#lay").find("ul ul a.parent").each(function() {
//            var $_marginLeft = $(this).parent("li").width();
//            $(this).next("ul").css({ left: $_marginLeft, top: 0 });
//        })
//        $("#lay ul a.parent").parent().hover(function() {
//            $(this).find("a.parent").next("ul:first").show();
//        }, function() {
//            $(this).find("a.parent").next("ul:first").hide();
//        })


//        function getCookie(c_name) {
//            if (document.cookie.length > 0) {
//                c_start = document.cookie.indexOf(c_name + "=");
//                if (c_start != -1) {
//                    c_start = c_start + c_name.length + 1;
//                    c_end = document.cookie.indexOf(";", c_start);
//                    if (c_end == -1) c_end = document.cookie.length;
//                    return unescape(document.cookie.substring(c_start, c_end));
//                }
//            }
//            return "";
//        }

//        function setCookie(c_name, value, expiredays) {
//            var exdate = new Date();
//            exdate.setDate(exdate.getDate() + expiredays);
//            document.cookie = c_name + "=" + escape(value) +
//		((expiredays == null) ? "" : ";expires=" + exdate.toGMTString());
//        }

//        var sitefunctions = {
//            textresize: function() {
//                // show text resizing links
//                var $cookie_name = "AGCFontSize";
//                var originalFontSize = jQuery("body").css("font-size");
//                // if exists load saved value, otherwise store it
//                if (getCookie($cookie_name)) {
//                    var $getSize = getCookie($cookie_name);
//                    jQuery("body").css({ fontSize: $getSize + ($getSize.indexOf("px") != -1 ? "" : "px") }); // IE fix for double "pxpx" error
//                } else {
//                    setCookie($cookie_name, originalFontSize);
//                }
//                // reset link
//                jQuery(".m").bind("click", function() {
//                    jQuery("body").css("font-size", originalFontSize);
//                    setCookie($cookie_name, originalFontSize);
//                });
//                // text Inc++
//                jQuery(".l").click(function() {

//                    var currentFontSize = jQuery("body").css("font-size");
//                    var currentFontSizeNum = parseFloat(currentFontSize, 10);
//                    if (currentFontSizeNum < 18) {
//                        var newFontSize = currentFontSizeNum * 1.1;
//                        if (newFontSize, 11) {
//                            jQuery("body").css("font-size", newFontSize);
//                            setCookie($cookie_name, newFontSize);
//                        }
//                    }
//                    return false;
//                });
//                jQuery(".s").bind("click", function() {
//                    var currentFontSize = jQuery("body").css("font-size");
//                    var currentFontSizeNum = parseFloat(currentFontSize, 10);
//                    if (currentFontSizeNum > 9) {
//                        var newFontSize = currentFontSizeNum * 0.9;
//                        if (newFontSize, 11) {
//                            jQuery("body").css("font-size", newFontSize);
//                            setCookie($cookie_name, newFontSize);
//                        }
//                    }
//                    return false;
//                });
//            }
//        }

//        //TABLE
//        $(".SERIS_dashboardPanel table tbody tr:odd").addClass("alt");


//        //If the User resizes the window, adjust the #container height
//        $(window).bind("resize", resizeWindow);
//        resizeWindow();
//        function resizeWindow(e) {
//            var newWindowHeight = $(window).height();
//            $(".sub_left").css("min-height", newWindowHeight - 220);
//            //$(".sub2_contentLeft").css("min-height", newWindowHeight - 220);
//        }

//        //ACCORDION for LEft Navigation
//        $(".accordion_link > li").each(function() {
//            if ($("ul", this).length > 0) {
//                $("ul", this).parent().addClass("parent");
//                $("ul", this).addClass("submenu");
//                //$("ul",this).addClass("submenu").css({width:$(this).parent().innerWidth()})
//                $("ul", this).hide();
//            }
//        })

//        $('.accordion_link .parent > a').click(function() {
//            $(this).css('outline', 'none');
//            if ($(this).parent().hasClass("active")) {
//                $(this).next(".submenu").animate({ height: "toggle" }, 750, "easeInQuad");
//                $(this).parent().removeClass("active");
//            }
//            else {
//                $(this).parent().siblings(".active").find(".submenu").animate({ height: "toggle" }, 750, "easeInQuad");
//                $(this).next(".submenu").animate({ height: "toggle" }, 750, "easeOutQuad");
//                $(this).parent().siblings(".active").removeClass("active");
//                $(this).parent().addClass("active");
//            }
//            return false;
//        });

//        //ACCORDION for QUICK LINKS

//        //ACCORDION for LEft Navigation
//        $(".AGC_homeQuickLinks ul > li").each(function() {

//            if ($("ul", this).length > 0) {
//                $("ul", this).parent().addClass("parent");
//                $("ul", this).addClass("submenu");
//                //$("ul",this).addClass("submenu").css({width:$(this).parent().innerWidth()})
//                $("ul", this).hide();
//            }
//        })

//        $('.AGC_homeQuickLinks .parent > a').click(function() {
//            $(this).css('outline', 'none');
//            if ($(this).parent().hasClass("active")) {
//                $(this).next(".submenu").animate({ height: "toggle" }, 750, "easeInQuad");
//                $(this).parent().removeClass("active");
//            }
//            else {
//                $(this).parent().siblings(".active").find(".submenu").animate({ height: "toggle" }, 750, "easeInQuad");
//                $(this).next(".submenu").animate({ height: "toggle" }, 750, "easeOutQuad");
//                $(this).parent().siblings(".active").removeClass("active");
//                $(this).parent().addClass("active");
//            }
//            return false;
//        });

//        //ACCORDION FOR CONTENTS.....
//        //STARTING
//        $('.AGC_accordion h3:gt(0)').each(function() {
//            $(this).next().hide();
//        });
//        $('.AGC_accordion h3:first').addClass("active");
//        $('.AGC_accordion h3').click(function() {
//            if ($(this).hasClass("active")) {
//                $(this).next("div.AGC_accordionContents").animate({ height: "toggle" }, 750, "easeInQuad");
//                $(this).removeClass("active");
//            }
//            else {
//                $(this).parent().siblings().find("h3.active").next().animate({ height: "toggle" }, 750, "easeInQuad");
//                $(this).next("div.AGC_accordionContents").animate({ height: "toggle" }, 750, "easeOutQuad");
//                $(this).parent().siblings().find("h3.active").removeClass("active");
//                $(this).addClass("active");
//            }
//            return false;
//        });

//        sitefunctions.textresize();

//    })
//})(jQuery)


function Clickheretoprint() {

    var disp_setting = "toolbar=yes,location=no,directories=yes,menubar=yes,";
    disp_setting += "scrollbars=yes,width=700, height=600, left=100, top=25";
    
    var content_vlue = "";
    var layout="";
    
    if (jQuery(".sub_right").remove(".backtotop").html() != null)
    {
        content_vlue = jQuery(".sub_right").remove(".backtotop").html().trim();

        var content_header = jQuery(".sub_right h1").html();
        layout="sr";
    }
    else if (jQuery(".rss_left").remove(".backtotop").html() != null)
    {
        content_vlue = jQuery(".rss_left").remove(".backtotop").html().trim();

        var content_header = jQuery(".rss_left h1").html();
        layout="rl";
    }
    else 
    {
        content_vlue = jQuery(".sub_full").remove(".backtonews").html().trim();

        var content_header = jQuery(".sub_full h1").html();
        layout="sf";
    }
    

    // removing flash object
    content_vlue = content_vlue.replace(/<(object|OBJECT|script|SCRIPT) .*?>(.*?)<\/(object|OBJECT|script|SCRIPT)>/g, '');
    

    var docprint = window.open("", "", disp_setting);
    docprint.document.open();
    docprint.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title>Maritime Institute</title><link type="text/css" rel="stylesheet" href="css/Print.css">');
    if (layout == "sr")
    {
        docprint.document.write('<style>.backtotop { display:none }</style></head><body onLoad="self.print()" style="font-size:12px"><div class="sub_right" style="margin: 0">');
    }
    else if (layout == "rl")
    {
        docprint.document.write('<style>.backtotop { display:none }</style></head><body onLoad="self.print()" style="font-size:12px"><div class="rss_left" style="margin: 0">');
    }
    else
    {
        docprint.document.write('<style>.backtonews { display:none }</style></head><body onLoad="self.print()" style="font-size:12px"><div class="sub_full" style="margin: 0">');
    }
    
    docprint.document.write(content_vlue);
    docprint.document.close();
    docprint.focus();
}


function Clickheretoemail() {
    u = window.location;
    //m = "Interesting Article in AGC corporate website: " + document.title;
    //pagetitle = "Hi,%0A%0AI came across an interesting article in AGC corporate website.%0A%0AThe URL is ";
    
    m = "Interesting Article in Maritime Institute website: " + document.title;
    pagetitle = "Hi,%0A%0AI came across an interesting article in Maritime Institute website.%0A%0AThe URL is ";
    window.location = "mailto:email@domain.com?subject=" + m + "&body=" + pagetitle + ": " + u;
}

function BookMarkthisPage(url, title)
{
    if (navigator.appName=='Microsoft Internet Explorer')
    {
        window.external.AddFavorite(url, title);
    }
    else
    {
        if(window.sidebar)
        {
            window.sidebar.addPanel(title,url,'');            
        }
    }
}
function inputFocus(i)
{ 
    if(i.value==i.defaultValue){ i.value=""; i.style.color="#000"; } 
} 
function inputBlur(i)
{ 
    if(i.value==""){ i.value=i.defaultValue; i.style.color="#666666"; } 
}


