//
function show_users(cur_id, u_secure, u_event, cur_type, cur_page)
{
	//x = confirm(u_event+" ?","");
	//if(x)
	//{
		parent.window.location = "sms_user.php?u_secure="+u_secure+"&u_event="+u_event+"&user_id="+cur_id+"&type="+cur_type+"&cur_page="+cur_page;
	//}
}
//
function delete_users(cur_id, u_secure, u_event, cur_type, cur_page)
{
	x = confirm(u_event+" ?","");
	if(x)
	{
		parent.window.location = "users.php?u_secure="+u_secure+"&u_event="+u_event+"&user_id="+cur_id+"&type="+cur_type+"&cur_page="+cur_page;
	}
}
//
function hide_sms(cur_id, u_secure, u_event, cur_type, cur_page)
{
	x = confirm(u_event+" ?","");
	if(x)
	{
		parent.window.location = "sms_book.php?u_secure="+u_secure+"&u_event="+u_event+"&user_id="+cur_id+"&type="+cur_type+"&cur_page="+cur_page;
	}
}
//
function show_sms(cur_id, u_secure, u_event, cur_type, cur_page)
{
	x = confirm(u_event+" ?","");
	if(x)
	{
		parent.window.location = "sms_book.php?u_secure="+u_secure+"&u_event="+u_event+"&user_id="+cur_id+"&type="+cur_type+"&cur_page="+cur_page;
	}
}
//
function delete_sms(cur_id, u_secure, u_event, cur_type, cur_page)
{
	x = confirm(u_event+" ?","");
	if(x)
	{
		parent.window.location = "sms_book.php?u_secure="+u_secure+"&u_event="+u_event+"&user_id="+cur_id+"&type="+cur_type+"&cur_page="+cur_page;
	}
}
//
function add_calendar(u_secure, u_event)
{
	var x = document.form1;
	var error = "";
	var sms_geo_reg = /^([a-zA-Z0-9]|!|@|#|\$|%|\^|&|\*|\(|\)|-|_|\+|=|\/|,|\.|<|>|\?|:|;|\s){7,55}$/;
	var bd_d_reg = /^(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/;
	var bd_m_reg = /^(0[1-9]|1[0-2])$/;

	if(!sms_geo_reg.test(x.sms_geo.value))
	{
		error = error + "Incorrect name \n";
	}
	//
	if(!bd_d_reg.test(x.bd_day.value))
	{
		error = error + "Incorrect day\n";
	}
	//
	if(!bd_m_reg.test(x.bd_month.value))
	{
		error = error + "Incorrect month\n";
	}
	//
	if(x.bd_day.value==31)
	{
		mes = x.bd_month.value;
		switch(mes)
		{
			case "09": error = error + "Incorrect date\n"; break;
			case "11": error = error + "Incorrect date\n"; break;
			case "02": error = error + "Incorrect date\n"; break;
			case "04": error = error + "Incorrect date\n"; break;
			case "06": error = error + "Incorrect date\n"; break;
		}
	}
    //
	if(x.bd_month.value == 02)
	{
		if(x.bd_day.value == 29 || x.bd_day.value == 30)
		{
			error = error + "Incorrect date\n";
		}
	}
	//
	if(error)
	{
		alert(error);
	}
	else
	{
		x = confirm(u_event+" ?","");
		if(x)
		{
			parent.window.location = "calendar.php?u_secure="+u_secure+"&u_event="+u_event+"&your_name="+document.form1.sms_geo.value+"&info=0000-"+document.form1.bd_month.value+"-"+document.form1.bd_day.value;
		}	
	}
}
//
function delete_calendar(cur_id, u_secure, u_event)
{
	x = confirm(u_event+" ?","");
	if(x)
	{
		parent.window.location = "calendar.php?u_secure="+u_secure+"&u_event="+u_event+"&user_id="+cur_id;
	}
}
//
function admin_login()
{
	error = "";
	x = document.form1;

	if(x.active_code.value == "")
	{
		error = error + "Code\n";
	}
	//
	if(x.password1.value == "")
	{
		error = error + "Password\n";
	}
	//
	if(error)
	{
		alert(error);
	}
	else
	{
		x.submit();
	}
}
//
function delete_holiday(cur_id, u_secure, u_event)
{
	x = confirm(u_event+" ?","");
	if(x)
	{
		parent.window.location = "sms_type.php?u_secure="+u_secure+"&u_event="+u_event+"&user_id="+cur_id;
	}
}
//
function add_holiday(u_secure, u_event)
{
	var x = document.form1;
	var error = "";
	var your_name_reg = /^([a-zA-Z]){3,25}$/;

	if(!your_name_reg.test(x.your_name.value))
	{
		error = error + "Incorrect name \n";
	}
	if(error)
	{
		alert(error);
	}
	else
	{
		x = confirm(u_event+" ?","");
		if(x)
		{
			parent.window.location = "sms_type.php?u_secure="+u_secure+"&u_event="+u_event+"&your_name="+document.form1.your_name.value;
		}	
	}
}