﻿// JavaScript Document
//FLIR.replace('#home', new FLIRStyle({cFont:'akzmed',css:'line-height:+5;',cColor:'FFFFFF',hq:'true',mode:'quickeffects',realFontHeight:'true',qe_Shadow: 'xlow', cSize: '28'}));
//FLIR.replace('#home h3', new FLIRStyle({mode:'progressive',cFont:'akzmed',cColor:'FFFFFF',hq:'true',mode:'quickeffects',realFontHeight:'true',qe_Shadow: 'low', cSize: '28'}));
//FLIR.replace('#home h3', new FLIRStyle({cFont:'akzmed',cColor:'FFFFFF',mode:'quickeffects',cSize:'28'}));
//FLIR.replace('#home h3', new FLIRStyle({cFont:'akzmed',css:'font-size:*1; line-height:+5;',cColor:'FFFFFF', realFontHeight:'true', hq:'false',ff_Wrap:'true', mode:'fancyfonts', cSize: '30', qe_Stroke: '1,999999'}));


FLIR.replace('.partner h3', new FLIRStyle({cFont:'pl',css:'font-size:*1; line-height:+1;',cColor:'FFFFFF', realFontHeight:'true', hq:'true', cSize: '26'}));

FLIR.replace('.guests h3.name, .gallery-element h3 a', new FLIRStyle({cFont:'pl',css:'font-size:*1; line-height:+1;',cColor:'FFFFFF', realFontHeight:'true', hq:'true', cSize: '26'}));

FLIR.replace('.agenda h3.venue, .partner .colW3 .static h2, .media-partners .colW3 .static h2, .special-thanks h3.date, .images div h3, .gallery h3', new FLIRStyle({cFont:'ak',cColor:'FFFFFF', realFontHeight:'true', hq:'true', cSize: '26',output:'png'}));

FLIR.replace('.images div p span', new FLIRStyle({cFont:'pl',cColor:'666666', realFontHeight:'true', hq:'true', cSize: '21',output:'png'}));

FLIR.replace('.movie h3', new FLIRStyle({cFont:'pl',css:'font-size:*1; line-height:+1;',cColor:'FFFFFF', realFontHeight:'true', hq:'true', cSize: '26',output:'png'}));
FLIR.replace('.about h3', new FLIRStyle({cFont:'ak',css:'font-size:*1; line-height:+1;',cColor:'FFFFFF', realFontHeight:'true', hq:'true', cSize: '30',output:'png'}));

FLIR.replace('.agenda h4, .movie h4, .bonus h4', new FLIRStyle({cFont:'ak',css:'font-size:*1; line-height:+1;',cColor:'FFFFFF', realFontHeight:'true', hq:'true', cSize: '28',output:'png'}));

FLIR.replace('.cinema .static div h3, .about h4', new FLIRStyle({cFont:'ak',css:'font-size:*1; line-height:+1;',cColor:'FFFFFF', realFontHeight:'true', hq:'true', cSize: '26',output:'png'}));
FLIR.replace('.programme h3', new FLIRStyle({cFont:'ak',css:'font-size:*1; line-height:+1;',cColor:'FFFFFF', realFontHeight:'true', hq:'true', cSize: '26',output:'png'}));
FLIR.replace('.programme .colW3 li, .partners-venues .colW3 li', new FLIRStyle({cFont:'ak',css:'font-size:*1; line-height:+1;',cColor:'FFFFFF', realFontHeight:'true', hq:'true', cSize: '26',output:'png'}));

FLIR.replace('.partner .element p, .media-partners .element p', new FLIRStyle({cFont:'ak',css:'font-size:*1; line-height:+1;',cColor:'FFFFFF',realFontHeight:'true',cSize: '21'}));

FLIR.replace('.colP1 h1', new FLIRStyle({cFont:'ak',css:'font-size:*1; line-height:+1;',cColor:'FFFFFF',cSize:'28',realFontHeight:'false',hq:'true',mode:'wrap',output:'png'}));
//FLIR.replace('.colP1 h1 span', new FLIRStyle({cFont:'pl',cColor:'FFFFFF',realFontHeight:'true',hq:'true',cSize:'31',mode:'wrap'}));

