var nPos1 = -800;
var galery1 = 0;
var menustep = 0;
var menupos = 290;
var lengal_content = 0;
var lenperf_content = 0;
var lenexpo_content = 0;
var lenarh_content = 0;

function openmenu() {
var menu = document.getElementById("menu"); 
//var email = document.getElementById("bl2"); 
menupos++;
menu.style.top = menupos.toString() + "px";
//email.style.top = (menupos+145).toString() + "px";
menustep++;
if (menustep < 29) setTimeout('openmenu()',10);
}

function opengal_content() {
	
	if (lengal_content < 180) 
	{
		lengal_content = lengal_content+10;
		document.getElementById("gal_content").style.height = (10+lengal_content).toString() + "px";
		setTimeout('opengal_content()',10);
	}
	else
	{
//		alert(document.getElementById("gal_content").style.fontWeight);
//		document.getElementById("gal_content").style.fontStyle
//		alert(document.getElementById("gal_content").style.fontWeight);
	}
}

function openperf_content() {
	
	if (lenperf_content < 40) 
	{
		lenperf_content = lenperf_content+10;
		document.getElementById("perf_content").style.height = (10+lenperf_content).toString() + "px";
		setTimeout('openperf_content()',10);
	}
	else
	{
//		alert(document.getElementById("gal_content").style.fontWeight);
//		document.getElementById("gal_content").style.fontStyle
//		alert(document.getElementById("gal_content").style.fontWeight);
	}
}

function openexpo_content() {
	
	if (lenexpo_content < 245) 
	{
		lenexpo_content = lenexpo_content+10;
		document.getElementById("expo_content").style.height = (10+lenexpo_content).toString() + "px";
		setTimeout('openexpo_content()',10);
	}
	else
	{
//		alert(document.getElementById("gal_content").style.fontWeight);
//		document.getElementById("gal_content").style.fontStyle
//		alert(document.getElementById("gal_content").style.fontWeight);
	}
}

function openarh_content() {
	
	if (lenarh_content < 190) 
	{
		lenarh_content = lenarh_content+10;
		document.getElementById("arh_content").style.height = (10+lenarh_content).toString() + "px";
		setTimeout('openarh_content()',10);
	}
	else
	{
//		alert(document.getElementById("gal_content").style.fontWeight);
//		document.getElementById("gal_content").style.fontStyle
//		alert(document.getElementById("gal_content").style.fontWeight);
	}
}


function closegal_content() {
	if (lengal_content > 10) 
	{
	lengal_content = lengal_content-10;
	document.getElementById("gal_content").style.height = lengal_content.toString() + "px";
	setTimeout('closegal_content()',10);
	//else document.getElementById("gal_content").style.height = "10px"
	}
}

function closeperf_content() {
	if (lenperf_content > 0) 
	{
	lenperf_content = lenperf_content-10;
	document.getElementById("perf_content").style.height = lenperf_content.toString() + "px";
	setTimeout('closeperf_content()',10);
	//else document.getElementById("gal_content").style.height = "10px"
	}
}


function closeexpo_content() {
	if (lenexpo_content > 10)
	{
	lenexpo_content = lenexpo_content-10;
	document.getElementById("expo_content").style.height = lenexpo_content.toString() + "px";
	setTimeout('closeexpo_content()',10);
	//else document.getElementById("expo_content").style.height = "10px"
	}
}

function closearh_content() {
	if (lenarh_content > 10) 
	{
	lenarh_content = lenarh_content-10;
	document.getElementById("arh_content").style.height = lenarh_content.toString() + "px";
	setTimeout('closearh_content()',10);
	//else document.getElementById("gal_content").style.height = "10px"
	}
}

function closemenu() {
var menu = document.getElementById("menu"); 
menupos--;
menu.style.top = menupos.toString() + "px";
menustep--;
if (menustep > 0) 
{
setTimeout('closemenu()',5);	
}
else
{
	//document.getElementById("pf_imageMenu1").style.visibility = "hidden";
	//document.getElementById("pf_imageMenu2").style.visibility = "hidden";
	//document.getElementById("pf_imageMenu3").style.visibility = "hidden";
	closegal_content();
	closeperf_content();
	closeexpo_content();
	closearh_content();
	toMain();
}
}

