﻿/*
    Sorry JB! Minified number of javascript-files. Included:
    - main.js
    - calender.js
    - form.js
    - filter.js
    - sifr.js
    - sifr-config.js
    - NEW_editorial.js
    - NEW_LandingCategory.js
    - jquery.date_input.min.js
*/


/* file: main.js */

/* -------------------------- FUNCTION returnFalse ()  -------------------------- */

var search_timeout = undefined;

function returnFalse() {
    return false;
}

/* -------------------------- TOOLTIP -------------------------- */

$('a[href=#tooltip]').each(
		function(e) {
		    var obj = $(this);
		    obj.attr('rel', obj.attr('title')).removeAttr('title');
		}
	);

$('a[href=#tooltip]').hover(
	function(e) {
	    var obj = $(this);
	    var pos = obj.offset();
	    var objWidth = obj.width();
	    var objHeight = obj.height();
	    var tooltipBoxWidth = $('.tooltipBox').width();
	    $('.tooltipBox .boxContent').html(obj.attr('rel'));
	    $('.tooltipBox').css({ top: pos.top + objHeight, left: (pos.left + objWidth / 2 - tooltipBoxWidth / 2) }).show();

	},
	 function(e) {
	     $('.tooltipBox .boxContent').html('&nbsp;');
	     $('.tooltipBox').hide();
	 });


/* -------------------------- FUNCTION wopen ()  -------------------------- */
function wopen(url, name, w, h) {
    w += 32;
    h += 96;
    wleft = (screen.width - w) / 2;
    wtop = (screen.height - h) / 2;
    if (wleft < 0) {
        w = screen.width;
        wleft = 0;
    }
    if (wtop < 0) {
        h = screen.height;
        wtop = 0;
    }
    var win = window.open(url,
            name,
            'width=' + w + ', height=' + h + ', ' +
            'left=' + wleft + ', top=' + wtop + ', ' +
            'location=no, menubar=no, ' +
            'status=no, toolbar=no, scrollbars=yes, resizable=no');

    win.resizeTo(w, h);

    win.moveTo(wleft, wtop);
    win.focus();
}

/* -------------------------- LAYOUT (FIX FOR COLUMN HEIGHT)  -------------------------- */


function setColumnHeight() {
    return false;
}

/*
function setColumnHeight ()
{
$('#leftBar').css('height', 'auto');
$('.template').css('height', 'auto');

var templateHeight = $('.template').height();
var subNavHeight = $('.leftMenu').height();
var leftBarHeight = $('#leftBar').height();
var a = templateHeight - subNavHeight;
	
if (templateHeight > leftBarHeight)
{
$('#leftBar').height(a);
$('#editorial .toolBox').css({paddingBottom: 0});
}
else
{
$('.template').height(leftBarHeight);
		
if(!isIE6())
{
$('#editorial #colLeft').height(leftBarHeight).css({position: 'relative'});
$('#editorial .toolBox').addClass('toolboxAbsPos');
}
else
{
$('#editorial #colLeft').css('background', 'none !Important');
}
}
}
*/


/* -------------------------- HIDE SEARCH BUTTON -------------------------- */
function hideSearchBtn() {
    $('.searchBtn').css('display', 'none');
}


/* -------------------------- SHOW QUICK LINKS -------------------------- */
function showQuickLinks() {
    var link = $(this);
    hideFavLinks();
    $('.quickLinkContent').show();
    $('.quickLinkContent li:last').css('background-image', 'none');

    $('.quickLinkContent').hover(
		function() {

		},
		function() {
		    link.show();
		    $(this).hide();
		}
	);
}

/* -------------------------- HIDE QUICK LINKS -------------------------- */
function hideQuickLinks() {
    $('.quickLinkContent').hide();
}

/* -------------------------- SHOW MY FAVORITES -------------------------- */
function showFavLinks() {
    var link = $(this);
    hideQuickLinks();
    $('.favLinksContent').show();

    $('.favLinksContent').hover(
		function() {

		},
		function() {
		    link.show();
		    $(this).hide();
		}
	);
}

/* -------------------------- HIDE MY FAVORITES -------------------------- */
function hideFavLinks() {
    $('.favLinksContent').hide();
}

/* -------------------------- FUNCTION TO DETECT IE6 -------------------------- */
function isIE6() {
    var state = false;
    if ($.browser.msie)
        state = true;

    if (state == true && $.browser.version > 6)
        state = false;

    if (state == false)
        return false;
    else
        return true;
}

/* -------------------------- FUNCTION TO DETECT IE7 -------------------------- */

function isIE7() {
    var state = false;
    if ($.browser.msie)
        state = true;

    if (state == true && $.browser.version < 7)
        state = false;

    if (state == false)
        return false;
    else
        return true;
}

/* -------------------------- FAVORITE LINK LIST (GET) -------------------------- */
function getFavContent() {
    $.ajax({
        type: "GET",
        url: "/lt/Functions/Favorites_json.aspx",
        data: "epslanguage=" + lang,
        dataType: "json",
        success: function(res) {
            processFavContent(res);
        }
    });


}

/* -------------------------- FAVORITE LINK LIST (PROCES THE RESPONS DATA) -------------------------- */

function processFavContent(res) {
    var itemCount = 0;
    var fav = $('.favLinksContent .boxContent');
    $(fav).empty();

    if (res.results.length == 0) {
        $(fav).append('<ul class="list favList"><li class="defaultTxt"></li></ul>');

        $('.defaultTxt').html(res.defaultText);
    }
    else {
        $(fav).append('<ul class="list favList"></ul>');

        $(res.results).each(
			function() {
			    $('ul.favList', fav).append('<li class="header">' + this.category + '</li>');

			    $(this.items).each(
					function() {
					    $('ul.favList', fav).append('<li class="link"><a class="compresed" href="' + this.linkUrl + '"><span>' + this.linkText + '</span></a></li>');
					    itemCount++;
					}
				);
			}
		);
    }

    $('.favList li:first').css('padding-top', 0).css('background-image', 'none');
    $('.myFavLink').append('<span> (' + itemCount + ')</span>');
}

/* -------------------------- SEARCH (FUNCTION CALLED TO GET RESULT) -------------------------- */
function getSearchResult() {
    var strLen = $(this).val().length;
    var qryValue = $(this).val();
    var searchStr = $(this).val();

    if (search_timeout != undefined)
        clearTimeout(search_timeout);


    search_timeout = setTimeout(function() {
        search_timeout = undefined;

        $.ajax({
            type: "GET",
            url: "/lt/functions/Search_json.aspx",
            dataType: "json",
            data: "query=" + qryValue + "&epslanguage=" + lang,
            queue: "search",
            cancelExisting: true,
            success: function(res) {
                if (res.result.length > 0) {
                    procesSearchResult(res);
                }
                else {
                    var src = $('.searchContent .boxContent');
                    $('.searchContent').hide();
                    $(src).html('');
                    $(src).append('<br /><br />');
                }
            }
        });


    }, 500);

}

/* -------------------------- SEARCH (FUNCTION TO PROCES THE RESPONS DATA) -------------------------- */
function procesSearchResult(res) {
    $('.searchContent').show();
    var src = $('.searchContent .boxContent');
    $(src).empty();
    $(src).append('<ul class="searchResult"></ul>');
    $(src).append('<a class="viewAllResults" href="' + res.viewAll + '"><span>' + res.viewAllText + '</span></a>');

    $(res.result).each(
		function() {
		    var cat = $('.searchContent .boxContent .searchResult');
		    $(cat).append('<li class="header"><span>' + this.category + '</span></li>');

		    $(this.items).each(
				function() {
				    $(cat).append('<li class="search"><a href="' + this.link + '"><span class="header">' + this.header + '<span class="description">' + this.text + '</span></span></a></li>');
				}
			);
		}
	);

    $('.searchResult li:first').css('background-image', 'none');
}


/* -------------------------- VIEW/HIDE SEASON SELECTOR BOX -------------------------- */

function showSeasonSelector() {
    $('#seasonSelector').show();

    $('#seasonSelector').hover(
		function()
		{ },
		function()
		{ $(this).hide(); }
	);
}

/* -------------------------- SCROLLER FOR OFFERS -------------------------- */

function scroller(obj, dir) {
    $(obj).mouseout(function() { $('.tabItem:visible').stop(); $(this).unbind('mouseout'); $(this).css('background-position', 'center 0') });
    var test = 300;
    var bp = parseInt($('.tabItem:visible').css('top'));
    var ch = $('.tabItem:visible').height();
    var bh = $('.scroller').height();
    var sh = (ch - bh);
    var pos = 0;
    var speed = 0;
    var time = parseInt(ch / 100) * test;
    var dif = parseInt(((bp * -1) / sh) * time);

    if (dir == 'up') {
        $(obj).css('background-position', 'center -1px');
        pos = sh * -1;
        speed = time - dif;
    }
    else {
        $(obj).css('background-position', 'center 1px');
        pos = 0;
        speed = dif;
    }

    if (ch > bh)
        $('.tabItem:visible').animate({ top: pos }, speed);
}


/* -------------------------- SHOW TIPS CONTENT -------------------------- */
function showTipsContent(e) {

    $('#exit').click(function() { $('.tipsContent').hide(); });
    $('#exit').show();
    $('#tipsSuccess').show();
    $('#tipsError').show();
    $('#tipsForm').show();

    var pos = $(this).offset();

    if ($(this).hasClass('tipsLinkCTA'))
        pos.left -= 455;
    pos.top += 40;

    var tipsHeight = $('.tipsContent').height();

    $('.tipsContent textarea').val('');

    $('.tipsContent input:text').each(
		function() {
		    var defaultValue = $(this).attr('alt');

		    $(this).val(defaultValue).css('color', '#000000');
		}
	);

    $('.tipsContent input:text').focus(
		function() {
		    var defaultValue = $(this).attr('alt');

		    if ($(this).val() == defaultValue)
		        $(this).val('');
		}
	);

    $('.tipsContent input:text').blur(
		function() {
		    var defaultValue = $(this).attr('alt');

		    if ($(this).val() == '')
		        $(this).val(defaultValue);
		}
	);

    $('.sendTipsBtn').click(function() { validateAndSend(); return false });

    $('.tipsContent').hide().css({ top: pos.top - tipsHeight - 20, left: pos.left }).show();
    return false;
}

/* -------------------------- SHOW TIPS CONTENT -> VALIDATE & SEND -------------------------- */
function validateAndSend() {

    var state = true;
    var pos = $('.tipsContent').offset();


    $('.tipsContent input:text').each(
		function(index) {
		    var defaultValue = $(this).attr('alt')

		    if (index == 0 || index == 2) {
		        var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;

		        if (reg.test($(this).val()) == false || $(this).val() == defaultValue) {
		            $(this).css('color', '#cc0000');
		            state = false;
		        }
		        else {
		            $(this).css('color', '#000000');
		        }

		    }
		    else {
		        if ($(this).val() == defaultValue) {
		            $(this).css('color', '#cc0000');
		            state = false;
		        }
		        else {
		            $(this).css('color', '#000000');
		        }
		    }
		}
	);

    if (state == false)
        $('.tipsContent').animate({ left: pos.left - 20 }, 50).animate({ left: pos.left }, 50).animate({ left: pos.left - 20 }, 50).animate({ left: pos.left }, 50);
    else {
        var emailBody = $('.emailBody').val();
        var senderName = $('.emailName').val();
        var senderEmail = $('.emailSender').val();
        var targetEmail = $('.emailTarget').val();
        var pageLink = $('.pageLink').val();


        $.ajax({
            type: "POST",
            url: "/data/mail/send.aspx",
            data: "epslanguage=" + lang + "&targetEmail=" + targetEmail + "&senderEmail=" + senderEmail + "&senderName=" + senderName + "&emailBody=" + emailBody + "&pageLink=" + pageLink,
            success: function(data) {
                $('#tipsError, #exit').hide();
                $('#tipsForm').fadeOut('slow').siblings('#tipsSuccess').fadeIn('slow').animate({ opacity: 1 }, 5000, function() { $('.tipsContent').fadeOut('slow'); });
            },
            error: function(data) {
                $('#tipsSuccess').hide();
                $('#tipsForm').fadeOut('slow').siblings('#tipsError').fadeIn('slow');
            }
        });
    }
}

/* -------------------------- POST NEWS LTTER SUBSCRIPTIN  -------------------------- */
function postNewsLetterSubscription(e) {
    var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
    var email = $('#fldNewsLetter').val();
    var emailDefault = $('#fldNewsLetter').attr('alt');

    if (e.keyCode == 13 || e.target.id == "btnAdd") {
        if (reg.test(email) == true && email != emailDefault) {
            $('#fldNewsLetter').css('color', '#000');

            if ($('#letterType').val() != 0) {
                $('.select .middle').css('color', '#000');
                var loc = $('#letterType').val();
                var qry = "?email=" + email;

                top.location = loc + qry;
            }
            else {
                $('.select .middle').css('color', '#cc0000');
            }
        }
        else {
            $('#fldNewsLetter').css('color', '#cc0000');
        }

        return false;
    }
}

