// ф-ия открывания окна для фото
function WinOpenPhoto(id,x,y){
	y+=50;
	window.open('/photo_view/'+id,'','width='+x+',height='+y+',top=10,left=10,scrollbars=1,resizable=0');
}
// ф-ия открывания окна для статей
function WinOpenArticle(id,x,y){
	y+=50;
	window.open('/photo_view/'+id,'','width='+x+',height='+y+',top=10,left=10,scrollbars=0,resizable=0');
}
// ф-ия открывания окна превью
function WinOpenPreview(file,x,y) {window.open('/includes/photo_view.php?file='+file,'','width='+x+',height='+y+',top=10,left=10,scrollbars=1,resizable=0');return false;}
// ф-ия открывания окна новостей
function WinOpenNews(id,x,y) {
	window.open('/includes/news_view.php?id='+id,'','width='+x+',height='+y+',top=10,left=10,scrollbars=0,resizable=0');
	return false;
}
function doAction() {
	pvdWin= open("", "pvdwin", "width=450,height=400");
	pvdWin.focus(); pvdWin.document.open();
	pvdWin.document.write("<html><head><title>Голосование");
	pvdWin.document.write("</title></head>");
	pvdWin.document.write("<body topmargin=0 bgcolor=#E7E7F7 leftmargin=0 marginwidth=0 marginheight=0>");
	pvdWin.document.write("<table width=100% height=100% align=center><tr><td align=center><font face=\"Verdana\" color=#292C84><b>Пожалуйста подождите. <br> Идет обработка данных...</b></font></td></tr></table>");
	pvdWin.document.write("</body></html>");
	pvdWin.document.close();
	document.golos_form.submit();
}
/////////////////////////////////////
var n=0;
function open_s(nm)
{	
	if(n!=nm)
	{
	if(n!=0) close_s(n);
	document.getElementById(nm).style.display="inline";
	n=nm;
	}
	else close_s(nm);
}
	
function close_s(nm)
{	
	document.getElementById(nm).style.display="none";
	n=0;		
}
//////////////////////////////////
var m_c="we";
function open_main(nm_c)
{	
	if(m_c!=nm_c)
	{
		if(m_c!=0) close_main(m_c);
		document.getElementById(nm_c+"_p").src="/images/punkt.jpg";
		document.getElementById(nm_c+"_t_p").style.backgroundColor="#724242";
		document.getElementById(nm_c+"_t_t").style.backgroundColor="#724242";
		document.getElementById(nm_c).style.display="inline";
		m_c=nm_c;
	}
	else close_main(nm_c);
}
	
function close_main(nm_c)
{	
	//alert(nm_c+"_t_p");
	document.getElementById(nm_c+"_p").src="/images/punkt1.jpg";
	document.getElementById(nm_c+"_t_p").style.backgroundColor="#420707";
	document.getElementById(nm_c+"_t_t").style.backgroundColor="#420707";
	document.getElementById(nm_c).style.display="none";
	m_c=0;		
}
function HREF(id,id_cat) {
//	alert(id_cat);
	if(id_cat==0) {
		var ss=location.href;
		if(ss.charAt(ss.length-1)!='/') ss+="/";
		document.getElementById("h"+id).href=ss+""+document.getElementById("k"+id).value+"/"+id+"/";
	} else {
		document.getElementById("h"+id).href="/catalog/"+id_cat+"/"+document.getElementById("k"+id).value+"/"+id+"/";
	}
}
function Vardata() {
	var logik=true;
	if(document.getElementById("phone").value=='') {
		alert("Не указан контактный телефон");
		logik=false;
	}
	if(document.getElementById("phone").value.length>12) {
		alert("Слишком длинный номер.");
		logik=false;
	}
	if(document.getElementById("phone").value.length<5) {
		alert("Слишком короткий номер.");
		logik=false;
	}
	return logik;
}
function veryfy() {
	if(document.getElementById('form_login').value=="") {
		alert("Не введен логин");
		return false;
	}
	if(document.getElementById('form_pass').value=="") {
		alert("Не введен пароль");
		return false;
	}
	return true;
}