function toGal() {

	if (nPos1 < 0) toMenuItems();
	closeperf_content();
	closeexpo_content();
	closearh_content();
	opengal_content();

	//document.getElementById("pf_imageMenu2").style.visibility = "hidden";
	//document.getElementById("pf_imageMenu3").style.visibility = "hidden";
	//document.getElementById("pf_imageMenu1").style.visibility = "visible";
	//contentVis(0);

}

function toPerf() {
	
	openperf_content();
	/*document.getElementById("pf_imageMenu1").style.visibility = "hidden";
	document.getElementById("pf_imageMenu2").style.visibility = "hidden";
	document.getElementById("pf_imageMenu3").style.visibility = "visible";*/
	//contentVis(0);
}

function toExpo() {
	
	if (nPos1 < 0) toMenuItems();
	closegal_content();
	closeperf_content();
	closearh_content();
	openexpo_content();

	/*document.getElementById("pf_imageMenu1").style.visibility = "hidden";
	document.getElementById("pf_imageMenu3").style.visibility = "hidden";
	document.getElementById("pf_imageMenu2").style.visibility = "visible";*/
	//contentVis(0);
}

function toNews() {
	
	if (nPos1 < 0) toMenuItems();
	closegal_content();	
	closeperf_content();
	closeexpo_content();
	closearh_content();
	
}

function toArh() {
	
	if (nPos1 < 0) toMenuItems();
	closegal_content();	
	closeperf_content();
	closeexpo_content();
	openarh_content();
	
}


function toMain() {
	var gal = document.getElementById("galery");
	var tr1 = document.getElementById("tr1");
	var tr2 = document.getElementById("tr2");
	var tr3 = document.getElementById("tr3");
	var tr4 = document.getElementById("tr4");
	var br1 = document.getElementById("br1");
	var br11 = document.getElementById("br11");
	var br2 = document.getElementById("br2");
	var bl1 = document.getElementById("bl1");
	
	
	
	if (nPos1 <= -800) 
	{
		
	
		
	}
	else
	{
	nPos1 = nPos1 -20;
	gal.style.top = nPos1.toString() + "px";
	tr1.style.left = (1389+nPos1).toString() + "px";
	tr2.style.left = (1389+nPos1).toString() + "px";
	tr3.style.left = (1389+nPos1).toString() + "px";
	tr4.style.left = (1520+nPos1).toString() + "px";	
	br1.style.top = (1220+nPos1).toString() + "px";
	br2.style.top = (1220+nPos1).toString() + "px";
	bl1.style.left = (78-(800+nPos1)).toString() + "px";

	setTimeout('toMain()',0);

	}
	
}

function toMenuItems() {
	var gal = document.getElementById("galery");
	var tr1 = document.getElementById("tr1");
	var tr2 = document.getElementById("tr2");
	var tr3 = document.getElementById("tr3");
	var tr4 = document.getElementById("tr4");
	var br1 = document.getElementById("br1");
	var br2 = document.getElementById("br2");
	var bl1 = document.getElementById("bl1");
	var bl2 = document.getElementById("bl2");
	
	if (nPos1 >= 0) 
	{
		openmenu();		
	}
	else
	{
	nPos1 = nPos1 +20;
	gal.style.top = nPos1.toString() + "px";
	tr1.style.left = (1389+nPos1).toString() + "px";
	tr2.style.left = (1389+nPos1).toString() + "px";
	tr3.style.left = (1389+nPos1).toString() + "px";
	tr4.style.left = (1520+nPos1).toString() + "px";	
	br1.style.top = (1440+nPos1).toString() + "px";
	br2.style.top = (1440+nPos1).toString() + "px";
	bl1.style.left = (78-(800+nPos1)).toString() + "px";

	setTimeout('toMenuItems()',0);

	}
	
}