/* -------------------------- ALTERNATE SUB MENU ARROW DIRECTION  -------------------------- */
function expandMenu() {
    $('.leftMenu li:has(ul)').each(
		function() {
		    $('span:first', this).addClass('expand');
		}
	);
}


/* -------------------------- TABLE SKIN  -------------------------- */

function applyTableSkin() {
    $('.htmlContent table:not(.ready)').wrap('<div class="tableSkin"></div>');
    $('.tableSkin').append('<div class="tblCornerNW"></div><div class="tblCornerNE"></div><div class="tblCornerSW"></div><div class="tblCornerSE"></div>');
    $('.tableSkin table:not(.ready)').each(
		function() {
		    var tableWidth = $(this).width();
		    $(this).parent('.tableSkin').css({ width: tableWidth });
		    $(this).addClass('ready');
		    $('tr:odd', this).addClass('odd');
		}
	);
}


/* --------------------------  LOAD OFFERS IMAGES  -------------------------- */

function loadOffersImagesa(e) {

    ($(this).attr('rel'))
	?
		$('img', this).animate({ opacity: 0 }, 600,
				function() {
				    $(this).attr('src', $(this).parents('a').attr('rel')).animate({ opacity: 1 }, 300,
						function() {
						    $(this).parents('a').removeAttr('rel');
						}
					)
				}
			)
	:
		null;
}


function loadOffersImages(e) {

    ($(this).attr('rel'))
	?
		$('img', this).animate({ opacity: 0 }, 1000,
				function() {

				    $(this).css({ display: 'none' });
				    var img = $('<img alt="ad" width="60" height="60" />').attr('src', $(this).parents('a').attr('rel')).css({ opacity: 0 });
				    $(this).after(img);

				    $(this).siblings('img').animate({ opacity: 1 }, 300,
						function() {
						    $(this).parents('a').removeAttr('rel');
						    $(this).siblings('img').remove();
						}
					);
				}
			)
	:
		null;
}



// Click events for offers

function tabClick(e) {
    // Modify current
    var index = $(this).parent().children().index(this);

    $('.tabItem').eq(index).fadeIn(600);
    $('.tabItem').eq(index).siblings('.tabItem').hide();
    $('.tabItem').eq(index).children('.item').each(loadOffersImages);

    $(this).addClass('selected').siblings('a').removeClass('selected');

    return false;
}

/* -------------------------- DOCUMENT LOAD FUNCTION -------------------------- */

$(window).load(
	function() {
	    $('.tab').bind('click', tabClick);

	    //Trigger selected offer tab
	    $('.offers .selected').trigger('click');

	    //Scroller
	    $('.scrollTop').mouseover(function() { scroller(this, 'down'); });
	    $('.scrollDown').mouseover(function() { scroller(this, 'up'); });

	}
);


/* -------------------------- DOCUMENT READY FUNCTION -------------------------- */
$(document).ready(
	function() {

	    applyTableSkin();
	    expandMenu();

	    if ($('#editorial').length > 0)
	        editorialInit();

	    if ($('#LandingCategory').length > 0)
	        landingCategoryInit();	        
	        

	    $('.tipsLink').removeClass('hide').bind('click', { x: 0, y: 0 }, showTipsContent);
	    $('.tipsLinkCTA').removeClass('hide').bind('click', { x: 50, y: 50 }, showTipsContent);

	    //IF JavaScript is Enable
	    hideSearchBtn();

	    // Search

	    $('.searchFld').focus(function() { $(this).val(''); hideFavLinks(); hideQuickLinks(); });
	    $('.searchFld').bind('keyup', getSearchResult);
	    $('.searchFld').blur(function() { if ($(this).val() != $(this).attr('alt')) { $(this).val($(this).attr('alt')); } });
	    $(document).click(function(e) { if (e.target.className != 'searchFld') { $('.searchContent').hide(); } });



	    $('.quickLink').hoverIntent({ sensitivity: 1, interval: 200, over: showQuickLinks, timeout: 500, out: returnFalse }).click(function() { return false; });
	    $('.myFavLink').hoverIntent({ sensitivity: 1, interval: 200, over: showFavLinks, timeout: 500, out: returnFalse }).click(function() { return false; });


	    //Season selctor

	    $('#mainMenu ol li a:first').hoverIntent({ sensitivity: 1, interval: 10, over: showSeasonSelector, timeout: 500, out: returnFalse });
	    $('#mainMenu ol li:gt(0)').mouseover(function() { $('#seasonSelector').hide(); });


	    // If IE6, apply fix for png
	    if (isIE6()) {
	        $('#mainMenu ul li a img').pngfix();
	        $('#menuLogo img').pngfix();
	        $('#offersLogo img').pngfix();
	    }

	    // Get the fav links
	    getFavContent();


	    // Clear default e-mail value in newsletter section
	    $('#fldNewsLetter').focus(
			function() {

			    var defaultString = $(this).attr('alt');

			    if ($(this).val() == defaultString)
			        $(this).val('');
			}
		);

	    $('#fldNewsLetter').blur(
			function() {
			    if ($(this).val() == '')
			        $(this).val($(this).attr('alt'));
			}
		);

	    $('#fldNewsLetter').keydown(postNewsLetterSubscription);
	    $('#btnAdd').click(postNewsLetterSubscription);
	}
);

/* -------------------------- Add bookmark -------------------------- */
function addBookmark(p_url, p_title) {
    if (window.sidebar) {
        window.sidebar.addPanel(p_title, p_url, "");
    } else if (window.opera && window.print) { // Opera browsers
        var e = document.createElement('a');
        e.setAttribute('href', p_url);
        e.setAttribute('title', p_title);
        e.setAttribute('rel', 'sidebar');
        e.click();
    } else if (document.all) {
        window.external.AddFavorite(p_url, p_title);
    };
};











/* file: calender.js */


/* -------------------------- GET CALENDER DATA FOR SELECTED DATE -------------------------- */
function getCalenderData(e) {
    var state = $('.calenderContent').css('display');
    var thisYear = $('.cHeaderCenter').html().split(' ')[1];
    var prevMonth = parseInt($('.cPrevMonth a').attr('rel'));
    var thisMonth = ((parseInt(prevMonth) + 1) == 13) ? 1 : parseInt(prevMonth) + 1;
    var nextMonth = ((parseInt(thisMonth) + 1) == 13) ? 1 : parseInt(thisMonth) + 1;
    var thisDate = $(this).html();

    if (thisMonth < 10)
        thisMonth = '0' + thisMonth;

    if (thisDate < 10)
        thisDate = '0' + thisDate;

    var selectedDate = thisYear + '-' + thisMonth + '-' + thisDate;

    if (state != 'block')
        $('.calenderContent').show();

    if (isIE6() == true || isIE7() == true) {
        var offset = $(this).offset();
        var pX = offset.left - $('.calenderContent').width();
        var pY = offset.top;
        $('.calenderContent').css('top', pY).css('left', pX).show();
    }

    $.ajax({
        type: "GET",
        url: "/lt/Functions/Kalender_json.aspx",
        data: "date=" + selectedDate + "&epslanguage=" + lang,
        dataType: "json",
        queue: "calender",
        cancelExisting: true,
        success: function(res) {
            procesCalenderData(res);
        }
    });

}

/* -------------------------- PROCESS CALENDER DATA FOR SELECTED DATE -------------------------- */

function procesCalenderData(res) {
    $('.calenderContent .boxContent').html('').append('<br />').append('<br />').animate({ border: 0 }, 500,
		function() {
		    $(this).empty();
		    $(this).append('<span class="date">' + res.dateString + '</span>').append('<ul class="calenderResult"></ul>');

		    $(res.result).each(
				function() {
				    var crTime = "";

				    if (this.time.length < 1 && this.place.length < 1) {
				        crTime = "";
				    }
				    else if (this.time.length > 0 && this.place.length < 1) {
				        crTime = "<span class='crTime'>" + this.time + "</span>";
				    }
				    else {
				        crTime = "<span class='crTime'>" + this.time + ": " + this.place + "</span>";
				    }

				    $('.calenderResult')
					.append('<li>' + crTime + '<span class="crText">' + this.text + '</span></li>')
					.css('background-color', '#ffffff');
				}
			);

		    $('.calenderResult li:last').css('background-color', 'transparent');
		}
	);
}

/* -------------------------- BIND THE CLAENDER CONTENT BOX TO THE MOUSE CURSOR -------------------------- */

function moveCalenderBox(e) {
    var pX = e.pageX - $('.calenderContent').width() - 15;
    var pY = e.pageY;
    $('.calenderContent').css('top', pY).css('left', pX);
}

/* -------------------------- INIT -------------------------- */
$(document).ready(
	function() {
	    $('.calenderTable').hover(
			function(e) {
			    e.stopPropagation();
			    e.cancelBubble = true;
			    if (isIE6() == false && isIE7() == false) {
			        $(window).bind('mousemove', function(e) { moveCalenderBox(e); });
			        $('.calenderContent').show();
			    }
			},
			function(e) {
			    e.stopPropagation();
			    e.cancelBubble = true;
			    $(window).unbind('mousemove');
			    $('.calenderContent').hide();
			}
		);

	    $('.cHead').hover(
			function(e) {
			    e.stopPropagation();
			    $('.calenderContent').hide();
			    return false;
			},
			function(e) {
			    e.stopPropagation();
			    return false;
			}
		);

	    //$('#calenderOptionsBtn').bind('click', function () {$('.calenderView').fadeOut(300, function () {$('#calenderOptions').fadeIn(300);}); return false;});
	    //$('#calenderOptions .return').bind('click', function () {$('#calenderOptions').fadeOut(300, function () {$('.calenderView').fadeIn(300);}); return false;});

	    $('.cWeekRow a').hoverIntent({ sensitivity: 1, interval: 200, over: getCalenderData, timeout: 0, out: returnFalse });

	    //$('.cWeekRow a').hoverIntent ( getCalenderData, returnFalse);
	}
);



/* file: form.js */

// JavaScript Document

/* ======================== GLOBAL SETTINGS ======================== */
var selectButtonWidth = 25;
var selectBoxHeight = 23;
var selctListShadeWidth = 12;
var $selctListHoverColor = '#cc0000';

/* ======================== PLUG-IN ======================== */

jQuery.fn.margin = function() {
    var margin = new Array();
    margin['top'] = parseInt($(this).css('marginTop').replace('px', ''));
    margin['right'] = parseInt($(this).css('marginRight').replace('px', ''));
    margin['bottom'] = parseInt($(this).css('marginBottom').replace('px', ''));
    margin['left'] = parseInt($(this).css('marginLeft').replace('px', ''));

    return margin;
}

jQuery.fn.padding = function() {
    var padding = new Array();
    padding['top'] = parseInt($(this).css('paddingTop').replace('px', ''));
    padding['right'] = parseInt($(this).css('paddingRight').replace('px', ''));
    padding['bottom'] = parseInt($(this).css('paddingBottom').replace('px', ''));
    padding['left'] = parseInt($(this).css('paddingLeft').replace('px', ''));

    return padding;
}

jQuery.fn.cssDim = function() {
    var cssDim = new Array();
    cssDim['width'] = parseInt($(this).css('width').replace('px', ''));
    cssDim['height'] = parseInt($(this).css('height').replace('px', ''));

    return cssDim;
}

jQuery.fn.relativeIndex = function() {
    return this.parent().children().index(this);
}


function bgPos(obj) {
    return parseInt($(obj).css('marginTop'));
}

function elmPos(obj) {
    return $(obj).offset();
}


/* ======================== CHECKBOX ======================== */
function f_checkbox(obj) {
    var offset = $(obj).offset();
    var width = $(obj).width();
    var initPos = 0;

    if (obj.checked) {
        initPos = -50;
    }

    var styled = $('<span></span>').addClass('checkbox').append($('<span></span>').css('margin-top', initPos))
	.click(
		function() {
		    if (obj.checked)
		        $('span:not(.checkbox, .label)', this).css('margin-top', 0);
		    else
		        $('span:not(.checkbox, .label)', this).css('margin-top', '-50px');
		}
	)
	.mousedown(
		function() {
		    if (bgPos($('span:not(.checkbox, .label)', this)) == -50)
		        $('span:not(.checkbox, .label)', this).css('margin-top', '-75px');
		    else
		        $('span:not(.checkbox, .label)', this).css('margin-top', '-25px');
		}
	);

    $(obj).parent('label')
	.click(
		function(e) {
		    e.preventDefault();
		    obj.checked = !obj.checked;

		    $(obj).trigger('change');

		    if (obj.checked)
		        $('span:not(.checkbox, .label)', this).css('margin-top', '-50px');
		    else
		        $('span:not(.checkbox, .label)', this).css('margin-top', 0);

		}
	);
    $(obj).css('display', 'none').after(styled);
}


