/*

handleBodyLoad()

*/

function handleBodyLoad(){

	if(document.getElementById('contextMenu')) document.body.className += ' loggedIn';

	initOverlay();


	/*
	if($('body:first').is('.template-89, .template-90, .template-94')){
		blog_scaleSiteBg();
		$(window).resize(function(){
			blog_doWindowResize();
		});
	} else {
		scaleSiteBg();
		$(window).resize(function(){
			doWindowResize();
		});
	}
	*/

	scaleSiteBg();
	$(window).resize(function(){
		doWindowResize();
	});


	// if(document.body.className.match('d1334')){

	collapseMenuItem('1321');
	collapseMenuItem('1302');
	drawNavBg($('#main-nav').height() + 92);



	Cufon.replace('h1', { color:'#ffffff', fontSize:'36px' });

	$("#gallery").photoGallery({
		'speed':1000
	});

	markLinks();

//	initMainNav();
//	initInputFocus('qGlobal', 'Search');
//	initNewsLetterSubscriptionForm();

}


 /*
	scaleSiteBg
*/

function scaleSiteBg(){

	doWindowResize();

	if($('#background .content img').length){
		var bg = $('#background .content img:first-child');
		bg.parent().css('visibility', 'hidden');

		bg.load(function() {
			doWindowResize();
			bg.parent().css('visibility', 'visible');
			window.setTimeout("flyInContent()", 1000);
		});

	} else {
		window.setTimeout("flyInContent()", 1000);
	}
	
	window.bump = setTimeout("bumpBg()", 3000);

}

function doWindowResize(){
	var h = $(window).height();
	var w = $(window).width();

	var bg = $('#background .content img:first-child');
	var bgH = bg.height();
	var bgW = bg.width();

	if( (bgH*w)/bgW < h){

		// vertical
		bg.removeAttr('width');
		bg.attr('height', h);

		var bg = $('#background .content img:first-child');
		var bgW = bg.width();

		var m = (bgW - w)/2;
		bg.css('marginTop', '0px');
		bg.css('marginLeft', '-'+m+'px');

	} else {

		// horizontal
		bg.removeAttr('height');
		bg.attr('width', w);

		var bg = $('#background .content img:first-child');
		var bgH = bg.height();

		var m = (bgH - h)/2;
		bg.css('marginLeft', '0px');
		bg.css('marginTop', '-'+m+'px');

	}

	var minSiteH = 690;
	if($('body:first').hasClass('template-85')) minSiteH = 770;
	if($('body:first').hasClass('template-36')) minSiteH = 770;

	if(h < minSiteH) h = minSiteH;

	$('#site').height(h);
	$('#overlay').height(h);
	$('#overlay').width(w);

}



function bumpBg(){
	$('#background .content').css('visibility', 'visible');
	flyInContent();
	doWindowResize();
}


/*
	flyInContent
*/

function flyInContent(){
	var animH = 250;
	if($('body:first').hasClass('template-36')) animH = 272; // space for document prev/next
		
	$('#contentWrapper').animate({
		height: animH+'px'
	}, 1200, function(){
		// Animation complete
		$('#galleryThumbnails').fadeIn();
	});
}


/*
	drawNavBg
*/

function drawNavBg(initH, newHeight){
	if ($.browser.msie && $.browser.version.substr(0,1)<7) return false;

	$('#main-nav-wrapper').addClass('polyOn');
	$('#svgWrapper').html('');


	$('#svgWrapper').css('overflow', 'hidden');
	$('#svgWrapper').width(300);
	$('#svgWrapper').height(300);

	var paper = Raphael("svgWrapper", 300, 300);

	var poly = paper.path("M 40 12 l 170 -12 l -6 "+ initH +" l -155 -20 z");
	poly.attr({fill: "#fff" });
	poly.attr({stroke: "#fff" });

	if(newHeight){
		poly.animate({  
			path: "M 40 12 l 170 -12 l -6 "+ newHeight +" l -155 -20 z"
		}, 600, 'linear');  
	}
}



/*
	collapseMenuItem
*/

