//================PICCHANGE=================

function picchange(limg,limit) {
	for (i=1; i<=limit; i++)
	{
		document.images["s"+i].src='../imagez/px.gif';
	}
	if ((document.title=="Растительный мир - О нас") || (document.title=="Plant World - About us"))
	{
		var dir="o_nas";
	}
	else if ((document.title=="Растительный мир - Архитектура - Интерьер") || (document.title=="Plant World - Architecture - Interiors"))
	{
		var dir="int";
	}
	else if ((document.title=="Растительный мир - Архитектура - Зимние сады") || (document.title=="Plant World - Architecture - Winter gardens"))
	{
		var dir="zims";
	}
	else if ((document.title=="Растительный мир - Архитектура - Перспектива") || (document.title=="Plant World - Architecture - Perspective"))
	{
		var dir="persp";
	}
	else if ((document.title=="Растительный мир - Архитектура - Рабочее проектирование") || (document.title=="Plant World - Architecture - Working project"))
	{
		var dir="rabpr";
	}
	else if ((document.title=="Растительный мир - Ландшафт - Фотогалерея") || (document.title=="Plant World - Landscaping - Portfolio"))
	{
		var dir="photo";
	}
	else if ((document.title=="Растительный мир - Ландшафт - Малые формы") || (document.title=="Plant World - Landscaping - Small-scale architectural formations"))
	{
		var dir="malf";
	}
	else if ((document.title=="Растительный мир - Ландшафт - Ландшафтный проект - Эскизы генплана") || (document.title=="Plant World - Landscaping - Landscaping project - Blueprint"))
	{
		var dir="eskgen";
	}
	else if ((document.title=="Растительный мир - Ландшафт - Ландшафтный проект - Аналогичные решения") || (document.title=="Plant World - Landscaping - Landscaping project - Similar solutions"))
	{
		var dir="analog";
	}
	else if (document.title=="Растительный мир - Ландшафт - Презентации - Graff")
	{
		var dir="graff";
		change_text(limg, "ru");
	}
	else if (document.title=="Plant World - Landscaping - Presentation - Graff")
	{
		var dir="graff";
		change_text(limg, "en");
	}
	else if ((document.title=="Растительный мир - Ландшафт - Презентации - Brioni") || (document.title=="Plant World - Landscaping - Presentation - Brioni"))
	{
		var dir="brioni";
	}
	else if ((document.title=="Растительный мир - Ландшафт - Выставки - Неделя Садов 2003") || (document.title=="Plant World - Landscaping - Exhibitions - The Week of Gardens 2003"))
	{
		var dir="2003";
	}
	else if ((document.title=="Растительный мир - Ландшафт - Выставки - Неделя Садов 2004") || (document.title=="Plant World - Landscaping - Exhibitions - The Week of Gardens 2004"))
	{
		var dir="2004";
	}
	else if ((document.title=="Растительный мир - Ландшафт - Выставки - Неделя Садов 2005") || (document.title=="Plant World - Landscaping - Exhibitions - The Week of Gardens 2005"))
	{
		var dir="2005";
	}
	else{
		return false;
	}
	document.images["s"+limg].src="../imagez/22.gif";
	document.images["picbig"].src="../photoz/"+dir+"/"+limg+"s.jpg";
	return true;
}

//============CHANGE_TEXT===============

function change_text(number, lng) {
	if ((number==1) && (lng=="ru"))
	{
		var string="<img src=../imagez/graff.jpg width=107 height=46><br><hr width=200 style=\"color:#FFFFFF\"><small>МОСКВА. ТРЕТЬЯКОВСКИЙ ПРОЕЗД<\/small><br><small class=ll>АВТОР: СИДНИНА ЕЛЕНА<\/small>";
	}
	else if ((number==2) && (lng=="ru"))
	{
		var string="<img src=../imagez/graff.jpg width=107 height=46><br><hr width=200 style=\"color:#FFFFFF\"><small>ЛОНДОН<\/small>";
	}
	else if ((number==3) && (lng=="ru"))
	{
		var string="<img src=../imagez/graff.jpg width=107 height=46><br><hr width=200 style=\"color:#FFFFFF\"><small>ПАРИЖ<\/small>";
	}
	else if ((number==1) && (lng=="en"))
	{
		var string="<img src=../imagez/graff.jpg width=107 height=46><br><hr width=200 style=\"color:#FFFFFF\"><small>МОСКВА. ТРЕТЬЯКОВСКИЙ ПРОЕЗД<\/small><br><small class=ll>АВТОР: СИДНИНА ЕЛЕНА<\/small>";
	}
	else if ((number==2) && (lng=="en"))
	{
		var string="<img src=../imagez/graff.jpg width=107 height=46><br><hr width=200 style=\"color:#FFFFFF\"><small>ЛОНДОН<\/small>";
	}
	else if ((number==3) && (lng=="en"))
	{
		var string="<img src=../imagez/graff.jpg width=107 height=46><br><hr width=200 style=\"color:#FFFFFF\"><small>ПАРИЖ<\/small>";
	}
	else{
		return false;
	}
	document.getElementById('divazzz').innerHTML=string;
	return true;
}

//============GET_N_SHOW================

function get_n_show() {
	var width=640+10;
	var height=499+36;
	var newstr=document.images["picbig"].src;
	var imgs=newstr.replace('s.jpg','.jpg');

	var code="<HTML>\r\n\
	<HEAD>\r\n\
		<TITLE>"+document.title+"<\/TITLE>\r\n\
		<meta http-equiv=\"Imagetoolbar\" content=\"no\" \/>\r\n\
		<LINK href=\"..\/style.css\" type=text\/css rel=stylesheet>\r\n\
		<script>\r\n\
		function check_language(){\r\n\
			if(document.title.indexOf(\"Plant World\", 0) == -1){\r\n\
				return \"ru\";\r\n\
			}\r\n\
			else{\r\n\
				return \"en\";\r\n\
			}\r\n\
		}\r\n\
		function click() {\r\n\
			if (event.button==2) {\r\n\
				if(check_language()==\"ru\"){\r\n\
					var string=\"Функция не доступна!\";\r\n\
				}\r\n\
				else{\r\n\
					var string=\"Function not exists!\";\r\n\
				}\r\n\
			alert(string);\r\n\
			}\r\n\
		}\r\n\
		document.onmousedown=click;\r\n\
		<\/script>\r\n\
	<\/HEAD>\r\n\
	<BODY>\r\n\
		<IMG SRC=\""+imgs+"\" width=640 height=499 class=winimg onClick=\"javascript:window.close()\">\r\n\
	<\/BODY>\r\n\
	<\/HTML>";

	myWin=open("", "myWin", "width="+(width-10)+", height="+(height-36)+", status=no, toolbar=no, menubar=no");
	myWin.document.open();
	myWin.document.write(code);
	myWin.document.close();
	myWin.focus();
	return true;
}

//==================CHECK_LANGUAGE====================

function check_language(){
	if(document.title.indexOf("Plant World", 0) == -1){
		return "ru";
	}
	else{
		return "en";
	}
}

//============CLICK==============

function click() {
	if (event.button==2) {
		if(check_language()=="ru"){
			var string="Функция не доступна!";
		}
		else{
			var string="Function not exists!";
		}
		alert(string);
	}
}
document.onmousedown=click;