/* ======================== RADIO ======================== */
function f_radio(obj) {
    var offset = $(obj).offset();
    var width = $(obj).width();
    var initPos = 0;
    var name = $(obj).attr('name');

    if (obj.checked)
        initPos = -50;

    var styled = $('<span></span>').addClass('radio').append($('<span></span>').css('margin-top', initPos))
	.click(
		function(e) {


		    $('input[name=' + name + ']').next('span.radio').children('span').css('marginTop', 0);
		    $('span:not(.label) span', this).css('marginTop', '-50px');
		}
	)
	.mousedown(
		function(e) {
		    var testar = bgPos($('span:not(.radio, .label)', this));

		    if (testar == -50)
		        $('span:not(.radio, .label)', this).css('marginTop', '-75px');
		    else
		        $('span:not(.radio, .label)', this).css('marginTop', '-25px');
		}
	);


    $(obj).parent('label')
	.click(
		function(e) {
		    e.preventDefault();
		    $('input:radio[@name=' + name + ']').each(
				function() {
				    this.checked = false;
				    $(this).next('span.radio').children('span').css('marginTop', 0);
				}
			);

		    obj.checked = true;
		    $(obj).trigger('change');


		    $('span:not(.label) span', this).css('marginTop', '-50px');

		}
	);

    $(obj).css('display', 'none').after(styled);
}


/* ======================== SELECT ======================== */
function f_select(obj, elm_index) {
    $(obj).parent().css({ position: 'relative' });
    var $objParent = $(obj).parent();
    var $document = $(document); 																				// Reference to the document node.
    //var $posAbs			= $(obj).offset({border: true, padding: true, margin: true, relativeTo: $document});			// Stores the position of the selectlist.
    var $posAbs = null;
    var $width = $(obj).width(); 																			// Stores the element width.
    var $height = $(obj).height(); 																			// Stores the element height.
    var $objCssDim = $(obj).cssDim();
    var $pCssDim = $($objParent).cssDim();
    var $margin = $(obj).margin(); 																			// Stores the margin value for top, right, bottom & left.
    var $padding = $(obj).padding(); 																			// Stores the padding value for top, right, bottom, & left.
    var $identity = 'selectBox_' + elm_index; 																	// Stores the current element index for usage as reference.


    //Browser tuning IE6 & 7
    if ($.browser.msie && $width == 0)																// MSIE can't read dimensions of an element nested by a 
    {																								// parent element defined as display none.
        $width = $objCssDim.width; 																	// If the select box will appear in a hidden form,
        $($objParent).height($pCssDim.height); 															// the dimensions has to be defined as inline style atributes.

        if ($width == 'undefined')
            $width = 0;
    }
    else if ($.browser.msie && $.browser.version < 7) {
        $($objParent).height($($objParent).height());
    }

    //Browser tuning Firefox & Safari & Opera
    if ($.browser.mozilla || $.browser.safari || $.browser.opera)
        $width -= 3;


    var $listContent = $('<div class="SelectListContent"></div>');

    var $optionList = $('' +
							'<div class="sel_box selectList ' + $identity + '">' +
							'<div class="sel_nw"><div class="sel_ne"><div class="sel_n"></div></div></div>' +
							'<div class="sel_s"><div class="sel_sw"></div><div class="sel_se"></div></div></div>')
							.css({ display: 'none', width: $width - selctListShadeWidth + 'px' });

    var $styled = $('' +
								 '<span class="select">' +
								 '	<span class="test">' +
								 '		<span class="left"></span>' +
								 '		<span class="middle"></span>' +
								 '		<span class="right"></span>' +
								 '	</span>' +
								 '</span>' +
								 '')
								.css({ width: $width - selectButtonWidth + 'px' })
								.click(
									function() {
									    if ($($optionList).css('display') == 'none') {
									        var $posAbs = $(this).offset({ border: true, padding: true, margin: true, relativeTo: $document });
									        $width = $(this).width();
									        $('.' + $identity).css({ top: $posAbs.top + 24, left: $posAbs.left - 4, width: $width + selctListShadeWidth });
									        $('.' + $identity).fadeIn(300);
									    }
									    else {
									        $('.' + $identity).fadeOut(300);
									    }
									}
								);



    $('option', obj).each(
									function() {
									    var $index = $(this).relativeIndex();
									    var selected = false;

									    if (this.selected) {
									        $('span.middle', $styled).text($(this).text());
									        selected = true;
									    }

									    var $listItem = $('<div class="listItem">' + $(this).html() + '</div>')
											.click(
												function() {
												    $(this).addClass('selected').siblings().removeClass('selected');
												    $('span.middle', $styled).hide().text($(this).text()).show(300);
												    $('option', obj).removeAttr('selected').eq($index).attr('selected', true);
												    $(obj).trigger('change');
												    $('.' + $identity).fadeOut(300);
												    return false;
												}
											)
											.hover(
												function() {

												    $(this).addClass('hover');

												},
												function() {

												    $(this).removeClass('hover');

												}
											);

									    if (selected == true)
									        $($listItem).addClass('selected').appendTo($listContent);
									    else
									        $($listItem).appendTo($listContent);
									}
								);

    $(obj).css('display', 'none');
    $('body').append($optionList);
    $('.sel_n', '.' + $identity).append($listContent);
    $(obj).after($styled);
}


/* ======================== SELECT ======================== */
function f_text(obj, elm_index) {
    var $width = $(obj).width(); 																			// Stores the element width.

    var $left = $('<span class="left"></span>');
    var $right = $('<span class="right"></span>');
    var $middle = $('<span class="middle"></span>');
    var $wrapper = $('<span class="test"></span>');
    var $textfield = $('<span class="text"></span>').css('width', $width);

    $(obj).wrap($textfield).wrap($wrapper).before($left).after($right).wrap($middle);

    var $leftWidth = $(obj).parent().prev().width();
    var $rightWidth = $(obj).parent().next().width();

    $(obj).css({ background: 'transparent', border: 'none' }).css('width', $width - $leftWidth - $rightWidth);

    $(obj).focus(
		function() {
		    if ($(this).val() == $(this).attr('alt'))
		        $(this).val('');
		}
	);

    $(obj).blur(
		function() {
		    if ($(this).val() == '')
		        $(this).val($(this).attr('alt'));
		}
	);
}

$(window).load(
	function() {
	    $('.styled').each(
			function(index) {
			    if ($(this).attr('type') == 'checkbox')
			        f_checkbox(this);
			    else if ($(this).attr('type') == 'radio')
			        f_radio(this);
			    else if (this.tagName == 'SELECT')
			        f_select(this, index);
			    else if ($(this).attr('type') == 'text' || $(this).attr('type') == 'password')
			        f_text(this, index);
			}
		);
	}
);





/* file: filter.js */
jQuery.fn.pos = function() {
    var pos = new Array();
    pos['top'] = parseInt($(this).css('top').replace('px', ''));
    pos['right'] = parseInt($(this).css('right').replace('px', ''));
    pos['bottom'] = parseInt($(this).css('bottom').replace('px', ''));
    pos['left'] = parseInt($(this).css('left').replace('px', ''));

    return pos;
}

/* ================ RENDER SLIDER ================ */
function filter_renderSlider(obj, index) {
    var s_min = 0;
    var s_max = 2;
    var s_range = false;
    var s_steps = 10;
    var s_stepping = .3;
    var s_axis = 'vertical';
    var s_indexLen = $('.slider').length - 1;

    $('input', obj).val(2);
    $('<span><span></span></span>').prependTo(obj);

    $('span:first', obj).slider(
		{
		    min: s_min,
		    max: s_max,
		    range: s_range,
		    axis: s_axis,
		    steps: s_steps,
		    stepping: s_stepping,
		    start: function() { $('a', this).css('color', 'transparent'); },
		    stop: function(e, ui) { $(this).next('input').val(s_max - ui.value + 1); },
		    change: function() { filter_postData(); }
		}
	);

    if (index == s_indexLen)
        $(obj).css({ width: 51, overflow: 'hidden' });
}

/* ================ POST DATA ================ */
function filter_postData() {

    var filterResultUrl = $('.filterResultUrl:first').val();
    var qry = '';
    var chk = 'o1=';
    var txt = '';
    var sel = '';

    $('#filter input:checkbox').each(
		function(index) {
		    if (this.checked)
		        chk += (index + 1) + ",";
		}
	);

    $('#filter select').each(
		function() {
		    sel += $(this).attr('name') + '=' + $(this).val() + '&';
		}
	);

    $('#filter input:text').each(
		function() {
		    txt += $(this).attr('name') + '=' + $(this).val() + '&';
		}
	);


    chk = chk.substring(0, chk.length - 1);
    qry += chk;
    qry += "&" + txt;
    qry += sel;
    qry = qry.substring(0, qry.length - 1);

    $.ajax({
        type: "GET",
        url: filterResultUrl,
        data: qry,
        dataType: "json",
        queue: "filter",
        cancelExisting: true,
        beforeSend: function() {
            applyLoader();
        },
        success: function(data) {
            filter_processData(data);
        },
        error: function() {
            alert("An error occurred while processing the filter result...");
        }
    });
}

/* ================ APPLY LOADER ================ */
function applyLoader() {
    $('#results').html('');
    $('#results').append('<div id="filterLoader"></div>');
}

/* ================ FILTER_PROCESS DATA ================ */
function filter_processData(data) {
    $('#filterLoader').remove();
    var resultLen = $(data.result).size();
    $('#results').html('').width(resultLen * 93).css('left', 0);

    $(data.result).each(
		function(index) {
		    var resultItem = $('<a class="filterResultItem" href="' + this.link + '"><img src="' + this.imgTN + '" /><span class="filterHeader">' + this.name + '</span><span class="filterDescription">' + this.description + '</span></a>').css('display', 'none');

		    $('img', resultItem).hoverIntent({ sensitivity: 1, interval: 200, over: viewResultItemData, timeout: 0, out: returnFalse });

		    $('#results').append(resultItem);

		    var time = index * 250 + 300;
		    $('#results a:lt(8)').fadeIn(time);
		    $('#results a:gt(7)').show();

		}
	);
}

/* ================ RESULT ARROWS ================ */
function stepLeft() {
    var position = $('#results').pos();

    if (position.left < 0)
        $('#results').animate({ left: position.left + (7 * 93) }, 300);
}

function stepRight() {
    var resultsWidth = $('#results').width();
    var position = $('#results').pos();

    if (position.left * -1 < resultsWidth - (7 * 93))
        $('#results').animate({ left: position.left - (7 * 93) }, 300);
}

/* ================ VIEW RESULT DATA ================ */
function viewResultItemData(e) {

    var obj = $(this);

    if (isIE6() == true || isIE7() == true) {
        var offset = $(obj).offset();
        var pX = offset.left + ($(obj).width() / 2) - $('.filterHoverBox').width() / 2;
        var pY = offset.top + $(obj).height() - 10;
        $('.filterHoverBox').css('top', pY).css('left', pX).show();
    }

    if (e.type == 'mouseover') {
        $('.filterHoverBox .boxContent').html('').append('<br /><br />').animate({ opacity: 1 }, 400,
			function() {
			    $('.filterHoverBox .boxContent').html('');

			    $(obj).siblings('span').each(
					function() {
					    //$('.filterHoverBox .boxContent').append($(this).text());	
					    $(this).clone().appendTo('.filterHoverBox .boxContent');
					}
				);
			}
		);
    }
    else
        $('.filterHoverBox .boxContent').html('').append('<br /><br />');
}

/* -------------------------- FUNCTION TO DETECT IE6 -------------------------- */
// Remove this function
function isIE6() {
    var state = false;
    if ($.browser.msie)
        state = true;

    if (state == true && $.browser.version > 6)
        state = false;

    if (state == false)
        return false;
    else
        return true;
}

/* -------------------------- FUNCTION TO DETECT IE7 -------------------------- */
// Remove this function
function isIE7() {
    var state = false;
    if ($.browser.msie)
        state = true;

    if (state == true && $.browser.version < 7)
        state = false;

    if (state == false)
        return false;
    else
        return true;
}

// Remove this function
function returnFalse() {
    return false;
}

/* ================ MOVE THE RESULT HOVER BOX ================ */
function moveResultHoverBox(e) {
    var pX = e.pageX - $('.filterHoverBox').width() / 2;
    var pY = e.pageY + 25;
    $('.filterHoverBox').css('top', pY).css('left', pX);
}


