<!--

home_0=new Image(); home_0.src="desigen/mutual/back_main_page_01.gif";
home_1=new Image(); home_1.src="../desigen/mutual/back_main_page_01.gif";


mat_col_backgr_01="#FF7853";
mat_col_text_01="White";

function change(name_picture,new_picture)
{
         document.images[name_picture].src=new_picture;
}
//------------------------------------------------------

function load_input_log_main()
{
        document.log_form.user_name.focus();
}

//------------------------------------------------------

function load_input_log()
{
        document.log.login_user.focus();
}

//------------------------------------------------------

function load_input_log_01()
{
        document.room_form.Name_room.focus();
}

//------------------------------------------------------

function load_input_log_02()
{
        document.pas_form.old_passwd.focus();
}

//------------------------------------------------------

function load_input_msg()
{
        document.msg_send.to_user.focus();
}


//------------------------------------------------------


function load_input_msg_01()
{
        document.msg_send.text_msg.focus();
}


//------------------------------------------------------


function load_input_fam_01()
{
        document.fam_form.my_name.focus();
}


//------------------------------------------------------


function load_input_fam_02()
{
        document.fam_form.text_ans.focus();
}


//------------------------------------------------------

function load_input_fam_03()
{
        document.add_form.text_fam.focus();
}


//------------------------------------------------------

function del_01()
{
	result=window.confirm("!!! Opravdu chcete smazat tuto fotografii?");

	if (result) return true;
	  return false;
}

//------------------------------------------------------

function del_02()
{
	result=window.confirm("!!! Opravdu chcete smazat portrét?");

	if (result) return true;
	  return false;
}

//------------------------------------------------------

function del_03()
{
	result=window.confirm("!!! Opravdu chcete smazat tento vzkaz?");

	if (result) return true;
	  return false;
}

//------------------------------------------------------

function del_04()
{
	result=window.confirm("!!! Opravdu chcete smazat tuto místnost?");

	if (result) return true;
	  return false;
}

//------------------------------------------------------

function del_05()
{
	result=window.confirm("!!! Opravdu chcete smazat tento inzerát?\nPOZOR, budou smazány i všechny odpovědi k němu patřící!");

	if (result) return true;
	  return false;
}

//------------------------------------------------------

function del_06()
{
	result=window.confirm("!!! Opravdu chcete smazat tuto odpověď?");

	if (result) return true;
	  return false;
}

//------------------------------------------------------

function new_message(path,num,owner)
{


	obsah=document.cookie;
	upravene=obsah.split(';');
	velikost=upravene.length;
	kusy="";
	vrat="";

  for (x=0;(x<velikost && vrat=="");x++) 
  {
    kusy=upravene[x].split('=');
    if (kusy[0].substring(0,1)==' ') 
      kusy[0]=kusy[0].substring(1,kusy[0].length);
    if (kusy[0]=="msg") vrat=kusy[1];
  }

	if(num!=vrat)
	{
		if(vrat>0) ms=num-vrat;
			ms=num;

		result_m=window.confirm("Byl Vám doručen nový vzkaz ("+ms+")\nPřejete si jej přečíst ihned?");

		if (result_m)
		{
			window.location.href=path+"user/user_message.php";
		}
		else
				{
					//datum=new Date();
					//document.cookie="msg="+escape(num);
					document.cookie="msg="+escape(num);
					//document.cookie="owner="+owner;
				}
	}
}

//------------------------------------------------------

function del_cook()
{
	document.cookie="msg="+escape(0);
}

//------------------------------------------------------

function op_pic_01(id_foto,width_send,heigh_send,page)
{

	width_send=eval(width_send);
	heigh_send=eval(heigh_send);

	vertical=((screen.height/2)-(heigh_send/2));
	horizontal=((screen.width/2)-(width_send/2));
 
	margin_min=10;
 
	//pokud je obrazek vetsi nez sitka obrazovky minus 10 nebo vyska obrazovky minus 100, potom se objevi posuvniky, jinak ne
	if((width_send>(screen.width-10)) || (heigh_send>(screen.height-100))) scroll_window="yes";
		else scroll_window="no";
 
	if(vertical<margin_min) vertical=margin_min;
	if(horizontal<margin_min) horizontal=margin_min;

	switch(page)
	{
		case "1": path="../photo_js_show.php?Id=";
							break;
		case "2":	path="user/photo_js_show.php?Id_us=";
							break;
	}
 
 
	picture=window.open(path+id_foto,id_foto,"width="+ width_send +",height="+ heigh_send +",top="+ vertical +",left="+ horizontal +",scrollbars="+ scroll_window);
}

