
function externalLinks() {
    if (!document.getElementsByTagName) return;
    var anchors = document.getElementsByTagName("a");
    for (var i = 0; i < anchors.length; i++) {
        var anchor = anchors[i];
        if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
            anchor.target = "_blank";
    }
}
window.onload = externalLinks;


 $(function () {
     $('#slider1').anythingSlider({
         delay               : 3000,      // How long between slideshow transitions in AutoPlay mode (in milliseconds)
         animationTime       : 1000,       // How long the slideshow transition takes (in milliseconds)
         easing              : "easeInOutExpo" 
     }); // Banner Homepage
});

$(function() {
    $('#logoslider').anythingSliderVertical({
    easing: "easeInOutExpo",
    autoPlay: true,
    delay: 6000,
    startStopped: false,
    animationTime: 800,
    hashTags: true,
    buildNavigation: false,
    pauseOnHover: false,
    startText: "Go",
    stopText: "Stop",
    navigationFormatter: formatText
    });
});

function formatText(index, panel) {
    return index + "";
};



    $(document).ready(function() {
	
	    $("a#single_image").fancybox();
	
	    $("a#inline").fancybox({
		    'hideOnContentClick': true,
		    'overlayColor'  :	'#ff0000',
            'type': 'image'
	    });
	
	    $("a.group").fancybox({
		    'transitionIn'	:	'elastic',
		    'transitionOut'	:	'elastic',
		    'speedIn'		:	600, 
		    'speedOut'		:	200, 
		    'overlayShow'	:	false,
            'type': 'image'
	    });
	
	    $("a#single_image").fancybox({
		    'titlePosition'		: 'outside',
		    'overlayColor'		: '#21131a',
		    'overlayOpacity'	: 0.9,
            'type': 'image'
        });

        $("a.single_image").fancybox({
            'titlePosition': 'outside',
            'overlayColor': '#21131a',
            'overlayOpacity': 0.9,
            'type': 'image'
        });

    });

$('a.closeMessage').click(function () {
    $('.MeldingBox').slideUp(500);
});

/*FORM VALIDATOR*/

var formfunctions = new function () {
    this.onfocus = function (Element) {
        if (Element.value.length == 0 || Element.value == Element.title || Element.title == "") {
            Element.title = Element.value;
            Element.alt = Element.value;
            Element.value = "";
        }
    }
    this.onblur = function (Element) {
        if (Element.value.length == 0 || Element.value == Element.title) {
            Element.value = Element.title
            Element.alt = ""
            Element.title = ""
        }
    }
    this.formsubmit = function (element) {
        if (Validate(element)) { eval("document.getElementById('" + element + "').submit();") }
    }

}