function contentVis(num) {

switch(num){
	case 0: 
			////contentFade(1,1);
			//document.getElementById("content1").style.visibility = "hidden";
			////document.getElementById("galery").style.visibility = "visible";
			break;
	case 1: 
		
		//document.getElementById("content1").innerHTML = '<div style="top:230px; left:130px; height:125px; position:absolute; z-index:auto"><img src="images/1/1s.jpg" width="71"  hspace="8" onclick="showImage(1);"/><img src="images/1/2s.jpg" onclick="showImage(2);" width="74"  hspace="8" /><img src="images/1/3s.jpg" onclick="showImage(3);" width="91"  hspace="8" /><img src="images/1/4s.jpg" onclick="showImage(4);" width="48"  hspace="8" /><img src="images/1/5s.jpg" onclick="showImage(5);" width="74"  hspace="8" /></div><div style="top:370px; left:130px; height:125px; position:absolute; z-index:auto"><img src="images/1/7s.jpg" onclick="showImage(7);" width="81"  hspace="8" /><img src="images/1/8s.jpg" onclick="showImage(8);" width="76"  hspace="8" /><img src="images/1/9s.jpg" onclick="showImage(9);" width="66"  hspace="8" /><img src="images/1/10s.jpg" onclick="showImage(10);" width="87"  hspace="8" /></div><div style="top:512px; left:130px; height:125px; position:absolute; z-index:auto"><img src="images/1/12s.jpg" onclick="showImage(12);" width="50"  hspace="8" /><img src="images/1/13s.jpg" onclick="showImage(13);" width="56"  hspace="7" /><img src="images/1/14s.jpg" onclick="showImage(14);" width="48"  hspace="7" /><img src="images/1/15s.jpg" onclick="showImage(15);" width="79"  hspace="7" /><img src="images/1/16s.jpg" onclick="showImage(16);" width="83"  hspace="7" /><img src="images/1/17s.jpg" onclick="showImage(17);" width="81"  hspace="8" /></div><div style="top:652px; left:130px; height:125px; position:absolute; z-index:auto"><img src="images/1/18s.jpg" onclick="showImage(18);" width="69"  hspace="8" /><img src="images/1/19s.jpg" onclick="showImage(19);" width="104"  hspace="8" /><img src="images/1/20s.jpg" onclick="showImage(20);" width="94"  hspace="8" /><img src="images/1/21s.jpg" onclick="showImage(21);" width="154"  hspace="8" /></div><div style="top:230px; left:581px; height:125px; position:absolute; z-index:auto"><img src="images/1/6s.jpg" width="129" height="200" onclick="showImage(6);"/></div></div><div style="top:430px; left:625px; height:125px; position:absolute; z-index:auto"><img src="images/1/22s.jpg" width="85" height="61" vspace="7"  onclick="showImage(22);"/><br /><img src="images/1/23s.jpg" width="85" height="56" vspace="7"  onclick="showImage(23);"/><br /><img src="images/1/24s.jpg" width="85" height="56" vspace="7"  onclick="showImage(24);"/><br /><img src="images/1/25s.jpg" width="85" height="56" vspace="7"  onclick="showImage(25);"/><br /><img src="images/1/26s.jpg" width="85" height="55" vspace="7"  onclick="showImage(26);"/><br /></div>';
		////document.getElementById("content1").style.visibility = "visible";
		
		//contentFade(0,0);
		//document.getElementById("galery").style.visibility = "hidden";
		//document.getElementById("content1").style.opacity = 0.8;
		break;
		
	case 2: 
		
		document.getElementById("content1").style.visibility = "visible";
		contentFade(0,0);
		document.getElementById("content1").innerHTML = "<img src='images/hex2.jpg' border='0px' onclick='showImage(1);'/>";
		document.getElementById("galery").style.visibility = "hidden";
		//document.getElementById("content1").style.opacity = 0.8;
		break;
		
   //default: document.getElementById("content1").style.visibility = "hidden";
}
	
}


