function dim()
{	 		
	 jq('.info_div').hide().fadeIn('1000');
	 jq('.header_inc').fadeOut('3000');
	 jq('.main_div').fadeOut('3000');
	 jq('.footer_inc').fadeOut('3000');	
	 
	 if(jq.browser.webkit)
		 {		
		 	setTimeout(window.location.reload.bind(window.location), 1500);		 
		 }
	 else if(jq.browser.safari)
		 {		
		 	setTimeout(window.location.reload,1500);		 
		 }
	 else if(jq.browser.opera)
		 {		
		 	setTimeout(window.location.reload,1500);		 
		 } 
	 else if(jq.browser.msie)
		 {		 
			 window.setTimeout(function() {
				 window.location.reload(true);				 
			 },1500);		
		 }
	 else if(jq.browser.mozilla)
		 {		 
		 window.setTimeout(function() {window.location.reload(true);
		 },1500);		 
		 }	
}

function closeTopMenu(){
	
	var display = $('.mediaq').css('display');
	var selector = display?display:"inline-block";
	
	if (selector == 'none'){
		zk.Widget.$('$icsmsSidemenu').hide();
	}	
}
 
function noResultInfo()
{	 
	 jq('$resultInfoBox').hide().fadeIn(1000);	 
}
 
function closeMenu() 
{	
	jq(".dropdown.open").removeClass("open");	      
}
 
function ResetHeight()
{	
		
    if (jq.browser){	
		if(jq.browser.version.substring(0, 2) == "7." || jq.browser.version.substring(0, 2) == "8." || jq.browser.version.substring(0, 2) == "9.")
		{	
			
			var content_height = jq('.main-content').height() + 450;	
				
			jq('.mainLayout').height(content_height);		
			jq('.centralparent div:nth-child(5)').css('height', 'auto');		
			jq('.centralparent').css('height', 'auto');		
			jq('.parent div:nth-child(2)').css('height', 'auto');
		}
    }
    else
    {
    	if(jq.support.opacity == false){	
    	
    		var content_height = jq('.main-content').height() + 450;	
			
			jq('.mainLayout').height(content_height);		
			jq('.centralparent div:nth-child(5)').css('height', 'auto');		
			jq('.centralparent').css('height', 'auto');		
			jq('.parent div:nth-child(2)').css('height', 'auto');
    	}
    }
}

function HideSearchGrid()
{	
	jq('.vlSearch').fadeOut('slow', 'linear');
}

function ShowSearchGrid()
{	
	jq('.vlSearch').fadeIn('slow', 'linear');
}

function handleSidebarToggler()
{
    var content = jq(".page-content");
    var sidebar = jq(".page-sidebar");    

    jq('.mini-sidebar-toggler').click(function (e) {       	
    	
    	if (zk.Widget.$('$icsmsSidemenu').isVisible() === true) {
    		zk.Widget.$('$icsmsSidemenu').hide();
    	}
    	else {
    		zk.Widget.$('$icsmsSidemenu').show();
    	}
    });

    // handle sidebar show/hide
    jq('.page-sidebar .sidebar-toggler').click(function (e) {   
        
        if (content.hasClass("sidebar-closed") === true) {
        	//OPEN menu
        	zk.Widget.$('$icsmsSidemenu').setCollapsed(false);
        	content.removeClass("sidebar-closed");
        	sidebar.removeClass("sidebar-closed");
            jq(".page-sidebar .z-navbar-vertical").removeClass("z-navbar-collapsed");
           
        } else {
        	//CLOSE menu
        	zk.Widget.$('$icsmsSidemenu').setCollapsed(true);
        	content.addClass("sidebar-closed");
        	sidebar.addClass("sidebar-closed");
            jq(".page-sidebar .z-navbar-vertical").addClass("z-navbar-collapsed");
            
        }            
        
       jq(window).trigger('resize');     
        
        e.preventDefault();
    });       
}

// Utility function for the notify plugin
function showNotification(type, message){
	
	if (type=='info')
	{
		jq.notify(message, {  style: 'zk-info', autoHideDelay: 7500});		
	} else if (type=='error')
	{
		jq.notify(message, {  style: 'zk-error', autoHideDelay: 7500});	
	} else if (type=='warning')
	{
		jq.notify(message, {  style: 'zk-warning', autoHideDelay: 7500});	
	} else if (type=='ok')
	{
		jq.notify(message, {  style: 'zk-ok'});	
	}
	else
	{
		jq.notify(message);
	}	
}

function ScrollToBottom(){

	jq(".parent").scrollTop(600);

}

zk.afterMount(function(){		
	
	handleSidebarToggler();		
});