FLIR.replace('.event h3.date span, .agenda h3.date, .place h3.date', new FLIRStyle({cFont:'ak',css:'font-size:*1; line-height:+1;',cColor:'FFFFFF',realFontHeight:'true',cSize: '26'}));
//FLIR.replace('.event h3.date span, .agenda h3.date', new FLIRStyle({cFont:'ak',css:'font-size:*1; line-height:+5;',cColor:'FFFFFF', realFontHeight:'true', hq:'false',mode:'quickeffects', cSize: '66',qe_Shadow: 'low'}));




$(function(){
    var today = new Date();
    var month = today.getMonth(); 
    var year = today.getFullYear();
    var days = $('#thismonth ul li');

    if((month+1)==3 && year==2012){
        $(days[today.getDate()-1]).addClass('today');
    }  
    
    /* TOOLTIP */

		$(".tooltip").tooltip({
			bodyHandler: function()
			{
				return $($(this).attr("tip")).html();
			},
		});
/*
    $('.tooltip').tooltip({
        track: true,
        delay: 0,
        showURL: false,
        showBody: " - ",
        fixPNG: true,
        left: -20,
        top: 20
    });
		*/
    
    /* FULLSEARCH */
//    $( "#search" ).autocomplete({						
//            appendTo: "#hintsContainer" ,
//            source: "/hints",
//            select: function( event, ui ) {
//                console.log(ui.item ? "Selected: " + ui.item.label : "Nothing selected, input was " + this.value);
//            }
//    });
    
    
    
    /* SLIDER */
    var boxHide = 1;
        
    hideBox = function(){
        $('#slider_content').slideUp("slow", function() {
            boxHide = 1;
            $(document).unbind('mousedown', checkOuterBox);
        }); 
    };
        
    checkOuterBox = function(event) {
        if ($(event.target).closest('#slider').length!=1) {
            hideBox();
        }
    }
  
    $("#slider_handle").click(function(){
        if (boxHide!=1) return;
        $(this).parent().find('#slider_content').slideDown("slow", function () {
            boxHide = -boxHide
            $(document).bind('mousedown', checkOuterBox);
        });
    });


});


		var browserName = navigator.appName;
		var browserVer = parseInt(navigator.appVersion);
		var version = "";
		var msie4 = (browserName == "Microsoft Internet Explorer" && browserVer >= 4);
		if ((browserName == "Netscape" && browserVer >= 3) || msie4 || browserName=="Konqueror" || browserName=="Opera") {version = "n3";} else {version = "n2";}
			// Blurring links:
		function blurLink(theObject)	{	//
			if (msie4)	{theObject.blur();}
		}
		
			// decrypt helper function
		function decryptCharcode(n,start,end,offset)	{
			n = n + offset;
			if (offset > 0 && n > end)	{
				n = start + (n - end - 1);
			} else if (offset < 0 && n < start)	{
				n = end - (start - n - 1);
			}
			return String.fromCharCode(n);
		}
			// decrypt string
		function decryptString(enc,offset)	{
			var dec = "";
			var len = enc.length;
			for(var i=0; i < len; i++)	{
				var n = enc.charCodeAt(i);
				if (n >= 0x2B && n <= 0x3A)	{
					dec += decryptCharcode(n,0x2B,0x3A,offset);	// 0-9 . , - + / :
				} else if (n >= 0x40 && n <= 0x5A)	{
					dec += decryptCharcode(n,0x40,0x5A,offset);	// A-Z @
				} else if (n >= 0x61 && n <= 0x7A)	{
					dec += decryptCharcode(n,0x61,0x7A,offset);	// a-z
				} else {
					dec += enc.charAt(i);
				}
			}
			return dec;
		}
			// decrypt spam-protected emails
		function linkTo_UnCryptMailto(s)	{
			location.href = decryptString(s,-2);
		}
		