function contentFade(opas,dir) {
	var op = opas;
	document.getElementById("content1").style.opacity = op;
	document.getElementById("content1").style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity="+100*op+")"
	if (dir == 0) 
	{
	if (document.getElementById("galery").style.height != "845px")
	{
	document.getElementById("content1").style.height = (645 +200*op).toString() + "px";
	document.getElementById("galery").style.height = (645 +200*op).toString() + "px";
	}
	op = op + 0.025;
	if (op <= 1.025) setTimeout('contentFade('+op+',0)',0);
	}
	else 
	{
	if (document.getElementById("galery").style.height != "650px")
	{
	document.getElementById("content1").style.height = (645 +200*op).toString() + "px";
	document.getElementById("galery").style.height = (645 +200*op).toString() + "px";
	}
	op = op - 0.025;
	if (op >= 0) setTimeout('contentFade('+op+',1)',0);
	else document.getElementById("content1").style.visibility = "hidden";
	}
	
}

function showInfo(num) {

	document.getElementById("w50").style.visibility = "visible";
	document.getElementById("w51").style.visibility = "visible";
	document.getElementById("w51").style.visibility = "visible";

	document.getElementById("w50").style.opacity = 0.8;
	document.getElementById("w50").style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=80)"
	document.getElementById("w50").style.MozOpacity = 0.8;
	document.getElementById("w50").style.KhtmlOpacity = 0.8;

	document.getElementById("al").style.visibility = "hidden";
	document.getElementById("ar").style.visibility = "hidden";
	if (num == 0)
	{
	document.getElementById("desc1").innerHTML = "<p style='padding:20px'><strong>Биография</strong></p><p style='padding:20px'>Гориславец  Артём Владимирович родился в 1979 году в городе Кентау,<br /> Южно-Казахстанской области.<br />  В 1996 году  поступил в Южно Казахстанский Государственный университет, на художественно  графический факультет, который окончил в 2000 году. <br />  Керамикой  начал заниматься в 1998 году в студии у Ваштаг Ирины Александровны   После  окончания университета начал самостоятельно заниматься собственным творчеством  и основное направление деятельности посвятил художественной  керамике.<br />  За  прошедший период в работе с глиной сформировалось три направления. Это  керамическая скульптура, керамические панно и мелкая пластика. </p><p style='padding:20px'>  В 2002  году участник выставки молодых художников Южно- Казахстанской области. В этом  же году провел первую персональную выставку. Персональная выставка &quot;Инкрустация чувств&quot;   Шымкент Областной музей <br />  Апрель 2004 года. <br/> В 2004 году прошел шестимесячный курс обучения  у скульптора Эдуарда Казаряна.<br/> Выставка  декоративно-прикладного искусства  Шымкент   Март 2005 года.<br />  Дипломант выставки<br />  Международный Фестиваль Ленд-Арта    Алматы-Шымкент 2005 год.<br />  41 Симпозиум керамической скульптуры,  Республика Польша, <br />  Август 2005 года.<br/> Молодежная выставка &quot;Золотая осень&quot; Октябрь  2005 года. <br />  Фотовыставка &quot;Ленд-Арт&quot; Ноябрь 2005 года.  Галерея &quot;Вояджер&quot; Алматы. <br />  Совместная выставка с Георгием Макаровым  &quot;Соприкосновение&quot; <br />  Январь 2006 года   Галерея &quot;Вояджер&quot;  Алматы<br />   Весенняя выставка молодежного Союза Художников  &quot;Река Искусства&quot;<br />  Шымкент галерея Областного краеведческого  музея  Март 2006  <br />  Дипломант выставки<br />  Выставка  казахстанской керамики &quot;Хранители пустоты&quot;   <br />  Центральный  выставочный зал   Алматы Апрель 2006 <br /> Персональная выставка &quot;Дотянуться до небес&quot;  Областной музей <br />  Шымкент   Май 2006 <br />  Молодежный фестиваль &quot;Мастерство и  молодость&quot;  галерея А-3 Москва <br />  Август 2006 год<br/> В 2006 году вступил в Молодежный Союз  Художников <br /> Симпозиум художественной керамики  Эстония   г.Кохилла  июнь 2008 <br /> Симпозиум художественной керамики.Китай г.Дэхуа 2009.<br /> Симпозиум художественной керамики. Латвия г.Рига 2010.</p>";
	}
	if (num == 1)
	{
	document.getElementById("desc1").innerHTML = "<p><strong>Контакты</strong></p><p>Гориславец  Артём Владимирович</p>"
	}
	if (num == 2)
	{
		$('desc1').load('mailform.html')
	//document.getElementById("desc1").innerHTML = '<p><strong>Обратная связь</strong></p><form id="form1" name="form1" method="post" action="sendmail.php"><table width="405" border="0" cellspacing="5" cellpadding="0"><tr><td style="width:150px"><strong>Ваше имя:</strong></td><td width="255" align="right"><input type="text" name="textfield" id="textfield" style="width:255px" /></td></tr><tr><td><strong>Ваш e-mail:</strong></td><td width="255" align="right"><input type="text" name="textfield2" id="textfield2" style="width:255px" /></td></tr><tr><td><strong>Заголовок сообщения:</strong></td><td width="255" align="right"><input type="text" name="textfield3" id="textfield3" style="width:255px" /></td></tr><tr><td colspan="2" style="background-image:url(images/messagetop.gif); color:#d1ccac; height:22px;">&nbsp;<strong>Текст:</strong></td></tr><tr><td colspan="2"><textarea name="textarea" id="textarea" cols="45" rows="5" style="width:410px"></textarea></td></tr><tr><td>&nbsp;</td><td width="255" align="right"><img src="images/messagebutton.gif" width="109" height="33" onclick="document.forms[0].submit();" /></td></tr></table></form>'
	}

}

