/*
var message = "All images, content, and web site design are Copyright 2004-2009 Dailand Photography and may not be reproduced.";
function clickIE4(){
    if (event.button == 2) {
        alert(message);
        return false;
    }
}

function clickNS4(e){
    if (document.layers || document.getElementById && !document.all) {
        if (e.which == 2 || e.which == 3) {
            alert(message);
            return false;
        }
    }
}

if (document.layers) {
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = clickNS4;
}
else 
    if (document.all && !document.getElementById) {
        document.onmousedown = clickIE4;
    }

document.oncontextmenu = new Function("alert(message);return false")


*/


/**
 * @author aarondjajasaputra
 */
window.addEvent('domready', function(){

    $$('div[id^=morph]').each(function(_e1){
        $$('div#' + _e1.id).addEvents({
            mouseenter: function(){
                $$("div#" + _e1.id + " img").morph({
                    'opacity': '0.3'
                });
                $$("div#" + _e1.id + " h2").morph({
                    'color': '#f45f03'
                });
            },
            mouseleave: function(){
                $$('div#' + _e1.id + ' img').morph({
                    'opacity': '1'
                });
                $$("div#" + _e1.id + " h2").morph({
                    'color': '#fff'
                });
            }
        });
    });
    
    
    if ($$('div[id^=nav] a') != null) {
        $$('div[id^=nav] a').each(function(e1){
            if (e1.hasClass('active') != true) {
            
                e1.addEvent('mouseenter', function(){
                    e1.morph({
                        'color': '#f45f03'
                    });
                });
                
                e1.addEvent('mouseleave', function(){
                    e1.morph({
                        'color': '#fff'
                    });
                });
            }
            else {
                (function(){
                    e1.morph({
                        'color': '#f45f03'
                    });
                }).delay(200);
            }
        });
    }
    
    
    
    
    
    
    
    $$('div.gallery div div').each(function(_e1){
        _e1.addEvents({
            mouseenter: function(){
                _e1.morph({
                    'background-color': '#333'
                });
            },
            mouseleave: function(){
                _e1.morph({
                    'background-color': '#000'
                });
            }
        });
        
    });
    
    
    $$('div[id^=links] div div').each(function(_e1){
        _e1.addEvents({
            mouseenter: function(){
                _e1.morph({
                    'background-color': '#333'
                });
            },
            mouseleave: function(){
                _e1.morph({
                    'background-color': '#1a1a1a'
                });
            }
        });
        
    });
    
    
    
    
    
    $$('form#contactForm input').each(function(e1){
        e1.addEvents({
            focus: function(){
                e1.morph({
                    'background-color': '#666'
                });
            },
            blur: function(){
                e1.morph({
                    'background-color': '#000'
                });
            }
        });
    });
    
    $$('form#contactForm textarea').each(function(e1){
        e1.addEvents({
            focus: function(){
                e1.morph({
                    'background-color': '#666'
                });
            },
            blur: function(){
                e1.morph({
                    'background-color': '#000'
                });
            }
        });
    });
    
    
    $$('span.tel').each(function(element){
        element.empty();
        element.set('html', "0845 2244915");
    });
    $$('span.email').each(function(element){
        element.empty();
        element.set('html', "<a href=\"mailto:enquiry@dailand-photography.com\">enquiry@dailand-photography.com</a>");
    });
    
    
});