$(document).ready(
	function() {
	    $('#filter').show();
	    $('.componentAreaFallback').hide();

	    //If IE6
	    if (isIE6() == true) {
	        $('#titleText img').pngfix();
	    }
	    // Render the sliders
	    $(".slider").each(function(index) { filter_renderSlider(this, index); });

	    //Adds name attribute to selectboxes and checkboxes
	    $('#filter input:checkbox').each(
			function(index) {
			    var name = 'o' + (index + 1);
			    $(this).attr('name', name);
			}
		);

	    // Adds event listeners to form elements
	    $('#filter select').change(function() { filter_postData(); });
	    $('#filter input:checkbox').change(function() { filter_postData(); });


	    // Adds click event for result arrows
	    $('#filter #resultArrowRight').click(function() { stepRight(); });
	    $('#filter #resultArrowLeft').click(function() { stepLeft(); });

	    // Show/hide the control panel

	    $('#filter #titleText').toggle(
			function() {
			    $('#filter input:first').trigger('change');
			    $('#filter .contentArea').slideDown(300,
					function() {
					    setColumnHeight();
					}
				);
			    $('.ui-slider-handle').each(
					function(index) {
					    var time = index * 150 + 300;
					    $(this).animate({ top: 84 + 'px' }, time).animate({ top: 42 + 'px' }, 500);
					}
				);
			},
			function() {
			    $('#filter .contentArea').slideUp(300,
					function() {
					    setColumnHeight();
					}
				);
			}
		);

	    // Mouse Over event for resultList
	    $('#filter #results').hover(
			function(e) {
			    if (isIE6() == false || isIE7() == false) {
			        $('.filterHoverBox').show();
			        $(window).bind('mousemove', function(e) { moveResultHoverBox(e); });
			    }

			},
			function(e) {
			    $('.filterHoverBox .boxContent').html('').append('<br /><br />');
			    $('.filterHoverBox').hide();
			    $(window).unbind('mousemove');
			}
		);

	    $('#filter #titleText').trigger('click');
	}
);








/* file: sifr.js */
/*=:project
scalable Inman Flash Replacement (sIFR) version 3, revision 419

=:file
Copyright: 2006 Mark Wubben.
Author: Mark Wubben, <http://novemberborn.net/>

=:history
* IFR: Shaun Inman
* sIFR 1: Mike Davidson, Shaun Inman and Tomas Jogin
* sIFR 2: Mike Davidson, Shaun Inman, Tomas Jogin and Mark Wubben

=:license
This software is licensed and provided under the CC-GNU LGPL.
See <http://creativecommons.org/licenses/LGPL/2.1/>    
*/

