﻿ function CreateBookmarkLink() {

 title = "labelfriends.nl – De leukste manier om nooit meer iets kwijt te raken!"; 

 url = "http://www.labelfriends.nl";


	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
}



function count(inputfield, outputfield, maxlength) {

    var currentLength = inputfield.value.length;

    if (maxlength - currentLength >= 0) {
        if (currentLength <= 0)
            outputfield.value = maxlength
        else
            outputfield.value = maxlength - currentLength
    }
 }


function countAndStop(inputfield, outputfield, maxlength) {        
    if (maxlength - (inputfield.value.length + 1) >= 0) {
        outputfield.value = maxlength - (inputfield.value.length + 1)
    }
    else {
        inputfield.value = inputfield.value.substring(0, maxlength);
    }  
}

$(document).ready(function () {

    $(".labelMaker, .labelMaker_a").colorbox({ iframe: true, innerWidth: 763, innerHeight: 680, opacity: 0.7, close: "", speed: 650, overlayClose: false, escKey: false, scrolling: false });

    $(".labelMaker_b").colorbox({ iframe: true, innerWidth: 763, innerHeight: 652, opacity: 0.7, close: "", speed: 650, overlayClose: false, escKey: false, scrolling: false });

    $(".labelMaker_c").colorbox({ iframe: true, innerWidth: 763, innerHeight: 545, opacity: 0.7, close: "", speed: 650, overlayClose: false, escKey: false, scrolling: false });

    $(".labelMaker_d").colorbox({ iframe: true, innerWidth: 763, innerHeight: 680, opacity: 0.7, close: "", speed: 650, overlayClose: false, escKey: false, scrolling: false });

    $(".labelMaker_e").colorbox({ iframe: true, innerWidth: 763, innerHeight: 445, opacity: 0.7, close: "", speed: 650, overlayClose: false, escKey: false, scrolling: false });

    $(".labelMaker_f").colorbox({ iframe: true, innerWidth: 763, innerHeight: 732, opacity: 0.7, close: "", speed: 650, overlayClose: false, escKey: false, scrolling: false });



    $(".labelMakerVoorbeeld").colorbox({ iframe: true, innerWidth: 275, innerHeight: 180, opacity: 0.7, close: "X", speed: 650, overlayClose: true, escKey: false, scrolling: false, onOpen: function () { loadAltSheet() }, onClosed: function () { unLoadAltSheet() } });

    $(".labelMakerVoorbeeld_Delen").colorbox({ iframe: true, innerWidth: 550, innerHeight: 180, opacity: 0.7, close: "X", speed: 650, overlayClose: true, escKey: false, scrolling: false, onOpen: function () { loadAltSheet() }, onClosed: function () { unLoadAltSheet() } });


    $(".labelMakerVoorbeeld2").colorbox({ iframe: true, innerWidth: 280, innerHeight: 180, opacity: 0.7, close: "X", speed: 650, overlayClose: true, escKey: false, scrolling: false, onOpen: function () { loadAltSheet() }, onClosed: function () { unLoadAltSheet() } });

    $(".labelMakerVoorbeeld2_Delen").colorbox({ iframe: true, innerWidth: 565, innerHeight: 180, opacity: 0.7, close: "X", speed: 650, overlayClose: true, escKey: false, scrolling: false, onOpen: function () { loadAltSheet() }, onClosed: function () { unLoadAltSheet() } });


    $(".labelMakerVoorbeeld3").colorbox({ iframe: true, innerWidth: 200, innerHeight: 230, opacity: 0.7, close: "X", speed: 650, overlayClose: true, escKey: false, scrolling: false, onOpen: function () { loadAltSheet() }, onClosed: function () { unLoadAltSheet() } });

    $(".labelMakerVoorbeeld3_Delen").colorbox({ iframe: true, innerWidth: 400, innerHeight: 230, opacity: 0.7, close: "X", speed: 650, overlayClose: true, escKey: false, scrolling: false, onOpen: function () { loadAltSheet() }, onClosed: function () { unLoadAltSheet() } });


    $(".labelMakerVoorbeeld4").colorbox({ iframe: true, innerWidth: 773, innerHeight: 325, opacity: 0.7, close: "X", speed: 650, overlayClose: true, escKey: false, scrolling: false, onOpen: function () { loadAltSheet() }, onClosed: function () { unLoadAltSheet() } });


    $(".labelMakerVoorbeeld5").colorbox({ iframe: true, innerWidth: 300, innerHeight: 230, opacity: 0.7, close: "X", speed: 650, overlayClose: true, escKey: false, scrolling: false, onOpen: function () { loadAltSheet() }, onClosed: function () { unLoadAltSheet() } });


    $(".labelMakerVoorbeeld6").colorbox({ iframe: true, innerWidth: 320, innerHeight: 220, opacity: 0.7, close: "X", speed: 650, overlayClose: true, escKey: false, scrolling: false, onOpen: function () { loadAltSheet() }, onClosed: function () { unLoadAltSheet() } });


    $(".labelMakerVoorbeeld7").colorbox({ iframe: true, innerWidth: 500, innerHeight: 300, opacity: 0.7, close: "X", speed: 650, overlayClose: true, escKey: false, scrolling: false, onOpen: function () { loadAltSheet() }, onClosed: function () { unLoadAltSheet() } });


    $(".labelMakerVoorbeeld8").colorbox({ iframe: true, innerWidth: 285, innerHeight: 200, opacity: 0.7, close: "X", speed: 650, overlayClose: true, escKey: false, scrolling: false, onOpen: function () { loadAltSheet() }, onClosed: function () { unLoadAltSheet() } });


    $(".labelMakerVoorbeeld9").colorbox({ iframe: true, innerWidth: 325, innerHeight: 200, opacity: 0.7, close: "X", speed: 650, overlayClose: true, escKey: false, scrolling: false, onOpen: function () { loadAltSheet() }, onClosed: function () { unLoadAltSheet() } });

    $(".labelMakerVoorbeeld9_Delen").colorbox({ iframe: true, innerWidth: 635, innerHeight: 200, opacity: 0.7, close: "X", speed: 650, overlayClose: true, escKey: false, scrolling: false, onOpen: function () { loadAltSheet() }, onClosed: function () { unLoadAltSheet() } });


    $(".labelMakerVoorbeeld10").colorbox({ iframe: true, innerWidth: 235, innerHeight: 200, opacity: 0.7, close: "X", speed: 650, overlayClose: true, escKey: false, scrolling: false, onOpen: function () { loadAltSheet() }, onClosed: function () { unLoadAltSheet() } });

    $(".labelMakerVoorbeeld10_Delen").colorbox({ iframe: true, innerWidth: 460, innerHeight: 200, opacity: 0.7, close: "X", speed: 650, overlayClose: true, escKey: false, scrolling: false, onOpen: function () { loadAltSheet() }, onClosed: function () { unLoadAltSheet() } });


    $(".labelMakerVoorbeeld11").colorbox({ iframe: true, innerWidth: 680, innerHeight: 300, opacity: 0.7, close: "X", speed: 650, overlayClose: true, escKey: false, scrolling: false, onOpen: function () { loadAltSheet() }, onClosed: function () { unLoadAltSheet() } });


    $(".popupLink1").colorbox({ iframe: true, innerWidth: 450, innerHeight: 320, opacity: 0.7, close: "", speed: 650, overlayClose: true, escKey: false, onOpen: function () { loadAltSheet() }, onClosed: function () { unLoadAltSheet() } });

    $(".popupLink2").colorbox({ iframe: true, innerWidth: 650, innerHeight: 400, opacity: 0.7, close: "", speed: 650, overlayClose: true, escKey: false, onOpen: function () { loadAltSheet() }, onClosed: function () { unLoadAltSheet() } });

    $(".popupLink3").colorbox({ iframe: true, innerWidth: 650, innerHeight: 230, opacity: 0.7, close: "", speed: 650, overlayClose: true, escKey: false, onOpen: function () { loadAltSheet() }, onClosed: function () { unLoadAltSheet() } });

    $(".popupLink4").colorbox({ iframe: true, innerWidth: 650, innerHeight: 500, opacity: 0.7, close: "", speed: 650, overlayClose: true, escKey: false, onOpen: function () { loadAltSheet() }, onClosed: function () { unLoadAltSheet() } });

    function loadAltSheet() {

        $('head').append('<link rel="stylesheet" href="/style/colorbox2.css" \/>');
    }

    function unLoadAltSheet() {

        $("[href='/style/colorbox2.css']").remove();
    }



    $(".tip").tooltip({
        track: true,
        delay: 0,
        showURL: false,
        showBody: " - ",
        fade: 250
    });

    $(".actiecode-link").click(function () {

        if ($(".actiecode-content").is(":visible")) {
            $(".actiecode-content").slideUp();
            $(".actiecode-link").text("Actiecode invoeren");
        }
        else {
            $(".actiecode-content").slideDown();
            $(".actiecode-link").text("Voer de actiecode in");
        }

        $(".actiecode-link").css("text-decoration", "underline");
        $(".actiecode-link").css("cursor", "pointer");

        return false;
    });

    $(".giftcode-link").click(function () {

        if ($(".giftcard-content").is(":visible")) {
            $(".giftcard-content").slideUp();
            $(".giftcode-link").text("Cadeaubon verzilveren");
        }
        else {
            $(".giftcard-content").slideDown();
            $(".giftcode-link").text("Voer de code van de cadeaubon in");
        }

        $(".giftcode-link").css("text-decoration", "underline");
        $(".giftcode-link").css("cursor", "pointer");

        return false;
    });

    $(".btn-apply").click(function () {

        $("#labelfriendsForm").attr("action", $("#labelfriendsForm").attr("action") + "&a=giftcard");
        $("#labelfriendsForm").submit();
    });

    $(".btn-activate").click(function () {

        $("#labelfriendsForm").attr("action", $("#labelfriendsForm").attr("action") + "&a=actiecode");
        $("#labelfriendsForm").submit();
    });


    $(".product-frame, .product-frame-wider, .product-frame-widest").click(function () {
        window.location = $("a", $(this)).attr("href");
    });

});