function collapseMenuItem(id){
	var a = $('#main-nav li.d'+id+ ' a:first');
	a.parent().addClass('hasSubmenu');
	var ul = a.parent().find('ul:first');

	ul.hide();
	ul.css('height', '0');

	// .active open
	if(a.parent().hasClass('active')){
		ul.show();
		ul.css('height', 'auto');
	}

	a.click(function(){
		var ul = $(this).parent().find('ul:first');
		ul.css('overflow', 'hidden');

		var childeren = ul.children().size();
		var liH = 22;
		// var bottomPadding = 60; (no superboy)
		var bottomPadding = 92;


		if(ul.is(':visible')){

			// shrink BG
			drawNavBg($('#main-nav').height()+bottomPadding, ($('#main-nav').height()+bottomPadding) - (liH*childeren));

			ul.animate({
				height: '0px'
			}, 600, function(){
				ul.hide();
			});

		} else {

			// grow BG + (liH*childeren);
			drawNavBg($('#main-nav').height()+bottomPadding, ($('#main-nav').height()+bottomPadding) + (liH*childeren));

			ul.show();
			ul.animate({
				height: liH * childeren+'px'
			}, 600, function(){
				
			});
		}
		
		return false;
	});

}



 /*
	blog_scaleSiteBg
*/

function blog_scaleSiteBg(){

	blog_doWindowResize();

	if($('#background .content img').length){
		var bg = $('#background .content img:first-child');
		bg.parent().css('visibility', 'hidden');

		bg.load(function() {
			blog_doWindowResize();
			bg.parent().css('visibility', 'visible');
		});

	}

	window.bump = setTimeout("blog_bumpBg()", 3000);

}

function blog_doWindowResize(){
	var h = $(window).height();
	var w = $(window).width();

	var bg = $('#background .content img:first-child');
	var bgH = bg.height();
	var bgW = bg.width();

//	if( (bgH*w)/bgW < h){

		// vertical
		bg.removeAttr('width');
//		bg.attr('height', h);
		bg.attr('width', w);

		var bg = $('#background .content img:first-child');
		var bgW = bg.width();

		var m = (bgW - w)/2;
		bg.css('marginTop', '0px');
		bg.css('marginLeft', '-'+m+'px');

/*	} else {

		// horizontal
		bg.removeAttr('height');
		bg.attr('width', w);

		var bg = $('#background .content img:first-child');
		var bgH = bg.height();

		var m = (bgH - h)/2;
		bg.css('marginLeft', '0px');
		bg.css('marginTop', '-'+m+'px');

	}*/

	/*var minSiteH = 690;
	if($('body:first').hasClass('template-85')) minSiteH = 770;
	if($('body:first').hasClass('template-36')) minSiteH = 770;

	if(h < minSiteH) h = minSiteH;

	$('#site').height(h);
	$('#overlay').height(h);
	$('#overlay').width(w);*/

}



function blog_bumpBg(){
	$('#background .content').css('visibility', 'visible');
	blog_doWindowResize();
}

 /*
  get cookie
*/
function getCookie(sName){
	var aCookie = document.cookie.split("; ");
	
	for (var i=0; i < aCookie.length; i++){
		var aCrumb = aCookie[i].split("=");
		if (sName == aCrumb[0]){
			return unescape(aCrumb[1]);
		}
	}
	
	return null;
} /*
  getElementsByClassName
*/
document.getElementsByClassName = function (needle){
    var s = [document.documentElement || document.body], i = 0, r = [], l = 0, e;
    var re = new RegExp('(^|\\s)' + needle + '(\\s|$)');

    do{
        e = s[i];

        while (e){
            if (e.nodeType == 1){
                if (e.className && re.test(e.className)) r[l++] = e;

                s[i++] = e.firstChild;
            }

            e = e.nextSibling;
        }
    }
	
    while (i--);

    return r;
}
 /*
initInputFocus
*/
function initInputFocus(elemId, elemValue){
	if(!document.getElementById(elemId)) return false;
	var elem = document.getElementById(elemId);
	
	elem.value = elemValue;

	elem.onfocus = function(){
		if(this.value == elemValue){
			this.value = '';
		}
		this.select();
	}
	
	elem.onblur = function(){
		if(this.value == ''){
			this.value = elemValue;
		}
	}

	//hide label
	if(elem.parentNode.getElementsByTagName('span').length){
		elem.parentNode.getElementsByTagName('span')[0].style.display = 'none';
	}
	
}




