﻿// JScript File

var scnWid,scnHei;
	if (self.innerHeight) // all except Explorer
	{
		scnWid = self.innerWidth;
		scnHei = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		scnWid = document.documentElement.clientWidth - 20; //min 20px voor scrollbalk
		scnHei = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		scnWid = document.body.clientWidth - 20; //min 20px voor scrollbalk
		scnHei = document.body.clientHeight;
	}

function closepopup() {
	document.getElementById('bannerPopupLayer').style.visibility = 'hidden'; 
	document.getElementById('bannerPopup').style.display = 'none';
}

function closepopupNew() {
    $('#bannerPopupLayer, #bannerPopup').hide();
}

function closeFlashPopup() {
	//document.getElementById('SenzzBannerPopupLayer').style.visibility = 'hidden'; 
	document.getElementById('SenzzBannerPopup').style.display = 'none';
}


function openCultureLayer() {
	overlay = document.getElementById('cultureOverlay'); 
	overlay.style.height = scnHei;
	overlay.style.width = scnWid;
	overlay.style.visibility = 'visible';
	
	layer = document.getElementById('cultureLayer');
	layer.style.left = (scnWid - layer.offsetWidth)/2 + "px";
	layer.style.visibility = 'visible';
}
function closeCultureLayer() {
	document.getElementById('cultureOverlay').style.visibility = 'hidden';
	document.getElementById('cultureLayer').style.visibility = 'hidden';
}

function ShowVideoControl(strFlvPath, strElementId, autoplay, strImage)
{
    var so = new SWFObject("/swf/videoControl_dorel.swf", "DorelVideoContainerSWF", "512", "288", "9", "#000000");
    so.addParam("allowScriptAccess","sameDomain");
    so.addParam("wmode","transparent");
    so.addParam("allowFullScreen","true");
    
    if (strImage.length != 0)
    {
        so.addVariable("image_src", strImage);
    }
    
    so.addVariable("video_autoplay",autoplay);
    so.addVariable("video_src", strFlvPath);
    so.write(strElementId);
}

function disableAnchor(obj, disable)
{
    if (disable) {
        var href = obj.getAttribute('href');
        if (href && href != '' && href != null) {
            obj.setAttribute('href_bak', href);
        }
        obj.removeAttribute('href');

        var onclick = obj.getAttribute('onclick');
        if (onclick && onclick != '' && onclick != null) {
            obj.setAttribute('onclick_bak', onclick);
        }
        obj.removeAttribute('onclick');

        obj.disabled = true;
    }
    else {
        obj.setAttribute('href', obj.attributes['href_bak'].nodeValue);
        obj.setAttribute('onclick', obj.attributes['onclick_bak'].nodeValue);
        obj.disabled = false;
    }
}

$(document).ready(function ($) {
    if ($(".slideshow ul.panes li").length > 1) { //there has to be more then one slide 
            $(".slideshow").css({ "background-image": "url(" + $(".slideshow ul.panes li:first-child img").attr("src") + ")" }); //set the first image as background.
            $(".slideshow ul.panes").after($("<div>").addClass("navTabs").append($("<ul>"))); //render the navigation wrapper
            $(".slideshow ul.panes li").each(function () { $(".slideshow .navTabs ul").append($("<li>")); }); //render the navigation elements
            $(".slideshow .navTabs ul").tabs(".slideshow ul.panes li", { effect: 'fade', rotate: true, fadeInSpeed: 1500, fadeOutSpeed: 1500 }).slideshow({ autoplay: true, autopause: true, interval: 5000 });
        }
});
