function openWindow(width, height, caption, url)
{
	var iLeft = (self.screen.width  - width ) / 2;
    var iTop  = (self.screen.height - height ) / 2;
    var sOptions = "toolbar=no,status=no,resizable=no,dependent=yes,scrollbars=yes,";
    sOptions += ",width="+ width+",height="+height;
    sOptions += ",left="+iLeft+",top="+iTop;
    var oWindow = window.open(url, '', sOptions );
}

function showPhoto(url,title,lang)
{
	var left = (screen.width-612)/2;
	var top = (screen.height-432)/2 - 60;
	var str = "toolbar=no, scrollbars=auto, resizable=no, status=yes, location=no, width=600, height=450 , left="+left+", top="+top;
	var wnd = open('/gallery/placeholder_'+lang+'.html', '', str);
	wnd.imgPath = "/gallery/"+url;
	wnd.imgTitle = title;
}

function ImageLoad()
{
 this.time1 = setInterval("ShowPhoto()", 100);
}

function ShowPhoto()
{
 if((this.imgPath != "undefined") && (this.imgTitle != "undefined")) {
    TImg.src = this.imgPath;
    MyId.innerHTML = this.imgTitle;
	clearInterval(this.time1);
	this.time2 = setInterval("ResizePhoto()", 100);
 }
}

function ResizePhoto()
{
 if((TImg.complete) && (TImg.width>4)) {	 
    TdMess.innerHTML = "";
    TdMess.style.height = 0;
    if((TImg.height + MyId.clientHeight+60) > 600) {
		this.moveTo((screen.width - (TImg.width+12))/2, 20);
    }
	this.resizeTo(TImg.width+12, TImg.height + MyId.clientHeight+100);
	clearInterval(this.time2);
  }
}


function selectMenu(menu)
{
	var url = window.location.href;
	var menu = document.getElementById(menu);
	if(!menu)
		return;
	for(var i=0; i<menu.childNodes.length; i++)
	{
		var el=menu.childNodes[i];
		if(el.nodeName=="DIV")
		{
			if(el.childNodes[0].href==url)
			{
				el.className="selected"
				return;
			}
		}
	}
}

function openPlayer(x, langId)
{
	var backStr=new Array("Geriyə","Back","Назад","*","*");
	var playerCode="<br/><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"320\" height=\"285\" id=\"cartoon01\" align=\"middle\">" +
					"<param name=\"allowScriptAccess\" value=\"sameDomain\" />" +
					"<param name=\"movie\" value=\"/videos/"+x+".swf\" /><param name=\"wmode\" value=\"transparent\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#ffffff\" /><embed src=\"/videos/"+x+".swf\" quality=\"high\" bgcolor=\"#ffff00\" wmode=\"transparent\" width=\"320\" height=\"285\" name=\"cartoon01\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />" +
					"</object><br /><p align=\"right\"><a href=\"javascript:openList()\">"+backStr[langId]+"</a></p>";
	
	document.getElementById("cList").style.display="none";
	document.getElementById("player").style.display="block";
	document.getElementById("player").innerHTML=playerCode;
}
function openList()
{
	document.getElementById("cList").style.display="block";
	document.getElementById("player").innerHTML="";
	document.getElementById("player").style.display="none";	
}

function openVMuseum()
{
	var iLeft = self.screen.width / 2 - 250;
    var iTop  = self.screen.height / 2 - 200; 
	window.open('/vmuseum/index.htm','mywin','left='+iLeft+',top='+iTop+',width=520,height=390,toolbar=0,resizable=1');	
}

