(function(){
 	//if it's a reload/bookmarked page from the user... the user is send back where he was...
 	var B = window.location.hash, s = $('shadow'), d = dimension_detect();
 	if (getObjectType(B) === 'String' && !/^\s*$/.test(B) && !/(flash_container|content)/.test(B.substring(1))) {
		 window.location = window.location.pathname + '?' + Base64.decode(B);
 	}
 	if (s) {
		s.style.width  = d.docW + 300 + 'px';
 		s.style.height = d.docH + 'px';
		window.onresize = function(){
			s = $('shadow'), d = dimension_detect();
			s.style.width  = d.docW + 300 + 'px';
			s.style.height = d.docH + 'px';
		};
 	}
	// show the flash if the user is connected...
	if (cs.id_user > 0) {
		//by default we record the user to be on the homepage ...
		cs.qs_storage = window.location.search.substring(1);
		if (!/module=(\w+)/i.test(cs.qs_storage)) {
			cs.qs_storage = 'module=home';
		}
		if (checkForFlash(10)) {
			load_flash(false);
		} else {
			var z = (document.querySelector) ? document.querySelector('#flash_container div') : $('flash_container').getElementsByTagName('div')[0];
			z.style.display='block';
			s.style.display = 'none';
			document.getElementsByTagName('html')[0].style.overflow = 'auto';
			document.body.style.overflow = 'auto';
		}
		window.onbeforeunload = confirmExit;
	} else {
		$('popunder').setAttribute('allowTransparency','yes');
	}
	csEvents.init();
	if (cs.id_user === 0 && (typeof disclaimer == 'undefined' || disclaimer != true)) {
		s.style.display = 'none';
		document.getElementsByTagName('html')[0].style.overflow = 'auto';
		document.body.style.overflow = 'auto';
	}
})();