function showImage(dir1, img) {

	var nextimg, previmg, scrl = 0;
	/*
	alert(window.scrollY);
	alert(document.body.offsetTop);
	alert(document.body.offsetParent);
	alert(document.body.scrollTop);
	alert(document.body.clientTop);
	alert(document.body.offsetHeight);
	alert(document.body.scrollHeight);
	alert(document.body.clientHeight);
	alert(window.pageYOffset);
	alert(document.getElementById("maindiv").scrollTop);
	alert(document.getElementById("maindiv").offsetTop);
	alert(document.getElementById("maindiv").parentNode.scrollTop);
	alert(document.getElementById("maindiv").parentNode.offsetTop);
	*/
	
	
	if (window.scrollY != null) scrl = window.scrollY.toInt();
	else if (window.pageYOffset != null) scrl = window.pageYOffset.toInt();
	else if (document.body.scrollTop != null) scrl = document.documentElement.scrollTop.toInt();
	else if (document.body.offsetTop != null) scrl = document.body.offsetTop.toInt();

	
	//alert(scrl);
	scrl = scrl-150;
	if (scrl < 0) scrl = 0;
	
	document.getElementById("w50").style.visibility = "visible";
	document.getElementById("w51").style.visibility = "visible";
	document.getElementById("w52").style.visibility = "visible";
	document.getElementById("al").style.visibility = "visible";
	document.getElementById("ar").style.visibility = "visible";
	document.getElementById("bigpict").style.visibility = "visible";
	////document.getElementById("w51").style.top = scrl.toString() + "px";
	document.getElementById("sp51").style.height = scrl.toString() + "px";
	document.getElementById("al").style.top = (535 + scrl).toString() + "px";
	document.getElementById("ar").style.top = (535 + scrl).toString() + "px";
	document.getElementById("bigpict").src = "images/loading1.gif"
	
	/*morph6.start({
			'opacity': 1		
		});*/
	//$('w50').fade(0.8);
	//$('w51').fade(0);
$('bigpict').tween('opacity', 0);
	//$('bigpict').fade(0);
	
	document.getElementById("w50").style.opacity = 0.8;
	document.getElementById("w50").style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=80)"
	document.getElementById("w50").style.MozOpacity = 0.8;
	document.getElementById("w50").style.KhtmlOpacity = 0.8;
	
