
function PmAgeControl() {
	this.controlId2 = 'content2';
	this.controlId = 'obalka2';
	this.contentId = 'obalka';
	this.cookie	= 'age_control=true';
	this.cookiesDays = 7;
	this.style = '<style type="text/css">html body #obalka {display:none;} html body #obalka2 {display:block;} html body #content2 {display:block;}<\/style>';
}

PmAgeControl.prototype.check = function() {
	if((document.cookie.indexOf(this.cookie) > -1)) {
		this.hideControl();	
	} else {
		this.showControl();
	}
}

PmAgeControl.prototype.isOk = function() {
	var cookie = this.cookie;
	cookie += '; path=/; ';
	document.cookie = cookie;
	this.swap(this.contentId, this.controlId);
	
}

PmAgeControl.prototype.isCookiesEnabled = function() {
	var testCookie = "cookieTest=ok";
  	document.cookie = testCookie;
	return (document.cookie.indexOf(testCookie) > -1 );
}

PmAgeControl.prototype.getStyle = function() {
	return this.style;
}

PmAgeControl.prototype.getStyle2 = function() {
	return this.style2;
}

PmAgeControl.prototype.isControlVisible = function() {
	return ($('#' + this.controlId).css('display') == 'block');
}


PmAgeControl.prototype.showControl = function() {
	this.style = '<style type="text/css">html body #obalka {display:none;} html body #obalka2 {display:block;} html body #content2 {display:block;}<\/style>';
}

PmAgeControl.prototype.hideControl = function() {
	this.style = '<style type="text/css">html body #obalka {display:block;} html body #obalka2 {display:none;} html body #content2 {display:none;}<\/style>';
}