/*
	initInputFocus by title
*/
function initInputFocusByTitle(){
	var inputs = document.getElementById('site').getElementsByTagName('input');
	var areas = document.getElementById('site').getElementsByTagName('textarea');
	
	var alLinputs = new Array();
	for(var i = 0; i < inputs.length; i++){
		if(inputs[i].getAttribute('type').toLowerCase() == 'text') alLinputs.push(inputs[i]);
	}
	for(var i = 0; i < areas.length; i++){
		alLinputs.push(areas[i]);
	}
	
	if(alLinputs.length == 0) return false;
	
	for(var i = 0; i < alLinputs.length; i++){
		
		if(alLinputs[i].parentNode.nodeName.toLowerCase() != 'label') continue;
		
		alLinputs[i].parentNode.getElementsByTagName('span')[0].style.display = 'none';
		alLinputs[i].value = alLinputs[i].parentNode.getAttribute('title');
		alLinputs[i].onfocus = function(){
			if(this.value == this.parentNode.getAttribute('title')){
				this.value = '';
			}
			this.select();
		}
		alLinputs[i].onblur = function(){
			if(this.value == ''){
				this.value = this.parentNode.getAttribute('title');
			}
		}
	}
}


 /*
  main-nav menus delay
*/
function initMainNav() {

	var nodes = new Array();
	var mainNavCn = document.getElementById('main-nav').childNodes;
	for (i = 0; i < mainNavCn.length; i++) {
		if(mainNavCn[i].nodeName.toLowerCase() == 'li') nodes.push(mainNavCn[i]);
	}

	for (i = 0; i < nodes.length; i++) {
		// init out
		nodes[i].className += ' out';
		
		// over
		nodes[i].onmouseover = function(){
			// close others

			blockingElements('hide');

			var nodes = new Array();
			var mainNavCn = document.getElementById('main-nav').childNodes;
			for (j = 0; j < mainNavCn.length; j++) {
				if(mainNavCn[j].nodeName.toLowerCase() == 'li') nodes.push(mainNavCn[j]);
			}

			for (j = 0; j < nodes.length; j++) {
				if (nodes[j] != this) {
					nodes[j].className = nodes[j].className.replace(' wait', ' out');
				}
			}

			this.className = this.className.replace(' wait', ' hover');
			this.className = this.className.replace(' out', ' hover');
			
			if(this.t){
				clearTimeout(this.t);
			}
		}
	
		// out
		nodes[i].onmouseout = function(){
			this.className = this.className.replace(' hover', ' wait');
			
			var _this = this;				
			this.t = setTimeout(function(){
				if(_this.className.match('wait')){
					_this.className = _this.className.replace(' wait', ' out');
					blockingElements('show');
				} 

			}, 600);
		}
	}
}

function blockingElements(visibity){

	var elements = ['noElementsToHide']; // add elementID's to hide here

	if(visibity == 'show'){
		visibity = 'visible';
	} else {
		visibity = 'hidden';
	}
	for (i = 0; i < elements.length; i++) {
		if(document.getElementById(elements[i])){
			document.getElementById(elements[i]).style.visibility = visibity;
		}
	}
}

 /*
	initOverlay
*/

function initOverlay(){

	var $overlay = $('<div id="overlay"/>');

	var h = $(window).height();
	var w = $(window).width();

	$overlay.css('height',h);
	$overlay.css('width',w);
	$overlay.css('display', 'none');

	$('#site').append($overlay);
} /*
	markLinks
*/