//------------------------------------------------------


//------------------------------------------------------

function op_win_msg(id_foto,width_send,heigh_send,page)
{

	width_send=eval(width_send);
	heigh_send=eval(heigh_send);

	vertical=((screen.height/2)-(heigh_send/2));
	horizontal=((screen.width/2)-(width_send/2));
 
	margin_min=10;
 
	//pokud je obsah vetsi nez sitka obrazovky minus 10 nebo vyska obrazovky minus 100, potom se objevi posuvniky, jinak ne
	if((width_send>(screen.width-10)) || (heigh_send>(screen.height-100))) scroll_window="yes";
		else scroll_window="no";
 
	if(vertical<margin_min) vertical=margin_min;
	if(horizontal<margin_min) horizontal=margin_min;

	switch(page)
	{
		case "1":	path="user_message_win.php?Id=";
				break;
		case "2":	path="user/user_message_win.php?Id=";
				break;
		case "3":	path="user/add_ad.php?Id=";
				break;
		case "4":	path="answer_ad.php?Id=";
				break;
		case "5":	path="add_ad.php?Id=";
				break;
	}

	open_win=window.open(path+id_foto,id_foto,"width="+ width_send +",height="+ heigh_send +",top="+ vertical +",left="+ horizontal +",scrollbars="+ scroll_window);
}

//------------------------------------------------------

function portray_hide(what_is)
{
  document.getElementById(what_is).className=(document.getElementById(what_is).className=='hidden_yes_no')?'':'hidden_yes_no';
}

function make_switch (id,name,stylec) {
   document.write('<a class="'+stylec+'" href="javascript:portray_hide(\''+id+'\')" >'+name+'</a>');
}

document.write('<style rel="STYLESHEET" type="text/css">.hidden_yes_no {display: none}</style>');

//------------------------------------------------------


function mat_validate_photo_data(formular)
{

	if (formular.photo_comment.value=="")
	{
		alert("Komentář fotografie je nutno zadat!");
		formular.photo_comment.focus();
		return false;
	}


	if (formular.photo_file.value=="")
	{
		alert("Je nutno zadat cestu k souboru!\nPodporovány pouze formáty GIF, JPG, PNG");
		formular.photo_file.focus();
		return false;
	}

	return true;
}

//------------------------------------------------------


function mat_validate_passwd(formular)
{

	if (formular.old_passwd.value=="")
	{
		alert("Je nutno zadat staré heslo!");
		formular.old_passwd.focus();
		return false;
	}


	if (formular.new_passwd.value=="")
	{
		alert("Je nutno zadat nové heslo!");
		formular.new_passwd.focus();
		return false;
	}

	if (formular.aut_passwd.value=="")
	{
		alert("Je nutno zadat ověřovací heslo!");
		formular.aut_passwd.focus();
		return false;
	}

	if (formular.new_passwd.value!=formular.aut_passwd.value)
	{
		alert("Nové heslo se neshoduje s ověřovacím heslem!");
		formular.aut_passwd.focus();
		return false;
	}

	return true;
}

//------------------------------------------------------

function from_sel_to_inp_01(field)
{
	document.msg_send.to_user.value = field.options[field.selectedIndex].value;
}

//------------------------------------------------------

function mat_validate_photo_data_edit(formular)
{

	if (formular.photo_comment.value=="")
	{
		alert("Komentář fotografie je nutno zadat!");
		formular.photo_comment.focus();
		return false;
	}


	return true;
}


//------------------------------------------------------