//	document.getElementById("w51").style.left = "230px";
$('bigpict').onload = function () {
    //document.getElementById("w51").style.width = ((document.getElementById("bigpict").width).toInt() + 70).toString() + "px";
	var picw = $('bigpict').width+70;
	if (picw < 110) picw = 600; 
	var picw1 = 400 - (picw/2);
	
	//$('w51').style.left = (600 - picw/2).toString()+ "px";
	//$('w51').style.width = picw.toString()+ "px";
	//$('ar').style.left = (picw-55).toString()+ "px";;	
	$('ar').tween('left', picw-55);
	$('w51').tween('width', picw);
	$('w52').tween('left',picw1);
$('bigpict').tween('opacity', 1);
	//$('w51').tween('opacity', 1);
	//$('w51').fade(1);
	
};

	document.getElementById("bigpict").src = "images/"+dir1+"/"+img+".jpg";
	//document.getElementById("desc").innerHTML = desc;
	if(img == 1) previmg = 1;
	else previmg = img-1;
	if(dir1 == 1)
	{
	$('w50').style.height = "1450px";
	$('w51').style.height = "1450px";
	if(img == 3) document.getElementById("desc").innerHTML = "<p><b>Дотянуться до небес</b><br/>керамическая инсталляция<br/>2006 год 120см</p>";
	else if(img == 4) document.getElementById("desc").innerHTML = "<p><b>Похищение Европы</b></p>";
	else document.getElementById("desc").innerHTML = "&nbsp;";	
	if(img == 26) nextimg = 26;
	else nextimg = img+1;
	}
	if(dir1 == 121)
	{
	$('w50').style.height = "1000px";
	$('w51').style.height = "1000px";
	if(img == 16) nextimg = 16;
	else nextimg = img+1;
	}
	if(dir1 == 122)
	{
	$('w50').style.height = "1350px";
	$('w51').style.height = "1350px";
	if(img == 13) nextimg = 13;
	else nextimg = img+1;
	}
	if(dir1 == 123)
	{
	$('w50').style.height = "1350px";
	$('w51').style.height = "1350px";
	if(img == 11) nextimg = 11;
	else nextimg = img+1;
	}
	if(dir1 == 13)
	{
	$('w50').style.height = "1500px";
	$('w51').style.height = "1500px";
	if(img == 22) nextimg = 22;
	else nextimg = img+1;
	}
	if(dir1 == 14)
	{
	$('w50').style.height = "1510px";
	$('w51').style.height = "1510px";
	if(img == 20) nextimg = 20;
	else nextimg = img+1;
	}
	if(dir1 == 15)
	{
	$('w50').style.height = "1000px";
	$('w51').style.height = "1000px";
	if(img == 18) nextimg = 18;
	else nextimg = img+1;
	}
	if(dir1 == 16)
	{
	$('w50').style.height = "1250px";
	$('w51').style.height = "1250px";
	if(img == 12) nextimg = 12;
	else nextimg = img+1;
	}
	if(dir1 == 17)
	{
	$('w50').style.height = "1550px";
	$('w51').style.height = "1550px";
	if(img == 13) nextimg = 13;
	else nextimg = img+1;
	}
	if(dir1 == 18)
	{
	$('w50').style.height = "1550px";
	$('w51').style.height = "1550px";
	if(img == 21) nextimg = 21;
	else nextimg = img+1;
	}
	if(dir1 == 21)
	{
	$('w50').style.height = "1300px";
	$('w51').style.height = "1300px";
	if(img == 14) nextimg = 14;
	else nextimg = img+1;
	}
	if(dir1 == 22)
	{
	$('w50').style.height = "1400px";
	$('w51').style.height = "1400px";
	if(img == 12) nextimg = 12;
	else nextimg = img+1;
	}
	if(dir1 == 23)
	{
	$('w50').style.height = "1400px";
	$('w51').style.height = "1400px";
	if(img == 13) nextimg = 13;
	else nextimg = img+1;
	}
	if(dir1 == 24)
	{
	$('w50').style.height = "1350px";
	$('w51').style.height = "1350px";
	if(img == 15) nextimg = 15;
	else nextimg = img+1;
	}
	if(dir1 == 25)
	{
	$('w50').style.height = "1200px";
	$('w51').style.height = "1200px";
	if(img == 13) nextimg = 13;
	else nextimg = img+1;
	}
	document.getElementById("ar1").href = "javascript:showImage("+dir1+","+nextimg+")";
	document.getElementById("al1").href = "javascript:showImage("+dir1+","+previmg+")";
	if(dir1 == 26)
	{
	$('w50').style.height = "1200px";
	$('w51').style.height = "1200px";
	if(img == 16) nextimg = 16;
	else nextimg = img+1;
	}
	if(dir1 == 27)
	{
	$('w50').style.height = "1450px";
	$('w51').style.height = "1450px";
	if(img == 18) nextimg = 18;
	else nextimg = img+1;
	}
	if(dir1 == 28)
	{
	$('w50').style.height = "1450px";
	$('w51').style.height = "1450px";
	if(img == 32) nextimg = 32;
	else nextimg = img+1;
	}
	if(dir1 == 29)
	{
	$('w50').style.height = "1450px";
	$('w51').style.height = "1450px";
	if(img == 32) nextimg = 32;
	else nextimg = img+1;
	}
	if(dir1 == 281)
	{
	$('w50').style.height = "1450px";
	$('w51').style.height = "1450px";
	if(img == 10) nextimg = 10;
	else nextimg = img+1;
	}
	if(dir1 == 282)
	{
	$('w50').style.height = "1450px";
	$('w51').style.height = "1450px";
	if(img == 30) nextimg = 30;
	else nextimg = img+1;
	}
	if(dir1 == 31)
	{
	$('w50').style.height = "1200px";
	$('w51').style.height = "1200px";
	if(img == 13) nextimg = 13;
	else nextimg = img+1;
	}
	if(dir1 == 32)
	{
	$('w50').style.height = "1300px";
	$('w51').style.height = "1300px";
	if(img == 19) nextimg = 19;
	else nextimg = img+1;
	}
	if(dir1 == 33)
	{
	$('w50').style.height = "1400px";
	$('w51').style.height = "1400px";
	if(img == 19) nextimg = 19;
	else nextimg = img+1;
	}
	if(dir1 == 34)
	{
	$('w50').style.height = "1700px";
	$('w51').style.height = "1700px";
	if(img == 33) nextimg = 33;
	else nextimg = img+1;
	}
	if(dir1 == 35)
	{
	$('w50').style.height = "1400px";
	$('w51').style.height = "1400px";
	if(img == 16) nextimg = 16;
	else nextimg = img+1;
	}
	if(dir1 == 36)
	{
	$('w50').style.height = "1500px";
	$('w51').style.height = "1500px";
	if(img == 15) nextimg = 15;
	else nextimg = img+1;
	}
	document.getElementById("ar1").href = "javascript:showImage("+dir1+","+nextimg+")";
	document.getElementById("al1").href = "javascript:showImage("+dir1+","+previmg+")";
	document.getElementById("ar1").href = "javascript:showImage("+dir1+","+nextimg+")";
	document.getElementById("al1").href = "javascript:showImage("+dir1+","+previmg+")";
	
	//$('bigpict').fade(1);
	//alert(document.getElementById("w51").width);
}