function markLinks(){

	if(!document.getElementById('content')) return false;

	var extIcon = '/img/template/link-icons/external.png';	
	var emailIcon = '/img/template/link-icons/email.png';
	var twitIcon = '/img/template/link-icons/twitter-white.png';
	var linkedIcon = '/img/template/link-icons/linkedIn.png';
	var vCardIcon = '/img/template/link-icons/vCard.png';
	var pdfIcon = '/img/template/link-icons/pdf.png';
	var xlsIcon = '/img/template/link-icons/xls.png';
	var docIcon = '/img/template/link-icons/doc.png';
	var pptIcon = '/img/template/link-icons/ppt.png';
	var zipIcon = '/img/template/link-icons/zip.png';
	var wmvIcon = '/img/template/link-icons/wmv.png';

	
	var links = document.getElementsByTagName('a');
	var link, mark;
	
	for(var i = 0; i < links.length; i++){
		link = links[i];
		
		// ext
		if(link.getAttribute('rel') == 'ext' || link.getAttribute('rel') == 'external'){
			link.className += ' external';
			link.target = '_blank';
		}
				
		// mailto
		if(link.getElementsByTagName('img').length == 0){
			// email (niet obv rel)
			if(link.getAttribute('href').indexOf('mailto:') != -1){
				link.className += ' external mail';
				link.target = '_blank';
				mark = document.createElement('img');
				mark.src = emailIcon;
				link.appendChild(mark);
			}
		}
		
		// ext & specific site
		if(link.getElementsByTagName('img').length == 0){
			if(link.getAttribute('rel') == 'ext' || link.getAttribute('rel') == 'external'){
				// twitter
				if(link.getAttribute('href').match('twitter.com')){
					link.className += ' twitter';
					mark = document.createElement('img');
					mark.src = twitIcon;
					link.insertBefore(mark , (link.firstChild));
				}
				// linkedIn
				if(link.getAttribute('href').match('linkedin.com')){
					link.className += ' linkedin';
					mark = document.createElement('img');
					mark.src = linkedIcon;
					link.insertBefore(mark , (link.firstChild));
				}
			}
		}
		
		// ext & filetypes
		if(link.getElementsByTagName('img').length == 0){
			if(link.getAttribute('rel') == 'ext' || link.getAttribute('rel') == 'external'){
				// file types
				var hEnd = link.getAttribute('href').substring(link.getAttribute('href').length-4).toLowerCase();
				switch (hEnd){
				case '.vcf':
					mark = document.createElement('img');
					mark.src = vCardIcon;
					link.className += ' file vcf';
					link.insertBefore(mark , (link.firstChild));
					link.onclick = handleDownloadClick;
					break;
				case '.zip':
					mark = document.createElement('img');
					mark.src = zipIcon;
					link.className += ' file zip';
					link.insertBefore(mark , (link.firstChild));
					link.onclick = handleDownloadClick;
					break;
				case '.wmv':
					mark = document.createElement('img');
					mark.src = wmvIcon;
					link.className += ' file wmv';
					link.insertBefore(mark , (link.firstChild));
					link.onclick = handleDownloadClick;
					break;
				case '.pdf': case 'pdfx':
					mark = document.createElement('img');
					mark.src = pdfIcon;
					link.className += ' file pfd';
					link.insertBefore(mark , (link.firstChild));
					link.onclick = handleDownloadClick;
					break;
				case '.xls': case 'xlsx':
					mark = document.createElement('img');
					mark.src = xlsIcon;
					link.className += ' file xls';
					link.insertBefore(mark , (link.firstChild));
					link.onclick = handleDownloadClick;
					break;
				case '.doc': case 'docx':
					mark = document.createElement('img');
					mark.src = docIcon;
					link.className += ' file doc';
					link.insertBefore(mark , (link.firstChild));
					link.onclick = handleDownloadClick;
					break;
				case '.ppt': case 'pptx':
					mark = document.createElement('img');
					mark.src = pptIcon;
					link.className += ' file ppt';
					link.insertBefore(mark , (link.firstChild));
					link.onclick = handleDownloadClick;
					break;
				default:
					mark = document.createElement('img');
					mark.src = extIcon;
					link.appendChild(mark);
					link.onclick = handleExternalSiteClick;
				}
			}
		}
	}
	
	// print text
	links = document.getElementById('content').getElementsByTagName('a');
	for(var i = 0; i < links.length; i++){
		if(links[i].getAttribute('href')){
			oHref = document.createElement('span');
			oHref.className = 'print';
			oHref.appendChild((document.createTextNode(' [' + links[i].href + ']')));
			links[i].appendChild(oHref);
		}
	}

	mark = null;
	href = null;
	link = null;
	links = null;
}

