function changefoto (anket, photo , folder) {
	document.getElementById('mainfoto').src = "/photos/"+folder+"/"+photo;
	//document.getElementById('mainlink').href = "/photos/"+folder+"/"+anket+"_"+photo+".jpg";
}

function change_sa (stype) {
			
	//alert(stype);
	
	document.getElementById("acttype1").style.display = "none";	
	document.getElementById("acttype2").style.display = "none";	
	document.getElementById("acttype3").style.display = "none";	
	document.getElementById("acttype4").style.display = "none";	
	document.getElementById("acttype5").style.display = "none";	

	if (stype == 1){
		document.getElementById("acttype1").style.display = "inline";	
	}		
	if (stype == 2){
		document.getElementById("acttype2").style.display = "inline";	
	}		
	if (stype == 3){
		document.getElementById("acttype3").style.display = "inline";	
	}		
	if (stype == 4){
		document.getElementById("acttype4").style.display = "inline";	
	}		
	if (stype == 5){
		document.getElementById("acttype5").style.display = "inline";	
	}		
}

function set_ue (pfield,kurs) {
			
	document.getElementById(pfield+'rub').value = Math.round(document.getElementById(pfield).value*kurs);
	
}

function checkauth(wcomm) {
	
	$.getJSON("http://redclub.cz/aubox.php?callback=?",
		function(person){
			if (person.pid > 0){
				if (person.ut == 1){
					document.getElementById("mauth").innerHTML='<a href="http://redclub.cz/posredlogin/">Личный кабинет</a><br><a href="http://redclub.cz/lo.php" style="margin-top: 6px; display: block;">Выход ['+person.log+']</a>';
				}
				if (person.ut == 2){
					document.getElementById("mauth").innerHTML='<a href="http://redclub.cz/lo.php" style="margin-top: 6px; display: block;">Выход ['+person.log+']</a>';
				}
				if (wcomm == 'y'){
					document.getElementById("wcomm").style.display='inline';
				}
			} else {
				document.getElementById("mauth").innerHTML='логин (email)';
				document.getElementById("aform").style.display='inline';			
				if (wcomm == 'y'){
					document.getElementById("wcommx").style.display='inline';
				}
			}
			//alert(person.nick);
		}
	);
	
}

function checkauthc() {
	$.getJSON("http://redclub.cz/aubox.php?callback=?", function(person){
		
		if (person.pid > 0){
			document.getElementById("mcomm").innerHTML='авторизован - можно комментировать';
		} else {
			document.getElementById("mcomm").innerHTML='не авторизован - комментировать могут только авторизованные пользователи...';
			document.getElementById("aform").style.display='inline';			
		}		
	});
}

function authevent (){
//	$('jauth').addEvent('submit', function(e) {
//		new Event(e).stop();
//		this.send({
//			update: 'mauth',
//			evalScripts: true
//		});
//	});
}