﻿$(document).ready
(
	function() {
	    var loginstatus = "";
	    var currentMenu=new String();
	    currentMenu="";
	    loginstatus = $("#loginstatus").val();
	    if (loginstatus == "login") 
	    {  
	        $("#loginlink").removeClass("login");
	        $("#loginlink").addClass("logout");
	        $(".welcome").find("span").html("Welcome Mr:" + $("#username").val());
	    }
	    try
			{
			currentMenu=$('meta[name=page-name]').attr("content");
			currentMenu=currentMenu.toLowerCase();
			}
		catch(ex)
            {currentMenu="";}
        if(currentMenu!="")
			$("."+currentMenu).css({"background-position":"right top"});
	    $(".menupad").find("ul li").hover
			(

				function() 
				{
				    if(currentMenu!= $(this).attr("class"))
				    {
				    var pos=$(this).css("width");
				    pos="-"+pos+" "+"0px"
				    $(this).stop().animate({ backgroundPosition: pos }, { duration: 50 });
				    //$(this).css({"background-position":"right top"});
				    }
				    $(this).find("ul").stop(true,true).slideDown("1000");
			   },
				function()
				 {
				if(currentMenu!= $(this).attr("class"))
				 {
				 var pos=$(this).css("width");
				 pos="0px"+" "+"0px"
	             $(this).stop().animate({ backgroundPosition:pos }, { duration: 20});
	            //$(this).css({"background-position":"left top"}); 
	            }
	            $(this).find("ul").stop(true,true).slideUp("1000");
				}
        );
	}
);
var newwindow;
function popstatic(url)
{   
    var w=980;
    var h=400;
    var left = (screen.width/2)-(w/2);
    var top = (screen.height/2)-(h/2);
	newwindow=window.open(url,'RemoxAccount','height='+h+',width='+w+',resizable=no,scrollbars=yes,toolbar=no,status=no,left='+left+',location=no');
	if (window.focus) {newwindow.focus()}
}