function nextImage() {
	document.getElementById("desc").innerHTML = "&nbsp;";
	document.getElementById("desc1").innerHTML = "&nbsp;";
	document.getElementById("bigpict").src = "images/spacer.gif"
	document.getElementById("sp51").style.height = "0px";
	document.getElementById("bigpict").style.visibility = "hidden";
	////$('bigpict').tween('opacity', 0);
	document.getElementById("w50").style.visibility = "hidden";
	document.getElementById("w51").style.visibility = "hidden";
	document.getElementById("w52").style.visibility = "hidden";
	document.getElementById("bigpict").style.visibility = "hidden";
	document.getElementById("al").style.visibility = "hidden";
	document.getElementById("ar").style.visibility = "hidden";
	
	
}

function centrovka()
{
	
	document.getElementById("ar").style.left = "50%";
	if (document.getElementById("ar").offsetLeft.toInt() > 628)
	document.getElementById("maindiv").style.left = (document.getElementById("ar").offsetLeft.toInt()- 628)+"px";
	
	document.getElementById("ar").style.top = "50%";
	//alert(document.getElementById("ar").offsetTop.toInt());
	if (document.getElementById("ar").offsetTop.toInt() > 320)
	{
	document.getElementById("maindiv").style.top = (document.getElementById("ar").offsetTop.toInt()- 285)+"px";
	document.getElementById("topbox").style.height = (document.getElementById("ar").offsetTop.toInt()-5)+"px";
	document.getElementById("w50").style.height = "100%";
	document.getElementById("w51").style.height = "100%";
	document.getElementById("w52").style.height = "100%";
	document.getElementById("desc1").style.height = "100%";
	document.getElementById("br11").style.top = "94%";
	}
	/*
	if((document.body.clientWidth != null) && (document.body.clientWidth.toInt() > 1257))
	{
		document.getElementById("maindiv").style.left = (document.body.clientWidth.toInt() - 1257)/2;
		document.getElementById("content1").style.left = ((document.body.clientWidth.toInt() - 1257)/2)+325;
		document.getElementById("w52").style.left = ((document.body.clientWidth.toInt() - 1257)/2)+200;
	}
	else
	{
		if((window.innerWidth != null) && (window.innerWidth.toInt() > 1267))
		{
			document.getElementById("maindiv").style.left = (window.innerWidth.toInt() - 1257)/2;
			document.getElementById("content1").style.left = ((window.innerWidth.toInt() - 1257)/2)+325;
			document.getElementById("w52").style.left = ((window.innerWidth.toInt() - 1257)/2)+200;
		}
	}
	
	
if((document.body.clientHeight != null) && (document.body.clientHeight.toInt() > 570))
	{
		document.getElementById("maindiv").style.top = (document.body.clientHeight.toInt() - 570)/2;
		document.getElementById("content1").style.top = ((document.body.clientHeight.toInt() - 570)/2);
		document.getElementById("w52").style.top = ((document.body.clientHeight.toInt() - 570)/2);
	}
	else
	{
		if((window.innerHeight != null) && (window.innerHeight.toInt() > 570))
		{
			document.getElementById("maindiv").style.top = (window.innerHeight.toInt() - 570)/2;
			document.getElementById("content1").style.top = ((window.innerHeight.toInt() - 570)/2);
			document.getElementById("w52").style.top = ((window.innerHeight.toInt() - 570)/2);
		}
	}
*/

var myImages = new Asset.images([
'CSSFiles/images/1.jpg',
'CSSFiles/images/2.jpg',
'CSSFiles/images/3.jpg',
'CSSFiles/images/4.jpg',
'CSSFiles/images/5.jpg',
'CSSFiles/images/6.jpg',
'CSSFiles/images/7.jpg',
'CSSFiles/images/8.jpg',
'CSSFiles/images/a1.jpg',
'CSSFiles/images/a2.jpg',
'CSSFiles/images/a3.jpg',
'CSSFiles/images/a4.jpg',
'CSSFiles/images/a5.jpg',
'CSSFiles/images/a6.jpg',
'CSSFiles/images/a7.jpg',
'CSSFiles/images/a8.jpg',
'CSSFiles/images/a9.jpg',
'CSSFiles/images/a10.jpg',
'CSSFiles/images/mask.png',
'CSSFiles/images/p1.jpg',
'CSSFiles/images/p2.jpg',
'CSSFiles/images/p3.jpg',
'CSSFiles/images/v1.jpg',
'CSSFiles/images/v2.jpg',
'CSSFiles/images/v3.jpg',
'CSSFiles/images/v4.jpg',
'CSSFiles/images/v5.jpg',
'CSSFiles/images/v6.jpg',
'CSSFiles/images/v7.jpg'

], {
onProgress: function(counter, index){
//alert(counter + ' image loaded ...');
//document.getElementById("desc").innerHTML="<b>"+counter+"<b>";
},
onComplete: function(){
//alert('All images loaded!');
//	document.getElementById("w50").style.visibility = "hidden";
	//document.getElementById("w51").style.visibility = "hidden";
	//document.getElementById("w52").style.visibility = "hidden";
}
});


}
