﻿// JScript File

$(document).ready(
    function(){			    

        $.preloadImages("/assets/images/admin/bigrotation2.gif");   
        //preLoadImagesDLL("/assets/images/admin/bigrotation2.gif","1")                 
        //alert('loaded');
        setGridDeleteScripts();        
                
        /* add tooltip to all required fields */
        var required = $(".required");        
        required.mouseover(function () {            
            $(this).attr("title","This field is required") ;                
        });        
        
        $("#logoTop").css("cursor","pointer");
	    
	    $("#logoTop").click(function(){ 
		    document.location = '/';		    
	    }); 
	    
	    $(".logoTop").css("cursor","pointer");
	    $(".logoTop").click(function(){ 
		    document.location = '/';		    
	    }); 
	            
        var images = $(".imageLoad");  
        images.load(function () {            
            $(this).removeClass("imageLoad");                 
        }); 
        
        $(".loading").removeClass("loading");        
        
    }		    
    
);	 

function LoginFocus()
{
    
    
    $(document).ready(
    function(){	
    
    if( $("#ctl00_ContentPlaceHolder1_Login1_UserName").val().length > 0 )
        $("#ctl00_ContentPlaceHolder1_Login1_Password").focus();
    else
        $("#ctl00_ContentPlaceHolder1_Login1_UserName").focus();    
        
        }		    
    
);	     
}

/*
function AssetNameNotUnique(msg)
{   
    if(msg != 'true')
    {
        var err = 'The asset name you have entered is not unique. <p>Each asset must have a <strong><i>unique name</i></strong>.</p>';
                
        displayFadeMessage(err,'3','false','true','');
        $(".assetnamecheck").css("backgroundColor","Yellow");
        
        $(document).ready(function() {             
            $(".savePublishButtonContainer").hide();
        });
        
        return false;                  
    }       
    else
    {
        $(".savePublishButtonContainer").show();
        $(".assetnamecheck").css("backgroundColor","#fff");
        return true;
    }
}

function GalleryTitleNotUnique(msg)
{   
    if(msg != 'true')
    {
        var err = 'The gallery title you have entered is not unique. <p>Each gallery must have a <strong><i>unique title</i></strong>.</p>';
                
        displayFadeMessage(err,'3','false','true','');
        $(".gallerytitlecheck").css("backgroundColor","Yellow");
        
        $(document).ready(function() {             
            $(".savePublishButtonContainer").hide();
        });
        
        return false;                  
    }       
    else
    {
        $(".savePublishButtonContainer").show();
        $(".gallerytitlecheck").css("backgroundColor","#fff");
        return true;
    }
}

function AttractionNotUnique(msg)
{   
    if(msg != 'true')
    {
        var err = 'The title you have entered is not unique. <p>Each attraction must have a <strong><i>unique title</i></strong>.</p>';
        
        displayFadeMessage(err,'3','false','true','');
        $(".uniquecheck").css("backgroundColor","Yellow");
        
        $(document).ready(function() {             
            $(".savePublishButtonContainer").hide();
        });
        
        return false;                  
    }       
    else
    {
        $(".savePublishButtonContainer").show();
        $(".uniquecheck").css("backgroundColor","#fff");
        return true;
    }
}

*/

