$(function(){  
    //$('.navspan').
                 
    $('.customNyroModal').click(function(e){    
        $('html, body').animate({scrollTop:0}, 'slow');
        var d = new Date();   
        url = $(this).attr('href') + '&dummy=' + d.getTime();
        
        e.preventDefault();                       
        //onOpenModalCustom();
        $.nyroModalManual({                 
            'modal': true,
            'url': url,
            'resizable': false
        });                        
        //afterOpenModalCustom();
        return false;

    });
           
    $(window).resize(function(){
        //updateModalCustom(); 
    });                                 
});
    

function saveModalPageClick(){  
    $('#pagelocation').val(window.location);                               
    $('#PageForm').submit(); 
}

function cancelModalPageClick(){   
    if (window.confirm("Leave form without Saving?")){
        $.nyroModalRemove();      
    }
}

//function onOpenModalCustom(){
//  
//}

//function afterOpenModalCustom(){
// 
//}

//function sendContactMail(formid){
//    $.post('ajax/mailajax.php',$('#' + formid).serialize(true),function(msg){  
//        if(msg == 'No Error'){
//            $('#mailmessage').css('color','#52612A');  
//            $('#mailmessage').html('Thank you, your message has been sent.'); 
//            
//            $('#firstname').val('');          
//            $('#lastname').val('');          
//            $('#company').val('');          
//            $('#email').val('');          
//            $('#message').val('');        
//        }   
//        else{
//            $('#mailmessage').css('color','#FF0000');  
//            $('#mailmessage').html(msg);  
//        } 
//    });            
//}