function handleDownloadClick(){
	if(typeof pageTracker._trackPageview == 'function'){
		pageTracker._trackPageview('/downloads/' + this.href);
	}
}

function handleExternalSiteClick(){
	if(typeof pageTracker._trackPageview == 'function'){
		pageTracker._trackPageview('/externalSites/' + this.href);
	}
}

 /*
  newsLetterSubscription
*/
function initNewsLetterSubscriptionForm(){
  if(!document.getElementById('newsLetterServiceFormMethod')) return false;

  var formMethod = document.getElementById('newsLetterServiceFormMethod');

  if(document.getElementById('buttonUnsubscribeNewsLetterService')){
    var unsubscribeButton = document.getElementById('buttonUnsubscribeNewsLetterService');
    
    unsubscribeButton.onclick = function(){
      formMethod.value = 'unsubscribe';
    }
  }

  if(document.getElementById('buttonSubscribeNewsLetterService')){
    var subscribeButton = document.getElementById('buttonSubscribeNewsLetterService');

    subscribeButton.onclick = function(){
      formMethod.value = 'subscribe';
    }
  }
} /*
	photoGallery
*/

(function($){
	$.fn.photoGallery = function(options){
		return this.each(function(){
			$.photoGallery(this, options);
		});
	};

    $.photoGallery= function(container, options){
		var o = {
			autoPlay: false,
			autoPlayDelay: 3000,
			autoPlayDirection: 1,
			controls: true,
			speed: 1000
		};
		if (options) $.extend(o, options);

		o.page = 0;
		o.imgWidth = 520;
		o.tnWidth = 105;
		o.imgCount = $(container).find("#galleryView li").size();

		$(container).addClass('jsOn');

		// thumbnails
		$(container).find("#galleryThumbnails li a").each(function(i) {
			$(this).addClass('tn'+i);
			$(this).click(function() {
				openGallery();
				pageing(container, i);
				return false;
			});
		});

		$(container).find("#galleryView li").each(function(i) {
			$(this).addClass('img'+i);
		});


		// galleryTitle
		var $galleryTitle= $('<p id="galleryTitle"></p>');
		$(container).append($galleryTitle);

		// close
		var $close = $('<a id="galleryClose" href="#"><em>Sluiten</em></a>');
		 $close.click(function() {
			$(container).find('#galleryView, #galleryClose, #galleryNext, #galleryPrev, #galleryTitle').hide();
			$('#overlay').fadeOut();
			return false;
		});
		$(container).append($close);

		// next
		var $next = $('<a id="galleryNext" href="#"><em>Volgende</em></a>');
		 $next.click(function() {
			pageing(container, 'next');
			return false;
		});
		$(container).append($next);

		// prev
		var $prev = $('<a id="galleryPrev" href="#"><em>Vorige</em></a>');
		 $prev.click(function() {
			pageing(container, 'prev');
			return false;
		});
		$(container).append($prev);


		// set initial img positions
		$(container).find("#galleryView ul li").css({ left:(o.imgWidth)+20+'px' });
		$(container).find("#galleryView ul li:first-child").css({ left:'0px' });

		// set initial description
		var title = $(container).find("#galleryView ul li:first-child img").attr('alt');
		$("#galleryTitle").html(title);


		// set tn slider width
		$(container).find("#galleryThumbnails ul:first-child").css({ width:(o.imgCount*o.tnWidth)+20+'px' });
		// set initial active tn
	//	$(container).find("#galleryThumbnails ul li:first-child").addClass('active');


		// pageing
		function pageing(container, dir){

			if( $(container).find("#galleryView li").is(':animated') ) return false;
			if( dir == o.page ) return false;

			if(dir == 'next'){
				
				// Move out old
				moveLeft(o.page);

				// Prep new
				o.page += 1;
				if(o.page > o.imgCount-1) o.page = 0;
				placeRight(o.page);

			} else if(dir == 'prev'){

				// Move out old
				moveRight(o.page);

				// Prep new
				o.page -= 1;
				if(o.page < 0) o.page = o.imgCount-1;
				placeLeft(o.page);

			} else {

				if(dir > o.page){

					// Move out old
					moveLeft(o.page);
					o.page = dir;
					placeRight(o.page);

				} else if(dir < o.page){

					// Move out old
					moveRight(o.page);
					o.page = dir;
					placeLeft(o.page);
				}
				o.page = dir;
			}

			// Move in new
			moveCenter(o.page);

			// Set active
			$(container).find("#galleryThumbnails ul li").removeClass('active');
			$(container).find("#galleryThumbnails ul li a.tn"+o.page).parent().addClass('active');
			slideTn(o.page);

			// Set title
			var title = $(container).find("#galleryView li.img"+o.page+" img:first-child").attr('alt');
			$("#galleryTitle").html(title);


		}


		// moveCenter, moveLeft, moveRight, placeLeft, placeRight
		function moveCenter(id){
			$("#galleryView li.img"+id).animate({
				left: '0px'
			}, o.speed);
		}

		function moveLeft(id){
			$("#galleryView li.img"+id).animate({
				left: '-'+o.imgWidth+'px' 
			}, o.speed);
		}

		function moveRight(id){
			$("#galleryView li.img"+id).animate({
				left: o.imgWidth+'px' 
			}, o.speed);
		}

		function placeLeft(id){
			$("#galleryView li.img"+id).css({ left: '-'+o.imgWidth+'px' });
		}

		function placeRight(id){
			$("#galleryView li.img"+id).css({ left: o.imgWidth+'px' });
		}

		function slideTn(id){

			if (id < 3){
				id = 0;

			} else if (id > o.imgCount-3){
				id =  o.imgCount-5;

			} else {
				id -= 2;
			}

			var slideLeft = id*o.tnWidth;
			var slider = $("#galleryThumbnails ul:first-child");
			slider.animate({
				left: '-'+slideLeft+'px' 
			}, o.speed);
		}

		// initial hide
		$(container).find('#galleryView, #galleryThumbnails, #galleryClose, #galleryNext, #galleryPrev, #galleryTitle').hide();
		// show on first click
		function openGallery(){
			$(container).find('#galleryView, #galleryClose, #galleryNext, #galleryPrev, #galleryTitle').fadeIn();
			$('#overlay').fadeIn();
		}

	};

})(jQuery);





 /*
  popups
*/
var aPopups = new Array();
var aModalPopups = new Array();

