/*
 *	@DEVELOPER		NETGO.HU
 *	@COPYRIGHT		EROTIKAPLAZA.HU
 *	@FRAMEWORK		jQuery 1.3.2
 *
 *	2009
 */

cookie = {path:'/', expires:1}

confirmage = {
	kerdes: 'Elmúltál már 18 éves?',
	leiras: '<div style="color: white;"><b>A Tuttifruttiparty.com erotikus jellegű tartalmakkal foglalkozik. Kérjük nyilatkozzon, hogy elmúlt-e már 18 éves.</b></div>',
	ha_igen: 'http://tuttifruttiparty.com',
	ha_nem: 'http://www.webverzum.hu',
	igen: 'Elmúltam',
	nem: 'Nem múltam el',

	ask: function(){
		if($.cookie('confirmage')!='approved'){
			//	PRECONFIG
			$('object').css('visibility','hidden');

			//	APPENDING LAYER
			$('body').append('<div class="layer"></div>');
			$('.layer').css({'opacity':1,'height':$(document).height()});

			//	APPENDING CONTENT
			$('body').append('<div class="layer-holder"><div class="layer-question"><h1>'+this.kerdes+'</h1><p>'+this.leiras+'</p><a href="javascript:;" class="yes">'+this.igen+'</a> <a href="javascript:;" class="no">'+this.nem+'</a></div></div>');

			//	ASSIGNING SOME DYNAMIC OR CSS3 STYLES (FOR VALIDATION)
			$('.layer-question').bind('selectstart',function(){return false});
			$('.layer-question a').css({'border-radius':'3px','-moz-border-radius':'3px','-webkit-border-radius':'3px'});
			$('.layer-question h1').css('text-shadow','#f5f5f5 0px 1px 0px');

			//	IF THIS IS AN EXPLORER NEED TO FIX SOME THINGS
			if($.browser.msie){
				$('.layer-holder').css({'position':'absolute','top':'0px'});
			}

			//	ADDING OPTION FUNCTIONS
			$('.layer-question a.yes').click(function(){
				$('.layer').remove();
				$('.layer-holder').remove();
				$('object').css('visibility','visible');

				$.cookie('confirmage','approved',{path:'/',expires:30});
				window.location.href = confirmage.ha_igen;
			});
			$('.layer-question a.no').click(function(){
				window.location.href = confirmage.ha_nem;
			});
		}
	}
}

$(window).bind('load',function(){confirmage.ask()});