function validate_msg_01(formular)
{

	if (formular.to_user.value=="")
	{
		alert("Nezadali jste příjemce zprávy!");
		formular.to_user.focus();
		return false;
	}
	
	if (formular.text_msg.value=="")
	{
		alert("Nezadali jste text zprávy!");
		formular.text_msg.focus();
		return false;
	}

	return true;
}


//------------------------------------------------------

function mat_creat_room(formular)
{

	if (formular.Name_room.value=="")
	{
		alert("Je nutno zadat název místnosti!");
		formular.Name_room.focus();
		return false;
	}


	if (formular.Account.value=="")
	{
		alert("Je nutno zadat popis místnosti!");
		formular.Account.focus();
		return false;
	}

	if (formular.Subcategory.value=="")
	{
		alert("Je nutno vybrat kategorii!");
		formular.Subcategory.focus();
		return false;
	}

	return true;
}

//------------------------------------------------------

function valid_fam_01(formular)
{

	if (formular.my_name.value=="")
	{
		alert("Je nutno zadat Vaše jméno!");
		formular.my_name.focus();
		return false;
	}

	if (formular.text_ans.value=="")
	{
		alert("Je nutno zadat text odpovědi!");
		formular.text_ans.focus();
		return false;
	}


	return true;
}

//------------------------------------------------------

function valid_fam_02(formular)
{

	if (formular.text_ans.value=="")
	{
		alert("Je nutno zadat text odpovědi!");
		formular.text_ans.focus();
		return false;
	}


	return true;
}

//------------------------------------------------------

function valid_add_fam_01(formular)
{

	if (formular.text_fam.value=="")
	{
		alert("Je nutno zadat text inzerátu!");
		formular.text_fam.focus();
		return false;
	}


	return true;
}

//------------------------------------------------------

function counting_01(num)
{
	document.add_form.show.value=document.add_form.text_fam.value.length;

	if (document.add_form.text_fam.value.length>num)
	{
		document.add_form.text_fam.value=document.add_form.text_fam.value.substring(0,num);
		alert("Nelze napsát více než "+num+" znaků\nText byl zkrácen...");
	}
}

//------------------------------------------------------

function counting_02(num)
{
	document.fam_form.show.value=document.fam_form.text_ans.value.length;

	if (document.fam_form.text_ans.value.length>num)
	{
		document.fam_form.text_ans.value=document.fam_form.text_ans.value.substring(0,num);
		alert("Nelze napsát více než "+num+" znaků\nText byl zkrácen...");
	}
}

//------------------------------------------------------

function counting_03(num)
{
	document.persd_form.show.value=document.persd_form.Note_about_user.value.length;

	if (document.persd_form.Note_about_user.value.length>num)
	{
		document.persd_form.Note_about_user.value=document.persd_form.Note_about_user.value.substring(0,num);
		alert("Nelze napsát více než "+num+" znaků\nText byl zkrácen...");
	}
}

//------------------------------------------------------

function counting_04(num)
{
	document.hobb_form.show.value=document.hobb_form.Hobby_06_text.value.length;

	if (document.hobb_form.Hobby_06_text.value.length>num)
	{
		document.hobb_form.Hobby_06_text.value=document.hobb_form.Hobby_06_text.value.substring(0,num);
		alert("Nelze napsát více než "+num+" znaků\nText byl zkrácen...");
	}
}

//------------------------------------------------------

function counting_05(num)
{
	document.dep_form.show.value=document.dep_form.Dependence_text.value.length;

	if (document.dep_form.Dependence_text.value.length>num)
	{
		document.dep_form.Dependence_text.value=document.dep_form.Dependence_text.value.substring(0,num);
		alert("Nelze napsát více než "+num+" znaků\nText byl zkrácen...");
	}
}

//------------------------------------------------------

function counting_06(num)
{
	document.fam_form.show.value=document.fam_form.Meet_text.value.length;

	if (document.fam_form.Meet_text.value.length>num)
	{
		document.fam_form.Meet_text.value=document.fam_form.Meet_text.value.substring(0,num);
		alert("Nelze napsát více než "+num+" znaků\nText byl zkrácen...");
	}
}

//------------------------------------------------------
// -->

