﻿var Navigation = function(){
	var Index = 0;
	var Folder = "/App_Themes/Theme/Images/Default/";
	this.BindEvent = function(){
		$("#Navigation>ul>li[@href]").hover(
			function(){
				if($(this).attr("value") == Index)
			        return;								
				$(this).attr("class","over");
				$("#Navigation>ul>li[value='"+Index+"']").attr("class","out");
			},
			function(){
				if($(this).attr("value") == Index)
					return;
	            $(this).attr("class","out");
	            $("#Navigation>ul>li[value='"+Index+"']").attr("class","over");
			}
		);
		$("#Navigation>ul>li[@href]").click(function(){
		    if($(this).attr("value") != Index){		        
		        $(this).attr("class","over");
				$("#Navigation>ul>li[value='"+Index+"']").attr("class","out");		
				Index = $(this).attr("value");       
		    }			
			document.location = $(this).attr("href");
		});
	}
	this.Init = function(index){
		Index = index;		
        $("#Navigation>ul>li[value='"+index+"']").attr("class","over");
	}
	this.InitNavigation = function(index){
	   	var padLeft = 0;		
        $("#Navigation>ul>li[@href]").each(function(i,n){
            if(index == i+1){$(this).attr("class","over");}
            $(this).css("width",$(this).attr("width")+"px").css("background-position","-"+padLeft+"px");
            padLeft += parseInt($(this).attr("width"));
        }); 
        var lastLi =  $("#Navigation>ul li:last");
        lastLi.css("width",lastLi.attr("width")+"px").css("background-position","right");
	}
}
function OpenWindow(){    
    window.open (arguments[0]==null?"": arguments[0],arguments[1]==null?"":arguments[1],'height='+arguments[2]==null?$(window).height():arguments[2]+', width='+arguments[3]==null?$(window).width():arguments[3]+', top=0, left=0, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=yes')  
}
function SetOpacity(obj,opacity){
    if($.browser.msie){obj.css("filter","alpha(Opacity="+opacity*100+")")}else{obj.css("opacity",opacity)}
}
function ReceiveDataFromServer(valueReturnFromServer){
    window.location=valueReturnFromServer;
}        
function SignOut(format){
    CallBackToTheServer(format, "");
}
function Search(format){
    CallBackToTheServer(format, "");
}
var IE6 = (jQuery.browser.msie && jQuery.browser.version < 7);	
