
// *** Highslide settings ***
hs.outlineType = 'rounded-white';
hs.showCredits = false;
hs.dimmingOpacity = 0.6;
hs.align = 'center';
hs.dimmingGeckoFix = true;

hs.registerOverlay({
	html: '<div class="closebutton" onclick="return hs.close(this)" title="Close"></div>',
	position: 'top left',
	offsetX: -30,
	fade: 2,
	useOnHtml: true
});

// *** For "search" placeholder in searchbox ***
function activatePlaceholders() {

    if (navigator.userAgent.toLowerCase().indexOf('webkit') > 0) 
        return false;
    
    var inputs = document.getElementsByTagName('input');
    var placeholderColor = '#aaa';
    
    for (var i = 0;i < inputs.length; i++) {
        if (inputs[i].getAttribute('type') == 'text' || inputs[i].getAttribute('type') == 'search') {
            var placeholder = inputs[i].getAttribute('placeholder');

            if (placeholder && placeholder.length > 0) {
                if (inputs[i].value.length == 0 || inputs[i].value == placeholder) {
                    inputs[i].style.color = placeholderColor;                
                    inputs[i].value = placeholder;
                }
                
                inputs[i].onfocus = function() {
                    if (this.value == placeholder) {
                        this.value = '';
                        this.style.color = '#000';
                    }
            
                    return false;
                }
    
                inputs[i].onblur = function() {
                    if (this.value.length < 1) {
                        this.value = this.getAttribute('placeholder');
                        this.style.color = placeholderColor;
                    }
                }
            }   
        }
    }
}

window.onload = function() {
    activatePlaceholders();
}