﻿$(window).load(function () { resizeWindowWidth(); });
$(window).resize(function () { resizeWindowWidth(); });

$(document).ready(function () {
    if (pfConfigurator) runPf('AnimatedPictureFrame', pfConfigurator);
});

function runPf(name, conf){
	try{
		if (document.getElementsByName(name).length>1){
			/* Give  params to embed for FF */
			document.getElementsByName(name)[1].init(conf);
		}else{
			/* Give  params to object for IE */
			document.getElementsByName(name)[0].init(conf);
		}
	}
	catch(e){
		setTimeout(function(){runPf(name, conf)}, 200);
	}
}

function resizeWindowWidth() {
    var w = 0;
    var currW = 0;
    w = document.body.clientWidth;
    currW = w > 1170 ? '1170' : (w > 900 ? w - 20 : '900');
    $('.container').css('width', currW + 'px');
    $('.contentArea').css('width', currW - 258 + 'px');
    $('.contentAreaFront').css('width', currW - 605 + 'px');
    $('.contentHome').css('width', currW - 589 + 'px');
    $('.tickertape').css('width', currW + 'px');
}

function openDialog(params)
{
	params = params||{};
	
	var dialog = window.showModalDialog('/dialogs/commonPopupWindow.html',
		params, 'center:yes; dialogHeight:550px;resizable:yes;dialogWidth:550px ')

	if(params.answer.resCode == 'OK')
	{
		return params.answer;
	}	
}

// Lang images pre-load
var lang_en_selected=new Image();
var lang_nl_selected=new Image();
lang_en_selected.src="/site/core/images/flag-enr.gif";
lang_nl_selected.src="/site/core/images/flag-nlr.gif";
	// Menu images pre-load
var menu_bg_1 = new Image();
menu_bg_1.src = "/site/core/images/menu_bg.gif";
var menu_bg_2 = new Image();
menu_bg_2.src = "/site/core/images/bg-td-menu.gif";
var menu_bg_3 = new Image();
menu_bg_3.src = "/site/core/images/menu_bgr.gif";

