﻿function ValidateCountries(sender, args)
{   
    args.IsValid = $(".countries").val() > 0;
}

$(document).ready(function(){
        
        try
        {
            if(edit && auth)
            {
                $('.edititem').show();
            }
            else
            {
                $('.edititem').hide();
            }
        }
        catch(error)
        {
        
        }
    
        $('img#logoButton').click(function(){
            
            try
            {
                var tsTimeStamp= new Date().getTime();
                
                if(edit && auth)
                {
                    $('.edititem').hide();
             
                    $.get('/action/edit.ashx',{edit:false,time: tsTimeStamp},function(data){;});
                }
                else
                {
                    $('.edititem').show();
                    
                    $.get('/action/edit.ashx',{edit:true,time: tsTimeStamp},function(data){;});
                }
                
                edit = !edit;
            }
            catch(error)
            {
            
            }
        });
        
        $('#getnewcode').click(function(){
            
            $('img#captchaimage').attr('src','/captcha/image.ashx?cache='+(new Date().getTime()));
        });
        
        $('#forgot').click(function(){
            
            $('table.sendpassword').show();
        });
        
        $('span.toggle').click(function(){
        
            $("tr.toggleclose").attr("style","display:none;");
            $("tr.toggle" + ($(this).attr("id"))).attr("style","");
        });
        
        $('span.mailtoggle').click(function(){
        
            $("tr.toggleclose").attr("style","display:none;");
            $("tr.toggle" + ($(this).attr("id"))).attr("style","");
            $.get('/action/misc/mailread.ashx',{mid: $(this).attr('id'),time: new Date().getTime()},function(data){;});
        });
        
        $('a.viewcomments').click(function(){
        
            $('div.comments').show();
        
        });
       
}); 





