var uaVers="";
if (window.navigator.userAgent.indexOf ("Opera")>0){
	ua = "Opera";
	uaVers=window.navigator.userAgent.substr(window.navigator.userAgent.indexOf("Opera")+6,4);
}else if(window.navigator.userAgent.indexOf ("Gecko") > 0){
	ua = "Netscape";
	uaVers=window.navigator.userAgent.substr(window.navigator.userAgent.indexOf("Gecko")+6,8)+ " ("+ window.navigator.userAgent.substr(8,3) + ")";
}else if(window.navigator.userAgent.indexOf ("MSIE")>0){
   ua = "Explorer";
   uaVers=window.navigator.userAgent.substr(window.navigator.userAgent.indexOf("MSIE")+5,3);
}else{
	ua = window.navigator.appName;
}

function wpopen(wurl, w, h, add) {
	if(ua == "Explorer" && add!=1) {
		h += 100;
//		w += 20;
	}
	window.open(wurl,Math.random().toString().substring(2),'height='+h+',width='+w+',resizable=no,scrollbars=no,menubar=no,status=no');
}

function wpopenScroll(wurl, w, h) {
	window.open(wurl,Math.random().toString().substring(2),'height='+h+',width='+w+',resizable=no,scrollbars=yes,menubar=no,status=no');
}

function wOpenFull(number, id, tit) {
	if(!tit) title = 'Упражнения для глаз';
	else title = 'Упражнение для улучшения формы груди';
	w = screen.width;
	h = screen.height;
	windEx = window.open("", "windEx"+number+id, "menubar=no,width="+w+",height="+h+",top=0,left=0");
	str = '<html>';
	str += '<head>';
	str += '<title>'+title+' - Упражнение №'+number+'</title>';
	str += '<meta http-equiv=Content-Type content="text/html; charset=windows-1251">';
	str += '</head>';
	str += '<body leftMargin=0 topMargin=0 marginheight="0" marginwidth="0" background="/img/2008_01_06/exercise_eye/'+id+'0'+number+'_small.gif">';
	str += '<div style="padding: 4px 0px 0px 4px;"><input type="button" onClick="javascript:window.self.close()" value="Закрыть"></div>';
	str += '<bgsound src="/img/2008_01_06/exercise_eye/ex.wma" loop="100000">';
	str += '</body>';
	str += '</html>';
	windEx.document.write(str);
}

var counterUnknow = 0;

function exerciseEye(target) {
	var win = document;
	if(target=="top") {
		win = top.document;
	}
	if(confirm("Вы - мужчина?")) {
		if(confirm("Вам есть 18 лет?")) {
			win.location.href="/exercise/exercise_eye.html";
		}
		else {
			alert("Вам рано улучшать зрение");
			win.location.href="/about.html";
		}
	}
	else {
		counterUnknow++;
		hoAreYou();
		exerciseBosom(target);
//		win.location.href="/exercise/exercise_bosom.html";
	}
}
function exerciseBosom(target) {
	var win = document;
	if(target=="top") {
		win = top.document;
	}
	if(confirm("Вы - женщина?")) {
		if(confirm("Вам есть 18 лет?")) {
			win.location.href="/exercise/exercise_bosom.html";
		}
		else {
			alert("У Вас и так прекрасная грудь!!!!");
			win.location.href="/about.html";
		}
	}
	else {
		counterUnknow++;
		hoAreYou();
		exerciseEye(target)
//		win.location.href="/exercise/exercise_eye.html";
	}
}
function hoAreYou() {
	if(counterUnknow%10==0 && counterUnknow>0) {
		alert('Вы не знаете кто Вы????');
	}
}
