;(function($) {
	// private variables
	var oSettings = {};
	var bDebug = true;
	var $Contact;
	//
	// default settings
	$.keeskroot = {
		 id: "keeskroot"
		,version: "2.0.1"
	};
	// init
	$(function() {
		document.title = document.title+' '+$('div#contact>ul>li.tel>a').text();
//		$('title').text($('title').text()+' '+$('div#contact>ul>li.tel>a').text());
		var $Body = $('body');
		$Body.removeClass('nojs').addClass('hasjs');
		var sCache = bDebug?"?c="+Math.random():"";
		if (navigator.userAgent.match(/iPad/i)!==null) {
			$('div#nojs').html('<video controls="controls" autoplay="autoplay" src="data/IPAD.mp4" width="1024" height="439" />').css({backgroundImage:'none'});
		} else if ($.browser.mobile) {
			$Body.addClass('mobile');
		} else {
			$Body.addClass('flash');
			$Contact = $('div#contact').remove();
			$.fn.addflash({
				 file:"swf/KeesKroot.swf"+sCache
				,id:"swfHolder"
				,width: 950
				,height: 516
				,minWidth: 950
				,minHeight: 516
				,maxWidth: 1204
				,maxHeight: 516
				,params: {
					bgcolor: '#0A0B0F'
				}
				,flashvars: {
					 xml:"index.html"+sCache
					,data:"data/Library.swf"+sCache
					,css:''
					,date:sDate!==undefined?sDate:0
					,nieuw:74
				}
				,getFlashInsert: null
				,fnFail: function(){
					$('div#nojs').html('<p>Om deze site te bekijken heb je <a href="http://get.adobe.com/flashplayer/">Adobe Flash</a> nodig.</p>');
					$Contact.appendTo($('body')).addClass('footer').find('br').replaceWith('<span/>');
				}
				,fnSucces: function(){
					$('div#nojs').remove();
					$Contact.appendTo($('body')).addClass('footer').find('br').replaceWith('<span/>');
					
					$(window).resize();
					setTimeout(function(){$(window).resize();},3000);
					//setTimeout(function(){$Body.prepend('asdf');},1000);
				}
//				,fnResize: function(x,y,w,h){
//					$Contact.css({
//						top:(y+h)+'px'
//					});
//				}
			});
		}
		// facebook like
		var iWLike = 117;
		var iHLike = 21;
		var sLocation = window.location.href;
		trace('sLocation:',sLocation); // TRACE ### sLocation
		var sLike = '<iframe id="fbLike" src="http://www.facebook.com/plugins/like.php?href='+encodeURIComponent(sLocation)+'&amp;layout=button_count&amp;show_faces=false&amp;width='+iWLike+'&amp;action=like&amp;font&amp;colorscheme=dark&amp;height='+iHLike+'" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:'+iWLike+'px; height:'+iHLike+'px;" allowTransparency="true"></iframe>';
		$(sLike).appendTo($Contact).width(iWLike).height(iHLike);
	});

	// trace
	var trace = function trace() {
		try {console.log.apply(console, arguments);} catch (e) {}
	}
})(jQuery);