var sIFR = new function() { var O = this; var E = { ACTIVE: "sIFR-active", REPLACED: "sIFR-replaced", IGNORE: "sIFR-ignore", ALTERNATE: "sIFR-alternate", CLASS: "sIFR-class", LAYOUT: "sIFR-layout", FLASH: "sIFR-flash", FIX_FOCUS: "sIFR-fixfocus", DUMMY: "sIFR-dummy" }; E.IGNORE_CLASSES = [E.REPLACED, E.IGNORE, E.ALTERNATE]; this.MIN_FONT_SIZE = 6; this.MAX_FONT_SIZE = 126; this.FLASH_PADDING_BOTTOM = 5; this.VERSION = "419"; this.isActive = false; this.isEnabled = true; this.fixHover = true; this.autoInitialize = true; this.setPrefetchCookie = true; this.cookiePath = "/"; this.domains = []; this.forceWidth = true; this.fitExactly = false; this.forceTextTransform = true; this.useDomLoaded = true; this.useStyleCheck = false; this.hasFlashClassSet = false; this.repaintOnResize = true; this.replacements = []; var L = 0; var R = false; function Y() { } function D(c) { function d(e) { return e.toLocaleUpperCase() } this.normalize = function(e) { return e.replace(/\n|\r|\xA0/g, D.SINGLE_WHITESPACE).replace(/\s+/g, D.SINGLE_WHITESPACE) }; this.textTransform = function(e, f) { switch (e) { case "uppercase": return f.toLocaleUpperCase(); case "lowercase": return f.toLocaleLowerCase(); case "capitalize": return f.replace(/^\w|\s\w/g, d) } return f }; this.toHexString = function(e) { if (e.charAt(0) != "#" || e.length != 4 && e.length != 7) { return e } e = e.substring(1); return "0x" + (e.length == 3 ? e.replace(/(.)(.)(.)/, "$1$1$2$2$3$3") : e) }; this.toJson = function(g, f) { var e = ""; switch (typeof (g)) { case "string": e = '"' + f(g) + '"'; break; case "number": case "boolean": e = g.toString(); break; case "object": e = []; for (var h in g) { if (g[h] == Object.prototype[h]) { continue } e.push('"' + h + '":' + this.toJson(g[h])) } e = "{" + e.join(",") + "}"; break } return e }; this.convertCssArg = function(e) { if (!e) { return {} } if (typeof (e) == "object") { if (e.constructor == Array) { e = e.join("") } else { return e } } var l = {}; var m = e.split("}"); for (var h = 0; h < m.length; h++) { var k = m[h].match(/([^\s{]+)\s*\{(.+)\s*;?\s*/); if (!k || k.length != 3) { continue } if (!l[k[1]]) { l[k[1]] = {} } var g = k[2].split(";"); for (var f = 0; f < g.length; f++) { var n = g[f].match(/\s*([^:\s]+)\s*\:\s*([^;]+)/); if (!n || n.length != 3) { continue } l[k[1]][n[1]] = n[2].replace(/\s+$/, "") } } return l }; this.extractFromCss = function(g, f, i, e) { var h = null; if (g && g[f] && g[f][i]) { h = g[f][i]; if (e) { delete g[f][i] } } return h }; this.cssToString = function(f) { var g = []; for (var e in f) { var j = f[e]; if (j == Object.prototype[e]) { continue } g.push(e, "{"); for (var i in j) { if (j[i] == Object.prototype[i]) { continue } var h = j[i]; if (D.UNIT_REMOVAL_PROPERTIES[i]) { h = parseInt(h, 10) } g.push(i, ":", h, ";") } g.push("}") } return g.join("") }; this.escape = function(e) { return escape(e).replace(/\+/g, "%2B") }; this.encodeVars = function(e) { return e.join("&").replace(/%/g, "%25") }; this.copyProperties = function(g, f) { for (var e in g) { if (f[e] === undefined) { f[e] = g[e] } } return f }; this.domain = function() { var f = ""; try { f = document.domain } catch (g) { } return f }; this.domainMatches = function(h, g) { if (g == "*" || g == h) { return true } var f = g.lastIndexOf("*"); if (f > -1) { g = g.substr(f + 1); var e = h.lastIndexOf(g); if (e > -1 && (e + g.length) == h.length) { return true } } return false }; this.uriEncode = function(e) { return encodeURI(decodeURIComponent(e)) }; this.delay = function(f, h, g) { var e = Array.prototype.slice.call(arguments, 3); setTimeout(function() { h.apply(g, e) }, f) } } D.UNIT_REMOVAL_PROPERTIES = { leading: true, "margin-left": true, "margin-right": true, "text-indent": true }; D.SINGLE_WHITESPACE = " "; function U(e) { var d = this; function c(g, j, h) { var k = d.getStyleAsInt(g, j, e.ua.ie); if (k == 0) { k = g[h]; for (var f = 3; f < arguments.length; f++) { k -= d.getStyleAsInt(g, arguments[f], true) } } return k } this.getBody = function() { return document.getElementsByTagName("body")[0] || null }; this.querySelectorAll = function(f) { return window.parseSelector(f) }; this.addClass = function(f, g) { if (g) { g.className = ((g.className || "") == "" ? "" : g.className + " ") + f } }; this.removeClass = function(f, g) { if (g) { g.className = g.className.replace(new RegExp("(^|\\s)" + f + "(\\s|$)"), "").replace(/^\s+|(\s)\s+/g, "$1") } }; this.hasClass = function(f, g) { return new RegExp("(^|\\s)" + f + "(\\s|$)").test(g.className) }; this.hasOneOfClassses = function(h, g) { for (var f = 0; f < h.length; f++) { if (this.hasClass(h[f], g)) { return true } } return false }; this.ancestorHasClass = function(g, f) { g = g.parentNode; while (g && g.nodeType == 1) { if (this.hasClass(f, g)) { return true } g = g.parentNode } return false }; this.create = function(f, g) { var h = document.createElementNS ? document.createElementNS(U.XHTML_NS, f) : document.createElement(f); if (g) { h.className = g } return h }; this.getComputedStyle = function(h, i) { var f; if (document.defaultView && document.defaultView.getComputedStyle) { var g = document.defaultView.getComputedStyle(h, null); f = g ? g[i] : null } else { if (h.currentStyle) { f = h.currentStyle[i] } } return f || "" }; this.getStyleAsInt = function(g, i, f) { var h = this.getComputedStyle(g, i); if (f && !/px$/.test(h)) { return 0 } return parseInt(h) || 0 }; this.getWidthFromStyle = function(f) { return c(f, "width", "offsetWidth", "paddingRight", "paddingLeft", "borderRightWidth", "borderLeftWidth") }; this.getHeightFromStyle = function(f) { return c(f, "height", "offsetHeight", "paddingTop", "paddingBottom", "borderTopWidth", "borderBottomWidth") }; this.getDimensions = function(j) { var h = j.offsetWidth; var f = j.offsetHeight; if (h == 0 || f == 0) { for (var g = 0; g < j.childNodes.length; g++) { var k = j.childNodes[g]; if (k.nodeType != 1) { continue } h = Math.max(h, k.offsetWidth); f = Math.max(f, k.offsetHeight) } } return { width: h, height: f} }; this.getViewport = function() { return { width: window.innerWidth || document.documentElement.clientWidth || this.getBody().clientWidth, height: window.innerHeight || document.documentElement.clientHeight || this.getBody().clientHeight} }; this.blurElement = function(g) { try { g.blur(); return } catch (h) { } var f = this.create("input"); f.style.width = "0px"; f.style.height = "0px"; g.parentNode.appendChild(f); f.focus(); f.blur(); f.parentNode.removeChild(f) } } U.XHTML_NS = "http://www.w3.org/1999/xhtml"; function H(r) { var g = navigator.userAgent.toLowerCase(); var q = (navigator.product || "").toLowerCase(); var h = navigator.platform.toLowerCase(); this.parseVersion = H.parseVersion; this.macintosh = /^mac/.test(h); this.windows = /^win/.test(h); this.quicktime = false; this.opera = /opera/.test(g); this.konqueror = /konqueror/.test(q); this.ie = false/*@cc_on || true@*/; this.ieSupported = this.ie && !/ppc|smartphone|iemobile|msie\s5\.5/.test(g)/*@cc_on && @_jscript_version >= 5.5@*/; this.ieWin = this.ie && this.windows/*@cc_on && @_jscript_version >= 5.1@*/; this.windows = this.windows && (!this.ie || this.ieWin); this.ieMac = this.ie && this.macintosh/*@cc_on && @_jscript_version < 5.1@*/; this.macintosh = this.macintosh && (!this.ie || this.ieMac); this.safari = /safari/.test(g); this.webkit = !this.konqueror && /applewebkit/.test(g); this.khtml = this.webkit || this.konqueror; this.gecko = !this.webkit && q == "gecko"; this.ieVersion = this.ie && /.*msie\s(\d\.\d)/.exec(g) ? this.parseVersion(RegExp.$1) : "0"; this.operaVersion = this.opera && /.*opera(\s|\/)(\d+\.\d+)/.exec(g) ? this.parseVersion(RegExp.$2) : "0"; this.webkitVersion = this.webkit && /.*applewebkit\/(\d+).*/.exec(g) ? this.parseVersion(RegExp.$1) : "0"; this.geckoVersion = this.gecko && /.*rv:\s*([^\)]+)\)\s+gecko/.exec(g) ? this.parseVersion(RegExp.$1) : "0"; this.konquerorVersion = this.konqueror && /.*konqueror\/([\d\.]+).*/.exec(g) ? this.parseVersion(RegExp.$1) : "0"; this.flashVersion = 0; if (this.ieWin) { var l; var o = false; try { l = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7") } catch (m) { try { l = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); this.flashVersion = this.parseVersion("6"); l.AllowScriptAccess = "always" } catch (m) { o = this.flashVersion == this.parseVersion("6") } if (!o) { try { l = new ActiveXObject("ShockwaveFlash.ShockwaveFlash") } catch (m) { } } } if (!o && l) { this.flashVersion = this.parseVersion((l.GetVariable("$version") || "").replace(/^\D+(\d+)\D+(\d+)\D+(\d+).*/g, "$1.$2.$3")) } } else { if (navigator.plugins && navigator.plugins["Shockwave Flash"]) { var n = navigator.plugins["Shockwave Flash"].description.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); var p = n.replace(/^\D*(\d+\.\d+).*$/, "$1"); if (/r/.test(n)) { p += n.replace(/^.*r(\d*).*$/, ".$1") } else { if (/d/.test(n)) { p += ".0" } } this.flashVersion = this.parseVersion(p); var j = false; for (var k = 0, c = this.flashVersion >= H.MIN_FLASH_VERSION; c && k < navigator.mimeTypes.length; k++) { var f = navigator.mimeTypes[k]; if (f.type != "application/x-shockwave-flash") { continue } if (f.enabledPlugin) { j = true; if (f.enabledPlugin.description.toLowerCase().indexOf("quicktime") > -1) { c = false; this.quicktime = true } } } if (this.quicktime || !j) { this.flashVersion = this.parseVersion("0") } } } this.flash = this.flashVersion >= H.MIN_FLASH_VERSION; this.transparencySupport = this.macintosh || this.windows; this.computedStyleSupport = this.ie || !!document.defaultView.getComputedStyle; this.fixFocus = this.gecko && this.windows; this.nativeDomLoaded = this.gecko || this.webkit && this.webkitVersion >= this.parseVersion("525") || this.konqueror && this.konquerorMajor > this.parseVersion("03") || this.opera; this.mustCheckStyle = this.khtml || this.opera; this.forcePageLoad = this.webkit && this.webkitVersion < this.parseVersion("523"); this.properDocument = typeof (document.location) == "object"; this.supported = this.flash && this.properDocument && (!this.ie || this.ieSupported) && this.computedStyleSupport && (!this.opera || this.operaVersion >= this.parseVersion("9.50")) && (!this.webkit || this.webkitVersion >= this.parseVersion("412")) && (!this.gecko || this.geckoVersion >= this.parseVersion("1.8.0.12")) && (!this.konqueror) } H.parseVersion = function(c) { return c.replace(/(^|\D)(\d+)(?=\D|$)/g, function(f, e, g) { f = e; for (var d = 4 - g.length; d >= 0; d--) { f += "0" } return f + g }) }; H.MIN_FLASH_VERSION = H.parseVersion("8"); function F(c) { this.fix = c.ua.ieWin && window.location.hash != ""; var d; this.cache = function() { d = document.title }; function e() { document.title = d } this.restore = function() { if (this.fix) { setTimeout(e, 0) } } } function S(l) { var e = null; function c() { try { if (l.ua.ie || document.readyState != "loaded" && document.readyState != "complete") { document.documentElement.doScroll("left") } } catch (n) { return setTimeout(c, 10) } i() } function i() { if (l.useStyleCheck) { h() } else { if (!l.ua.mustCheckStyle) { d(null, true) } } } function h() { e = l.dom.create("div", E.DUMMY); l.dom.getBody().appendChild(e); m() } function m() { if (l.dom.getComputedStyle(e, "marginLeft") == "42px") { g() } else { setTimeout(m, 10) } } function g() { if (e && e.parentNode) { e.parentNode.removeChild(e) } e = null; d(null, true) } function d(n, o) { l.initialize(o); if (n && n.type == "load") { if (document.removeEventListener) { document.removeEventListener("DOMContentLoaded", d, false) } if (window.removeEventListener) { window.removeEventListener("load", d, false) } } } function j() { l.prepareClearReferences(); if (document.readyState == "interactive") { document.attachEvent("onstop", f); setTimeout(function() { document.detachEvent("onstop", f) }, 0) } } function f() { document.detachEvent("onstop", f); k() } function k() { l.clearReferences() } this.attach = function() { if (window.addEventListener) { window.addEventListener("load", d, false) } else { window.attachEvent("onload", d) } if (!l.useDomLoaded || l.ua.forcePageLoad || l.ua.ie && window.top != window) { return } if (l.ua.nativeDomLoaded) { document.addEventListener("DOMContentLoaded", i, false) } else { if (l.ua.ie || l.ua.khtml) { c() } } }; this.attachUnload = function() { if (!l.ua.ie) { return } window.attachEvent("onbeforeunload", j); window.attachEvent("onunload", k) } } var Q = "sifrFetch"; function N(c) { var e = false; this.fetchMovies = function(f) { if (c.setPrefetchCookie && new RegExp(";?" + Q + "=true;?").test(document.cookie)) { return } try { e = true; d(f) } catch (g) { if (c.debug) { throw g } } if (c.setPrefetchCookie) { document.cookie = Q + "=true;path=" + c.cookiePath } }; this.clear = function() { if (!e) { return } try { var f = document.getElementsByTagName("script"); for (var g = f.length - 1; g >= 0; g--) { var h = f[g]; if (h.type == "sifr/prefetch") { h.parentNode.removeChild(h) } } } catch (j) { } }; function d(f) { for (var g = 0; g < f.length; g++) { document.write('<script defer type="sifr/prefetch" src="' + f[g].src + '"><\/script>') } } } function b(e) { var g = e.ua.ie; var f = g && e.ua.flashVersion < e.ua.parseVersion("9.0.115"); var d = {}; var c = {}; this.fixFlash = f; this.register = function(h) { if (!g) { return } var i = h.getAttribute("id"); this.cleanup(i, false); c[i] = h; delete d[i]; if (f) { window[i] = h } }; this.reset = function() { if (!g) { return false } for (var j = 0; j < e.replacements.length; j++) { var h = e.replacements[j]; var k = c[h.id]; if (!d[h.id] && (!k.parentNode || k.parentNode.nodeType == 11)) { h.resetMovie(); d[h.id] = true } } return true }; this.cleanup = function(l, h) { var i = c[l]; if (!i) { return } for (var k in i) { if (typeof (i[k]) == "function") { i[k] = null } } c[l] = null; if (f) { window[l] = null } if (i.parentNode) { if (h && i.parentNode.nodeType == 1) { var j = document.createElement("div"); j.style.width = i.offsetWidth + "px"; j.style.height = i.offsetHeight + "px"; i.parentNode.replaceChild(j, i) } else { i.parentNode.removeChild(i) } } }; this.prepareClearReferences = function() { if (!f) { return } __flash_unloadHandler = function() { }; __flash_savedUnloadHandler = function() { } }; this.clearReferences = function() { if (f) { var j = document.getElementsByTagName("object"); for (var h = j.length - 1; h >= 0; h--) { c[j[h].getAttribute("id")] = j[h] } } for (var k in c) { if (Object.prototype[k] != c[k]) { this.cleanup(k, true) } } } } function K(d, g, f, c, e) { this.sIFR = d; this.id = g; this.vars = f; this.movie = null; this.__forceWidth = c; this.__events = e; this.__resizing = 0 } K.prototype = { getFlashElement: function() { return document.getElementById(this.id) }, getAlternate: function() { return document.getElementById(this.id + "_alternate") }, getAncestor: function() { var c = this.getFlashElement().parentNode; return !this.sIFR.dom.hasClass(E.FIX_FOCUS, c) ? c : c.parentNode }, available: function() { var c = this.getFlashElement(); return c && c.parentNode }, call: function(c) { var d = this.getFlashElement(); return Function.prototype.apply.call(d[c], d, Array.prototype.slice.call(arguments, 1)) }, attempt: function() { if (!this.available()) { return false } try { this.call.apply(this, arguments) } catch (c) { if (this.sIFR.debug) { throw c } return false } return true }, updateVars: function(c, e) { for (var d = 0; d < this.vars.length; d++) { if (this.vars[d].split("=")[0] == c) { this.vars[d] = c + "=" + e; break } } var f = this.sIFR.util.encodeVars(this.vars); this.movie.injectVars(this.getFlashElement(), f); this.movie.injectVars(this.movie.html, f) }, storeSize: function(c, d) { this.movie.setSize(c, d); this.updateVars(c, d) }, fireEvent: function(c) { if (this.available() && this.__events[c]) { this.sIFR.util.delay(0, this.__events[c], this, this) } }, resizeFlashElement: function(c, d, e) { if (!this.available()) { return } this.__resizing++; var f = this.getFlashElement(); f.setAttribute("height", c); this.updateVars("renderheight", c); this.storeSize("height", c); if (d !== null) { f.setAttribute("width", d); this.movie.setSize("width", d) } if (this.__events.onReplacement) { this.sIFR.util.delay(0, this.__events.onReplacement, this, this); delete this.__events.onReplacement } if (e) { this.sIFR.util.delay(0, function() { this.attempt("scaleMovie"); this.__resizing-- }, this) } else { this.__resizing-- } }, blurFlashElement: function() { if (this.available()) { this.sIFR.dom.blurElement(this.getFlashElement()) } }, resetMovie: function() { this.sIFR.util.delay(0, this.movie.reset, this.movie, this.getFlashElement(), this.getAlternate()) }, resizeAfterScale: function() { if (this.available() && this.__resizing == 0) { this.sIFR.util.delay(0, this.resize, this) } }, resize: function() { if (!this.available()) { return } this.__resizing++; var g = this.getFlashElement(); var f = g.offsetWidth; if (f == 0) { return } var e = g.getAttribute("width"); var l = g.getAttribute("height"); var m = this.getAncestor(); var o = this.sIFR.dom.getHeightFromStyle(m); g.style.width = "1px"; g.style.height = "1px"; m.style.minHeight = o + "px"; var c = this.getAlternate().childNodes; var n = []; for (var k = 0; k < c.length; k++) { var h = c[k].cloneNode(true); n.push(h); m.appendChild(h) } var d = this.sIFR.dom.getWidthFromStyle(m); for (var k = 0; k < n.length; k++) { m.removeChild(n[k]) } g.style.width = g.style.height = m.style.minHeight = ""; g.setAttribute("width", this.__forceWidth ? d : e); g.setAttribute("height", l); if (sIFR.ua.ie) { g.style.display = "none"; var j = g.offsetHeight; g.style.display = "" } if (d != f) { if (this.__forceWidth) { this.storeSize("width", d) } this.attempt("resize", d) } this.__resizing-- }, replaceText: function(g, j) { var d = this.sIFR.util.escape(g); if (!this.attempt("replaceText", d)) { return false } this.updateVars("content", d); var f = this.getAlternate(); if (j) { while (f.firstChild) { f.removeChild(f.firstChild) } for (var c = 0; c < j.length; c++) { f.appendChild(j[c]) } } else { try { f.innerHTML = g } catch (h) { } } return true }, changeCSS: function(c) { c = this.sIFR.util.escape(this.sIFR.util.cssToString(this.sIFR.util.convertCssArg(c))); this.updateVars("css", c); return this.attempt("changeCSS", c) }, remove: function() { if (this.movie && this.available()) { this.movie.remove(this.getFlashElement(), this.id) } } }; var X = new function() { this.create = function(p, n, j, i, f, e, g, o, l, h, m) { var k = p.ua.ie ? d : c; return new k(p, n, j, i, f, e, g, o, ["flashvars", l, "wmode", h, "bgcolor", m, "allowScriptAccess", "always", "quality", "best"]) }; function c(s, q, l, h, f, e, g, r, n) { var m = s.dom.create("object", E.FLASH); var p = ["type", "application/x-shockwave-flash", "id", f, "name", f, "data", e, "width", g, "height", r]; for (var o = 0; o < p.length; o += 2) { m.setAttribute(p[o], p[o + 1]) } var j = m; if (h) { j = W.create("div", E.FIX_FOCUS); j.appendChild(m) } for (var o = 0; o < n.length; o += 2) { if (n[o] == "name") { continue } var k = W.create("param"); k.setAttribute("name", n[o]); k.setAttribute("value", n[o + 1]); m.appendChild(k) } while (l.firstChild) { l.removeChild(l.firstChild) } l.appendChild(j); this.html = j.cloneNode(true) } c.prototype = { reset: function(e, f) { e.parentNode.replaceChild(this.html.cloneNode(true), e) }, remove: function(e, f) { e.parentNode.removeChild(e) }, setSize: function(e, f) { this.html.setAttribute(e, f) }, injectVars: function(e, g) { var h = e.getElementsByTagName("param"); for (var f = 0; f < h.length; f++) { if (h[f].getAttribute("name") == "flashvars") { h[f].setAttribute("value", g); break } } } }; function d(p, n, j, h, f, e, g, o, k) { this.dom = p.dom; this.broken = n; this.html = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="' + f + '" width="' + g + '" height="' + o + '" class="' + E.FLASH + '"><param name="movie" value="' + e + '"></param></object>'; var m = ""; for (var l = 0; l < k.length; l += 2) { m += '<param name="' + k[l] + '" value="' + k[l + 1] + '"></param>' } this.html = this.html.replace(/(<\/object>)/, m + "$1"); j.innerHTML = this.html; this.broken.register(j.firstChild) } d.prototype = { reset: function(f, g) { g = g.cloneNode(true); var e = f.parentNode; e.innerHTML = this.html; this.broken.register(e.firstChild); e.appendChild(g) }, remove: function(e, f) { this.broken.cleanup(f) }, setSize: function(e, f) { this.html = this.html.replace(e == "height" ? /(height)="\d+"/ : /(width)="\d+"/, '$1="' + f + '"') }, injectVars: function(e, f) { if (e != this.html) { return } this.html = this.html.replace(/(flashvars(=|\"\svalue=)\")[^\"]+/, "$1" + f) } } }; this.errors = new Y(O); var A = this.util = new D(O); var W = this.dom = new U(O); var T = this.ua = new H(O); var G = { fragmentIdentifier: new F(O), pageLoad: new S(O), prefetch: new N(O), brokenFlashIE: new b(O) }; this.__resetBrokenMovies = G.brokenFlashIE.reset; var J = { kwargs: [], replaceAll: function(d) { for (var c = 0; c < this.kwargs.length; c++) { O.replace(this.kwargs[c]) } if (!d) { this.kwargs = [] } } }; this.activate = function() { if (!T.supported || !this.isEnabled || this.isActive || !C() || a()) { return } G.prefetch.fetchMovies(arguments); this.isActive = true; this.setFlashClass(); G.fragmentIdentifier.cache(); G.pageLoad.attachUnload(); if (!this.autoInitialize) { return } G.pageLoad.attach() }; this.setFlashClass = function() { if (this.hasFlashClassSet) { return } W.addClass(E.ACTIVE, W.getBody() || document.documentElement); this.hasFlashClassSet = true }; this.removeFlashClass = function() { if (!this.hasFlashClassSet) { return } W.removeClass(E.ACTIVE, W.getBody()); W.removeClass(E.ACTIVE, document.documentElement); this.hasFlashClassSet = false }; this.initialize = function(c) { if (!this.isActive || !this.isEnabled) { return } if (R) { if (!c) { J.replaceAll(false) } return } R = true; J.replaceAll(c); if (O.repaintOnResize) { if (window.addEventListener) { window.addEventListener("resize", Z, false) } else { window.attachEvent("onresize", Z) } } G.prefetch.clear() }; this.replace = function(w, t) { if (!T.supported) { return } if (t) { w = A.copyProperties(w, t) } if (!R) { return J.kwargs.push(w) } if (this.onReplacementStart) { this.onReplacementStart(w) } var AL = w.elements || W.querySelectorAll(w.selector); if (AL.length == 0) { return } var v = M(w.src); var AQ = A.convertCssArg(w.css); var u = B(w.filters); var AM = w.forceSingleLine === true; var AR = w.preventWrap === true && !AM; var p = AM || (w.fitExactly == null ? this.fitExactly : w.fitExactly) === true; var AC = p || (w.forceWidth == null ? this.forceWidth : w.forceWidth) === true; var r = w.ratios || []; var AD = w.pixelFont === true; var q = parseInt(w.tuneHeight) || 0; var y = !!w.onRelease || !!w.onRollOver || !!w.onRollOut; if (p) { A.extractFromCss(AQ, ".sIFR-root", "text-align", true) } var s = A.extractFromCss(AQ, ".sIFR-root", "font-size", true) || "0"; var e = A.extractFromCss(AQ, ".sIFR-root", "background-color", true) || "#FFFFFF"; var n = A.extractFromCss(AQ, ".sIFR-root", "kerning", true) || ""; var AV = A.extractFromCss(AQ, ".sIFR-root", "opacity", true) || "100"; var k = A.extractFromCss(AQ, ".sIFR-root", "cursor", true) || "default"; var AO = parseInt(A.extractFromCss(AQ, ".sIFR-root", "leading")) || 0; var AI = w.gridFitType || (A.extractFromCss(AQ, ".sIFR-root", "text-align") == "right") ? "subpixel" : "pixel"; var h = this.forceTextTransform === false ? "none" : A.extractFromCss(AQ, ".sIFR-root", "text-transform", true) || "none"; s = /^\d+(px)?$/.test(s) ? parseInt(s) : 0; AV = parseFloat(AV) < 1 ? 100 * parseFloat(AV) : AV; var AB = w.modifyCss ? "" : A.cssToString(AQ); var AF = w.wmode || ""; if (!AF) { if (w.transparent) { AF = "transparent" } else { if (w.opaque) { AF = "opaque" } } } if (AF == "transparent") { if (!T.transparencySupport) { AF = "opaque" } else { e = "transparent" } } for (var AU = 0; AU < AL.length; AU++) { var AE = AL[AU]; if (W.hasOneOfClassses(E.IGNORE_CLASSES, AE) || W.ancestorHasClass(AE, E.ALTERNATE)) { continue } var AN = W.getDimensions(AE); var f = AN.height; var c = AN.width; var z = W.getComputedStyle(AE, "display"); if (!f || !c || !z || z == "none") { continue } c = W.getWidthFromStyle(AE); var m, AG; if (!s) { var AK = I(AE); m = Math.min(this.MAX_FONT_SIZE, Math.max(this.MIN_FONT_SIZE, AK.fontSize)); if (AD) { m = Math.max(8, 8 * Math.round(m / 8)) } AG = AK.lines; if (isNaN(AG) || !isFinite(AG) || AG == 0) { AG = 1 } if (AG > 1 && AO) { f += Math.round((AG - 1) * AO) } } else { m = s; AG = 1 } var d = W.create("span", E.ALTERNATE); var AW = AE.cloneNode(true); AE.parentNode.appendChild(AW); for (var AT = 0, AS = AW.childNodes.length; AT < AS; AT++) { d.appendChild(AW.childNodes[AT].cloneNode(true)) } if (w.modifyContent) { w.modifyContent(AW, w.selector) } if (w.modifyCss) { AB = w.modifyCss(AQ, AW, w.selector) } var o = P(AW, h, w.uriEncode); AW.parentNode.removeChild(AW); if (w.modifyContentString) { o.text = w.modifyContentString(o.text, w.selector) } if (o.text == "") { continue } f = Math.round(AG * m); var AJ = Math.round(AG * V(m, r) * m) + this.FLASH_PADDING_BOTTOM + q; var AA = AC ? c : "100%"; var AH = "sIFR_replacement_" + L++; var AP = ["id=" + AH, "content=" + A.escape(o.text), "width=" + c, "height=" + f, "renderheight=" + AJ, "link=" + A.escape(o.primaryLink.href || ""), "target=" + A.escape(o.primaryLink.target || ""), "size=" + m, "css=" + A.escape(AB), "cursor=" + k, "tunewidth=" + (w.tuneWidth || 0), "tuneheight=" + q, "offsetleft=" + (w.offsetLeft || ""), "offsettop=" + (w.offsetTop || ""), "fitexactly=" + p, "preventwrap=" + AR, "forcesingleline=" + AM, "antialiastype=" + (w.antiAliasType || ""), "thickness=" + (w.thickness || ""), "sharpness=" + (w.sharpness || ""), "kerning=" + n, "gridfittype=" + AI, "flashfilters=" + u, "opacity=" + AV, "blendmode=" + (w.blendMode || ""), "selectable=" + (w.selectable == null || AF != "" && !sIFR.ua.macintosh && sIFR.ua.gecko && sIFR.ua.geckoVersion >= sIFR.ua.parseVersion("1.9") ? "true" : w.selectable === true), "fixhover=" + (this.fixHover === true), "events=" + y, "delayrun=" + G.brokenFlashIE.fixFlash, "version=" + this.VERSION]; var x = A.encodeVars(AP); var g = new K(O, AH, AP, AC, { onReplacement: w.onReplacement, onRollOver: w.onRollOver, onRollOut: w.onRollOut, onRelease: w.onRelease }); g.movie = X.create(sIFR, G.brokenFlashIE, AE, T.fixFocus && w.fixFocus, AH, v, AA, AJ, x, AF, e); this.replacements.push(g); this.replacements[AH] = g; if (w.selector) { if (!this.replacements[w.selector]) { this.replacements[w.selector] = [g] } else { this.replacements[w.selector].push(g) } } d.setAttribute("id", AH + "_alternate"); AE.appendChild(d); W.addClass(E.REPLACED, AE) } G.fragmentIdentifier.restore() }; this.getReplacementByFlashElement = function(d) { for (var c = 0; c < O.replacements.length; c++) { if (O.replacements[c].id == d.getAttribute("id")) { return O.replacements[c] } } }; this.redraw = function() { for (var c = 0; c < O.replacements.length; c++) { O.replacements[c].resetMovie() } }; this.prepareClearReferences = function() { G.brokenFlashIE.prepareClearReferences() }; this.clearReferences = function() { G.brokenFlashIE.clearReferences(); G = null; J = null; delete O.replacements }; function C() { if (O.domains.length == 0) { return true } var d = A.domain(); for (var c = 0; c < O.domains.length; c++) { if (A.domainMatches(d, O.domains[c])) { return true } } return false } function a() { if (document.location.protocol == "file:") { if (O.debug) { O.errors.fire("isFile") } return true } return false } function M(c) { if (T.ie && c.charAt(0) == "/") { c = window.location.toString().replace(/([^:]+)(:\/?\/?)([^\/]+).*/, "$1$2$3") + c } return c } function V(d, e) { for (var c = 0; c < e.length; c += 2) { if (d <= e[c]) { return e[c + 1] } } return e[e.length - 1] || 1 } function B(g) { var e = []; for (var d in g) { if (g[d] == Object.prototype[d]) { continue } var c = g[d]; d = [d.replace(/filter/i, "") + "Filter"]; for (var f in c) { if (c[f] == Object.prototype[f]) { continue } d.push(f + ":" + A.escape(A.toJson(c[f], A.toHexString))) } e.push(d.join(",")) } return A.escape(e.join(";")) } function Z(d) { var e = Z.viewport; var c = W.getViewport(); if (e && c.width == e.width && c.height == e.height) { return } Z.viewport = c; if (O.replacements.length == 0) { return } if (Z.timer) { clearTimeout(Z.timer) } Z.timer = setTimeout(function() { delete Z.timer; for (var f = 0; f < O.replacements.length; f++) { O.replacements[f].resize() } }, 200) } function I(g) { var h, d; if (!T.ie) { h = W.getStyleAsInt(g, "lineHeight"); d = Math.floor(W.getStyleAsInt(g, "height") / h) } else { if (T.ie) { var h = W.getComputedStyle(g, "fontSize"); if (h.indexOf("px") > 0) { h = parseInt(h) } else { var f = g.innerHTML; g.style.visibility = "visible"; g.style.overflow = "visible"; g.style.position = "static"; g.style.zoom = "normal"; g.style.writingMode = "lr-tb"; g.style.width = g.style.height = "auto"; g.style.maxWidth = g.style.maxHeight = g.style.styleFloat = "none"; var i = g; var c = g.currentStyle.hasLayout; if (c) { g.innerHTML = '<div class="' + E.LAYOUT + '">X<br>X<br>X</div>'; i = g.firstChild } else { g.innerHTML = "X<br>X<br>X" } var e = i.getClientRects(); h = e[1].bottom - e[1].top; h = Math.ceil(h * 0.8); if (c) { g.innerHTML = '<div class="' + E.LAYOUT + '">' + f + "</div>"; i = g.firstChild } else { g.innerHTML = f } e = i.getClientRects(); d = e.length; if (c) { g.innerHTML = f } g.style.visibility = g.style.width = g.style.height = g.style.maxWidth = g.style.maxHeight = g.style.overflow = g.style.styleFloat = g.style.position = g.style.zoom = g.style.writingMode = "" } } } return { fontSize: h, lines: d} } function P(c, g, s) { s = s || A.uriEncode; var q = [], m = []; var k = null; var e = c.childNodes; var o = false, p = false; var j = 0; while (j < e.length) { var f = e[j]; if (f.nodeType == 3) { var t = A.textTransform(g, A.normalize(f.nodeValue)).replace(/</g, "&lt;"); if (o && p) { t = t.replace(/^\s+/, "") } m.push(t); o = /\s$/.test(t); p = false } if (f.nodeType == 1 && !/^(style|script)$/i.test(f.nodeName)) { var h = []; var r = f.nodeName.toLowerCase(); var n = f.className || ""; if (/\s+/.test(n)) { if (n.indexOf(E.CLASS) > -1) { n = n.match("(\\s|^)" + E.CLASS + "-([^\\s$]*)(\\s|$)")[2] } else { n = n.match(/^([^\s]+)/)[1] } } if (n != "") { h.push('class="' + n + '"') } if (r == "a") { var d = s(f.getAttribute("href") || ""); var l = f.getAttribute("target") || ""; h.push('href="' + d + '"', 'target="' + l + '"'); if (!k) { k = { href: d, target: l} } } m.push("<" + r + (h.length > 0 ? " " : "") + h.join(" ") + ">"); p = true; if (f.hasChildNodes()) { q.push(j); j = 0; e = f.childNodes; continue } else { if (!/^(br|img)$/i.test(f.nodeName)) { m.push("</", f.nodeName.toLowerCase(), ">") } } } if (q.length > 0 && !f.nextSibling) { do { j = q.pop(); e = f.parentNode.parentNode.childNodes; f = e[j]; if (f) { m.push("</", f.nodeName.toLowerCase(), ">") } } while (j == e.length - 1 && q.length > 0) } j++ } return { text: m.join("").replace(/^\s+|\s+$|\s*(<br>)\s*/g, "$1"), primaryLink: k || {}} } };
var parseSelector = (function() { var B = /\s*,\s*/; var A = /\s*([\s>+~(),]|^|$)\s*/g; var L = /([\s>+~,]|[^(]\+|^)([#.:@])/g; var F = /(^|\))[^\s>+~]/g; var M = /(\)|^)/; var K = /[\s#.:>+~()@]|[^\s#.:>+~()@]+/g; function H(R, P) { P = P || document.documentElement; var S = R.split(B), X = []; for (var U = 0; U < S.length; U++) { var N = [P], W = G(S[U]); for (var T = 0; T < W.length; ) { var Q = W[T++], O = W[T++], V = ""; if (W[T] == "(") { while (W[T++] != ")" && T < W.length) { V += W[T] } V = V.slice(0, -1) } N = I(N, Q, O, V) } X = X.concat(N) } return X } function G(N) { var O = N.replace(A, "$1").replace(L, "$1*$2").replace(F, D); return O.match(K) || [] } function D(N) { return N.replace(M, "$1 ") } function I(N, P, Q, O) { return (H.selectors[P]) ? H.selectors[P](N, Q, O) : [] } var E = { toArray: function(O) { var N = []; for (var P = 0; P < O.length; P++) { N.push(O[P]) } return N } }; var C = { isTag: function(O, N) { return (N == "*") || (N.toLowerCase() == O.nodeName.toLowerCase()) }, previousSiblingElement: function(N) { do { N = N.previousSibling } while (N && N.nodeType != 1); return N }, nextSiblingElement: function(N) { do { N = N.nextSibling } while (N && N.nodeType != 1); return N }, hasClass: function(N, O) { return (O.className || "").match("(^|\\s)" + N + "(\\s|$)") }, getByTag: function(N, O) { return O.getElementsByTagName(N) } }; var J = { "#": function(N, P) { for (var O = 0; O < N.length; O++) { if (N[O].getAttribute("id") == P) { return [N[O]] } } return [] }, " ": function(O, Q) { var N = []; for (var P = 0; P < O.length; P++) { N = N.concat(E.toArray(C.getByTag(Q, O[P]))) } return N }, ">": function(O, R) { var N = []; for (var Q = 0, S; Q < O.length; Q++) { S = O[Q]; for (var P = 0, T; P < S.childNodes.length; P++) { T = S.childNodes[P]; if (T.nodeType == 1 && C.isTag(T, R)) { N.push(T) } } } return N }, ".": function(O, Q) { var N = []; for (var P = 0, R; P < O.length; P++) { R = O[P]; if (C.hasClass([Q], R)) { N.push(R) } } return N }, ":": function(N, P, O) { return (H.pseudoClasses[P]) ? H.pseudoClasses[P](N, O) : [] } }; H.selectors = J; H.pseudoClasses = {}; H.util = E; H.dom = C; return H })();






/* file: sIFR-config.js */

var hamilton = {
    src: '/lt/fonts/hamilton2.swf'
};
sIFR.useStyleCheck = true;
sIFR.isEnabled = true;
sIFR.forceClear = true;
sIFR.useDomLoaded = true;
sIFR.fixWrap = true;
sIFR.autoInitialize = true;


sIFR.activate(hamilton);


sIFR.replace(
hamilton,
	{
	    selector: 'h1.tips'
	, css: { '.sIFR-root': { 'color': '#9bbd0a', 'letter-spacing': 0, 'font-weight': 'bold', 'text-transform': 'uppercase', 'leading': -2} }
	, filters: { DropShadow: { knockout: false, distance: 0, color: '#cccccc', strength: 0.3, 'blurX': 7, 'blurY': 7} }
	, wmode: 'transparent'
	, forceSingleLine: false
	, fixHover: true
	, forceWidth: true
	, fitExactly: true
	, tuneWidth: 5
	}
);

sIFR.replace(
hamilton,
	{
	    selector: 'h2.srl'
	, css: {
	    '.sIFR-root': { 'color': '#9bbd0a', 'letter-spacing': 0, 'font-weight': 'bold', 'text-transform': 'uppercase', 'leading': -2, 'cursor': 'pointer' }
		, 'a': { 'color': '#9bbd0a', 'letter-spacing': 0, 'font-weight': 'bold', 'text-decoration': 'none', 'text-transform': 'uppercase', 'leading': -2, 'cursor': 'pointer' }
		, 'a:hover': { 'color': '#9bbd0a', 'letter-spacing': 0, 'cursor': 'pointer' }
	}
	, filters: { DropShadow: { knockout: false, distance: 0, color: '#cccccc', strength: 0.3, 'blurX': 7, 'blurY': 7} }
	, wmode: 'transparent'
	, forceSingleLine: false
	, fixHover: true
	, forceWidth: true
	, fitExactly: true
	, tuneWidth: 5
	}
);


sIFR.replace(
hamilton,
	{
	    selector: '.categoryListHeader h2'
	, css: { '.sIFR-root': { 'color': '#9bbd0a', 'letter-spacing': 0, 'font-weight': 'bold', 'text-transform': 'uppercase', 'leading': -2, 'text-align': 'center'} }
	, filters: { DropShadow: { knockout: false, distance: 0, color: '#cccccc', strength: 0.3, 'blurX': 7, 'blurY': 7} }
	, wmode: 'transparent'
	, forceSingleLine: false
	, fixHover: true
	, forceWidth: true
	, fitExactly: false
	, tuneWidth: 5
	}
);


/* TEMPLATE EXTERNAL */
sIFR.replace(
hamilton,
	{
	    selector: '#external h1, #external h2, #external h3'
	, css: { '.sIFR-root': { 'color': '#89ab13', 'letter-spacing': 0, 'font-weight': 'bold', 'text-transform': 'uppercase', 'leading': -2} }
	, filters: { DropShadow: { knockout: false, distance: 0, color: '#cccccc', strength: 0.3, 'blurX': 7, 'blurY': 7} }
	, wmode: 'transparent'
	, forceSingleLine: false
	, fixHover: true
	, forceWidth: true
	, fitExactly: true
	, tuneWidth: 5
	}
);


/* TEMPLATE EDITORIAL */


/* SKIN HOSTAL */
sIFR.replace(
hamilton,
	{
	    selector: '#editorial.hostal h1, #editorial.hostal h2, #editorial.hostal h3'
	, css: { '.sIFR-root': { 'color': '#928255', 'letter-spacing': 0, 'font-weight': 'bold', 'text-transform': 'uppercase', 'leading': -2} }
	, filters: { DropShadow: { knockout: false, distance: 0, color: '#cccccc', strength: 0.3, 'blurX': 7, 'blurY': 7} }
	, wmode: 'transparent'
	, forceSingleLine: false
	, fixHover: true
	, forceWidth: true
	, fitExactly: true
	, tuneWidth: 5
	}
);

/* SKIN CE */
sIFR.replace(
hamilton,
	{
	    selector: '#editorial.ce h1, #editorial.ce h2, #editorial.ce h3'
	, css: { '.sIFR-root': { 'color': '#9476a5', 'letter-spacing': 0, 'font-weight': 'bold', 'text-transform': 'uppercase', 'leading': -2} }
	, filters: { DropShadow: { knockout: false, distance: 0, color: '#cccccc', strength: 0.3, 'blurX': 7, 'blurY': 7} }
	, wmode: 'transparent'
	, forceSingleLine: false
	, fixHover: true
	, forceWidth: true
	, fitExactly: true
	, tuneWidth: 5
	}
);

/* SKIN RONDO */
sIFR.replace(
hamilton,
	{
	    selector: '#editorial.rondo h1, #editorial.rondo h2, #editorial.rondo h3'
	, css: { '.sIFR-root': { 'color': '#ffffff', 'letter-spacing': 0, 'font-weight': 'bold', 'text-transform': 'uppercase', 'leading': -2} }
	, filters: { DropShadow: { knockout: false, distance: 0, color: '#cccccc', strength: 0.3, 'blurX': 7, 'blurY': 7} }
	, wmode: 'transparent'
	, forceSingleLine: false
	, fixHover: true
	, forceWidth: true
	, fitExactly: true
	, tuneWidth: 5
	}
);

/* SKIN VIKING */
sIFR.replace(
hamilton,
	{
	    selector: '#editorial.viking h1, #editorial.viking h2, #editorial.viking h3'
	, css: { '.sIFR-root': { 'color': '#6284a0', 'letter-spacing': 0, 'font-weight': 'bold', 'text-transform': 'uppercase', 'leading': -2} }
	, filters: { DropShadow: { knockout: false, distance: 0, color: '#cccccc', strength: 0.3, 'blurX': 7, 'blurY': 7} }
	, wmode: 'transparent'
	, forceSingleLine: false
	, fixHover: true
	, forceWidth: true
	, fitExactly: true
	, tuneWidth: 5
	}
);

/* SKIN MARIN */
sIFR.replace(
hamilton,
	{
	    selector: '#editorial.marin h1, #editorial.marin h2, #editorial.marin h3'
	, css: { '.sIFR-root': { 'color': '#9e9e9e', 'letter-spacing': 0, 'font-weight': 'bold', 'text-transform': 'uppercase', 'leading': -2} }
	, filters: { DropShadow: { knockout: false, distance: 0, color: '#cccccc', strength: 0.3, 'blurX': 7, 'blurY': 7} }
	, wmode: 'transparent'
	, forceSingleLine: false
	, fixHover: true
	, forceWidth: true
	, fitExactly: true
	, tuneWidth: 5
	}
);

/* SKIN KARRALUND */
sIFR.replace(
hamilton,
	{
	    selector: '#editorial.karralund h1, #editorial.karralund h2, #editorial.karralund h3'
	, css: { '.sIFR-root': { 'color': '#9bbd0a', 'letter-spacing': 0, 'font-weight': 'bold', 'text-transform': 'uppercase', 'leading': -2} }
	, filters: { DropShadow: { knockout: false, distance: 0, color: '#cccccc', strength: 0.3, 'blurX': 7, 'blurY': 7} }
	, wmode: 'transparent'
	, fixHover: true
	, forceWidth: true
	, fitExactly: true
	, tuneWidth: 5
	}
);

/* SKIN DEFAULT */
sIFR.replace(
hamilton,
	{
	    selector: '#editorial.default h1, #editorial.default h2, #editorial.default h3'
	, css: { '.sIFR-root': { 'color': '#9bbd0a', 'letter-spacing': 0, 'font-weight': 'bold', 'text-transform': 'uppercase', 'leading': -2} }
	, filters: { DropShadow: { knockout: false, distance: 0, color: '#cccccc', strength: 0.3, 'blurX': 7, 'blurY': 7} }
	, wmode: 'transparent'
	, fixHover: true
	, forceWidth: true
	, fitExactly: true
	, tuneWidth: 5
	}
);

/* SKIN CHRISTMAS */
sIFR.replace(
hamilton,
	{
	    selector: '#editorial.christmas h1, #editorial.christmas h2, #editorial.christmas h3'
	, css: { '.sIFR-root': { 'color': '#6284a0', 'letter-spacing': 0, 'font-weight': 'bold', 'text-transform': 'uppercase', 'leading': -2} }
	, filters: { DropShadow: { knockout: false, distance: 0, color: '#cccccc', strength: 0.3, 'blurX': 7, 'blurY': 7} }
	, wmode: 'transparent'
	, forceSingleLine: false
	, fixHover: true
	, forceWidth: true
	, fitExactly: true
	, tuneWidth: 5
	}
);


/* ================ LANDING CATEGORY ================ */

/* ---------------- SKIN DEFAULT ---------------- */
sIFR.replace(
hamilton,
	{
	    selector: '#LandingCategory.default h1, #LandingCategory.default h2, #LandingCategory.default h3'
	, css: { '.sIFR-root': { 'color': '#9bbd0a', 'letter-spacing': 0, 'font-weight': 'bold', 'text-transform': 'uppercase', 'leading': -2} }
	, filters: { DropShadow: { knockout: false, distance: 0, color: '#cccccc', strength: 0.3, 'blurX': 7, 'blurY': 7} }
	, wmode: 'transparent'
	, forceSingleLine: false
	, fixHover: true
	, forceWidth: true
	, fitExactly: true
	, tuneWidth: 5
	}
);

/* ---------------- SKIN CE ---------------- */
sIFR.replace(
hamilton,
	{
	    selector: '#LandingCategory.ce h1, #LandingCategory.ce h2, #LandingCategory.ce h3'
	, css: { '.sIFR-root': { 'color': '#9476a5', 'letter-spacing': 0, 'font-weight': 'bold', 'text-transform': 'uppercase', 'leading': -2} }
	, filters: { DropShadow: { knockout: false, distance: 0, color: '#cccccc', strength: 0.3, 'blurX': 7, 'blurY': 7} }
	, wmode: 'transparent'
	, forceSingleLine: false
	, fixHover: true
	, forceWidth: true
	, fitExactly: true
	, tuneWidth: 5
	}
);

/* ---------------- SKIN CHRISTMAS ---------------- */
sIFR.replace(
hamilton,
	{
	    selector: '#LandingCategory.christmas h1, #LandingCategory.christmas h2, #LandingCategory.christmas h3'
	, css: { '.sIFR-root': { 'color': '#6284a0', 'letter-spacing': 0, 'font-weight': 'bold', 'text-transform': 'uppercase', 'leading': -2} }
	, filters: { DropShadow: { knockout: false, distance: 0, color: '#cccccc', strength: 0.3, 'blurX': 7, 'blurY': 7} }
	, wmode: 'transparent'
	, forceSingleLine: false
	, fixHover: true
	, forceWidth: true
	, fitExactly: true
	, tuneWidth: 5
	}
);




/* file: NEW_editorial.js */


	// SWFObject
	// This JS-file applies to all templates based on the "editorial" framwork.

	function editorialInit()
	{
	    var accessChildren = $('.accessContent div *').length;
	    if (accessChildren == 0)
	    {
	        $('.accessArea').css('display', 'none');
	        $('.calender .innerCornerSW').css('display', 'none');
	        $('.promoArea .innerCornerNW').css('display', 'none');
	    }

	    if (isIE6() || isIE7())
	    {
	        $('h1').each(
			function(index)
			{
			    var h = $(this).height();
			    $(this).height(h);
			}
		    )
	    }


	    // Calculating page dimensions for eleminating transperent sections

        $("#ctaBookFromX, #ctaBookToX").date_input();
	    
	    $('#ctaBookToTrigger span.calendarIcon').click(function() { $('#ctaBookToX').change().focus(); return false; });
	    $('#ctaBookFromTrigger span.calendarIcon').click(function() { $('#ctaBookFromX').change().focus(); return false; });

	    $('#ctaBookToX').bind('focus', function() { $('.date_selector:first').hide(); });
	    $('#ctaBookFromX').bind('focus', function() { $('.date_selector:last').hide(); });

	    $('#ctaBookToX').bind('change', function() { $('#ctaBookTo').attr('value', this.value); });
	    $('#ctaBookFromX').bind('change', function() { $('#ctaBookFrom').attr('value', this.value); });

	    $('#ctaBookTo').bind('keyup', function() { $('#ctaBookToX').attr('value', this.value); });
	    $('#ctaBookFrom').bind('keyup', function() { $('#ctaBookFromX').attr('value', this.value); });

	    function parseI(s) { return (s.substring(0, 1) == '0') ? parseInt(s.substring(1)) : parseInt(s); }


	    $('#ctaBookFromX').bind('change',function() {

	    // IN DATA
	    var inDate = this.value;
	    var inDateParts = inDate.split('-');
	    var inDateYear = parseInt(inDateParts[0]);
	    var inDateMonth = parseInt(inDateParts[1] - 1);
	    var inDateDay = parseInt(inDateParts[2]);

	    // NEW JS DATE
	    var newDate = new Date(inDateYear, inDateMonth, inDateDay);
	    newDate.setDate(newDate.getDate() + 1);

	    // OUT DATA
	    var outYear = newDate.getFullYear();
	    var outMonth = (newDate.getMonth() + 1 < 10) ? '0' + (newDate.getMonth() + 1) : newDate.getMonth() + 1;
	    var outDay = (newDate.getDate() < 10) ? '0' + newDate.getDate() : newDate.getDate();

	    var outDate = outYear + '-' + outMonth + '-' + outDay;

	    $('#ctaBookToX, #ctaBookTo').val(outDate);
	    });




	    $('.xForm:empty').hide();
	        $(window).load(
		    function() {
		        setColumnHeight();
		    }
	    );
    }


/* file: NEW_LandingCategory.js */

function landingCategoryInit() {
    // Removes the dotted line above the first tow news itemes
    $('.itemImg:lt(2)').css('background-image', 'none').css('padding-top', 0);
    $('.itemImgShade:lt(2)').css('top', 0);


    // Calculating page dimensions for eleminating transperent sections
    $(window).load(
		function() {
		    setColumnHeight();
		}
	);

    // Fix newsItems height after sIFR is enabled
    if (isIE6()) {
        $('.newsItem').each(
			function() {
			    var h = $(this).height();
			    $(this).height(h);
			}
		)

        $('.categoryListHeader img').pngfix();
    }
}




/* jquery.date_input.min.js */

DateInput = (function(A) { function B(C, D) { if (typeof (D) != "object") { D = {} } A.extend(this, B.DEFAULT_OPTS, D); this.input = A(C); this.bindMethodsToObj("show", "hide", "hideIfClickOutside", "selectDate", "prevMonth", "nextMonth"); this.build(); this.selectDate(); this.hide() } B.DEFAULT_OPTS = { month_names: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], short_month_names: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], short_day_names: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], start_of_week: 1 }; B.prototype = { build: function() { this.monthNameSpan = A('<span class="month_name"></span>'); var C = A('<p class="month_nav"></p>').append(A('<a href="#" class="prev">&laquo;</a>').click(this.prevMonth), " ", this.monthNameSpan, " ", A('<a href="#" class="next">&raquo;</a>').click(this.nextMonth)); var D = "<table><thead><tr>"; A(this.adjustDays(this.short_day_names)).each(function() { D += "<th>" + this + "</th>" }); D += "</tr></thead><tbody></tbody></table>"; this.dateSelector = this.rootLayers = A('<div class="date_selector"></div>').append(C, D).appendTo(document.body); if (A.browser.msie && A.browser.version < 7) { this.ieframe = A('<iframe class="date_selector_ieframe" frameborder="0" src="#"></iframe>').insertBefore(this.dateSelector); this.rootLayers = this.rootLayers.add(this.ieframe) } this.tbody = A("tbody", this.dateSelector); this.input.change(this.bindToObj(function() { this.selectDate() })) }, selectMonth: function(E) { this.currentMonth = new Date(E.getFullYear(), E.getMonth(), 1); var D = this.rangeStart(E), I = this.rangeEnd(E); var H = this.daysBetween(D, I); var G = ""; for (var F = 0; F <= H; F++) { var C = new Date(D.getFullYear(), D.getMonth(), D.getDate() + F); if (this.isFirstDayOfWeek(C)) { G += "<tr>" } if (C.getMonth() == E.getMonth()) { G += '<td date="' + this.dateToString(C) + '"><a href="#">' + C.getDate() + "</a></td>" } else { G += '<td class="unselected_month" date="' + this.dateToString(C) + '">' + C.getDate() + "</td>" } if (this.isLastDayOfWeek(C)) { G += "</tr>" } } this.monthNameSpan.empty().append(this.monthName(E) + " " + E.getFullYear()); this.tbody.empty().append(G); A("a", this.tbody).click(this.bindToObj(function(J) { this.selectDate(this.stringToDate(A(J.target).parent().attr("date"))); this.hide(); return false })); A("td[date=" + this.dateToString(new Date()) + "]", this.tbody).addClass("today") }, selectDate: function(C) { if (typeof (C) == "undefined") { C = this.stringToDate(this.input.val()) } if (C) { this.selectedDate = C; this.selectMonth(C); var D = this.dateToString(C); A("td[date=" + D + "]", this.tbody).addClass("selected"); if (this.input.val() != D) { this.input.val(D).change() } } else { this.selectMonth(new Date()) } }, show: function() { this.rootLayers.css("display", "block"); this.setPosition(); this.input.unbind("focus", this.show); A([window, document.body]).click(this.hideIfClickOutside) }, hide: function() { this.rootLayers.css("display", "none"); A([window, document.body]).unbind("click", this.hideIfClickOutside); this.input.focus(this.show) }, hideIfClickOutside: function(C) { if (C.target != this.input[0] && !this.insideSelector(C)) { this.hide() } }, stringToDate: function(C) { var D; if (D = C.match(/^(\d{1,2}) ([^\s]+) (\d{4,4})$/)) { return new Date(D[3], this.shortMonthNum(D[2]), D[1]) } else { return null } }, dateToString: function(C) { return C.getDate() + " " + this.short_month_names[C.getMonth()] + " " + C.getFullYear() }, setPosition: function() { var C = this.input.offset(); this.rootLayers.css({ top: C.top + this.input.outerHeight() + 5, left: C.left - 100 }); if (this.ieframe) { this.ieframe.css({ width: this.dateSelector.outerWidth(), height: this.dateSelector.outerHeight() }) } }, moveMonthBy: function(C) { this.selectMonth(new Date(this.currentMonth.setMonth(this.currentMonth.getMonth() + C))) }, prevMonth: function() { this.moveMonthBy(-1); return false }, nextMonth: function() { this.moveMonthBy(1); return false }, monthName: function(C) { return this.month_names[C.getMonth()] }, insideSelector: function(C) { var D = this.dateSelector.offset(); D.right = D.left + this.dateSelector.outerWidth(); D.bottom = D.top + this.dateSelector.outerHeight(); return C.pageY < D.bottom && C.pageY > D.top && C.pageX < D.right && C.pageX > D.left }, bindToObj: function(D) { var C = this; return function() { return D.apply(C, arguments) } }, bindMethodsToObj: function() { for (var C = 0; C < arguments.length; C++) { this[arguments[C]] = this.bindToObj(this[arguments[C]]) } }, indexFor: function(E, D) { for (var C = 0; C < E.length; C++) { if (D == E[C]) { return C } } }, monthNum: function(C) { return this.indexFor(this.month_names, C) }, shortMonthNum: function(C) { return this.indexFor(this.short_month_names, C) }, shortDayNum: function(C) { return this.indexFor(this.short_day_names, C) }, daysBetween: function(D, C) { D = Date.UTC(D.getFullYear(), D.getMonth(), D.getDate()); C = Date.UTC(C.getFullYear(), C.getMonth(), C.getDate()); return (C - D) / 86400000 }, changeDayTo: function(F, C, E) { var D = E * (Math.abs(C.getDay() - F - (E * 7)) % 7); return new Date(C.getFullYear(), C.getMonth(), C.getDate() + D) }, rangeStart: function(C) { return this.changeDayTo(this.start_of_week, new Date(C.getFullYear(), C.getMonth()), -1) }, rangeEnd: function(C) { return this.changeDayTo((this.start_of_week - 1) % 7, new Date(C.getFullYear(), C.getMonth() + 1, 0), 1) }, isFirstDayOfWeek: function(C) { return C.getDay() == this.start_of_week }, isLastDayOfWeek: function(C) { return C.getDay() == (this.start_of_week - 1) % 7 }, adjustDays: function(E) { var D = []; for (var C = 0; C < E.length; C++) { D[C] = E[(C + this.start_of_week) % 7] } return D } }; A.fn.date_input = function(C) { return this.each(function() { new B(this, C) }) }; A.date_input = { initialize: function(C) { A("input.date_input").date_input(C) } }; return B })(jQuery)
$.extend(DateInput.DEFAULT_OPTS, {
    month_names: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"],
    short_month_names: ["jan", "feb", "mar", "apr", "maj", "jun", "jul", "aug", "sep", "okt", "nov", "dec"],
    short_day_names: ["s&ouml;n", "m&aring;n", "tis", "ons", "tor", "fre", "l&ouml;r"]
});

$.extend(DateInput.DEFAULT_OPTS, {
    stringToDate: function(string) {
        var matches;
        if (matches = string.match(/^(\d{4,4})-(\d{2,2})-(\d{2,2})$/)) {
            return new Date(matches[1], matches[2] - 1, matches[3]);
        } else {
            return null;
        };
    },

    dateToString: function(date) {
        var month = (date.getMonth() + 1).toString();
        var dom = date.getDate().toString();
        if (month.length == 1) month = "0" + month;
        if (dom.length == 1) dom = "0" + dom;
        return date.getFullYear() + "-" + month + "-" + dom;
    }
});