//<![CDATA[
/*----------------artofweb - sitecontrol 3rd breathing-------------------------------
js

EgAr 2008.10.26
------------------------------------------------------------------------------------*/
//Функция всплывющего окна с картинкой
//Пример использования 
//<a href="#" onClick="AOW_OpenImageWindow('".$GLOBALS['AOW_working_server_name']."','width=600,height=449','imglib/My_pic_large.jpg')"><img border="0" src="My_pic.jpg" ALT="Это картинка"></a>
//features - параметры большой картинки
//file - адрес картинки
function AOW_OpenImageWindow(server,features,file,window_name) 
 { 
  var OpenWindow=window.open("", window_name,features);
  OpenWindow.document.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
  OpenWindow.document.write("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">");
  OpenWindow.document.write("<head>");
  OpenWindow.document.write("<title>");
  OpenWindow.document.write(server);
  OpenWindow.document.write("</title><meta http-equiv='Content-Type' content='text/html; Charset=UTF-8'>");
  OpenWindow.document.write("<meta name='Generator' content='artofweb.ru - AOW Ltd'>");
  OpenWindow.document.write("</head>");
  OpenWindow.document.write("<body style=\"background:#fff;\" marginheight=0 marginwidth=0 topmargin=0 leftmargin=0>");
  OpenWindow.document.write("<table cellspacing=0 cellPadding=0>");
  OpenWindow.document.write("  <tr>");
  OpenWindow.document.write("<td><a href=''onClick='self.close()'><img style=\"border:0px;\" src='");
  OpenWindow.document.write(file);
  OpenWindow.document.write("'></a></td>");
  OpenWindow.document.write("</tr></table></body></html>");
  self.name="main window";
 }


//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
//Выводит или меняет текст в любом из объектов
function AOW_ShowLabel(i,the_word)
{
 var d=(ns||ie)?'document.':'document.getElementById("';
 var a=(ns||n6)?'':'all.';
 var n6r=(n6)?'")':'';
 var p=eval(d+a+'TextOut'+i+n6r);
 p.innerHTML=the_word;
}

//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
//Почтовые скрипты 
function AOW_writeMail (login, serv, subj, addons)
{
if (!subj) subj='From aow-sc3';
var string='<nobr><a href="mailto:'+login+'@'+serv+'?subject='+subj+'" '+addons+'>'+login+'@'+serv+'</a></nobr>';
document.write (string);
}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
function submit_fnc(field,form,value)
{
 field.value=value;
 form.submit();
}


function submit_action_fnc(action,field,form,value)
{
 field.value=value;
 form.action=action;
 form.submit();
}


function submit_confdelete_fnc(field,form,value)
 {
  if (confirm("Вы уверены, что хотите удалить '"+value+"' ?"))
   {
    field.value=value;
    form.submit();
   }
   else
   {
	alert("'"+value+"' не был удален(а).");
   }
 }
 
 function devpass()
 {
	$('#devpass').dialog({
		autoOpen: false,
		width: 300,
		title: 'Вы разработчик?',
		resizable: false,
		modal: true,
		closeOnEscape: true
	});
	$("#devpass").dialog('open');
 }

function change_lng()
{
	if ($("#main_lng_list").css('display') == 'none')
		$("#main_lng_list").css('display','block');
	else
	{
		$("#main_lng_list").css('display','none');
	}
 }
 
 
function status_menu(id)
{
	
	if ($("#" + id ).css('display') == 'none')
	{
		var tmp = $("#status_h").val();
		if(tmp != '')
		{
			$("#" + tmp).css('display','none');
		}
		$("#" + id ).css('display','block');
		$("#status_h").val(id);
	}
	else
	{
		$("#" + id).css('display','none');
	}
}

function change_visible(id)
{
	
	if ($("#" + id ).css('display') == 'none')
	{
		$("#" + id ).css('display','block');
	}
	else
	{
		$("#" + id).css('display','none');
	}
}



$(document).ready(function() {
	$(".imageSlider .jCarouselLite").jCarouselLite({
		btnNext: ".sli_next",
		btnPrev: ".sli_previous",
		visible: 1,
		speed: 500
	});

	$('#name_mail').each(function () {
		titles[$(this).attr('name')] = $(this).val();
		$(this).click(function () {
			if (titles[$(this).attr('name')] == $(this).val())
				$(this).val('');
		});
		$(this).blur(function () {
			if (!$(this).val())
				$(this).val(titles[$(this).attr('name')]);
		});
	});
	
	$('#email_mail').each(function () {
		titles[$(this).attr('name')] = $(this).val();
		$(this).click(function () {
			if (titles[$(this).attr('name')] == $(this).val())
				$(this).val('');
		});
		$(this).blur(function () {
			if (!$(this).val())
				$(this).val(titles[$(this).attr('name')]);
		});
	});	
});

//]]>