window.onfocus = function()
{
	if(aModalPopups.length != 0)
	{
		aModalPopups[0].focus();
	}
}


var sDefaultFeatures = 'channelmode=0, fullscreen=0, location=0, menubar=0, resizable=0, scrollbars=0, status=0, titlebar=0, toolbar=0';

// create popup
function createPopup(sURL, sName, sFeatures, iWidth, iHeight)
{
	var iLeft	= (screen.availWidth - iWidth) / 2;
	var iTop	= (screen.availHeight - iHeight) / 2;
	
	return window.open(sURL, sName, sFeatures + ', width=' + iWidth + ', height=' + iHeight + ', left=' + iLeft + ', top=' + iTop);
} /*
	popup
*/
function openPopup(html){
	if(!document.getElementById('popupWrapper')){
		var popupWrapper = document.createElement('div');
		popupWrapper.id = 'popupWrapper';
		popupWrapper.onclick = function(){ closePopup() };
		popupWrapper.innerHTML = '<div class="header"><a href="javascript:closePopup();"><em>Close</em></a></div> <div class="body" id="popupBody"></div>';
		document.body.appendChild(popupWrapper);
	}

	document.getElementById('popupBody').innerHTML = html;
	document.getElementById('popupWrapper').style.display = 'block';
	blockingElements('hide');

}

function closePopup(){
	document.getElementById('popupWrapper').style.display = 'none';
	blockingElements('show');
}

/*
	initProductPhotoPopup
	div#productDetails div.productImage a img
*/
function initProductPhotoPopup(){
	if(!document.getElementById('productDetails')) return false;
	
	var mediumSizeLink = $('div#productDetails div.productImage a');
	var mediumSizeImg = $('div#productDetails div.productImage a img');
	mediumSizeLink[0].onclick = function(){
		openPopup('<img src="' + mediumSizeImg[0].src.replace('medium', 'large') +'" />');
		return false;
	}
}

 /**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;



