function FindObject(n, d) 
{ 
 var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
   d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
 if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
 for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
 if(!x && d.getElementById) x=d.getElementById(n); return x;
}
	
	// Html Settings
	var ThumbNailHtmlAreaID = 'VirtualTour';
	var ThumbNailPriviewAreaID = 'ImagePriview';
	var ThumbNailTitleAreaID = "Title";
	var NextButtonID = 'Next';
	var PreviousButtonID = 'Back'
	var BgColor = "#58596A";
	var ImagePath = '../Images/ThumbNail/';
	var PageName = "Menu11.html"
	var HorizontalLength = 3;
	var Images = new Array();
	var ImageLength = 0;
	var LanguageIndexer = 0;
	//									   Küçük 		Büyük				 Türkçe					Almanca							İngilizce				Rusça
	//									   Resim		Resim				 Başlık					Başlık							Başlık					Başlık
	this.Images[ImageLength++] = new Array("1031.jpg", "1032.jpg", new Array("Kapalı Havuz", 		"Hallen Bad", 	"Indoor Pool", 			"&#1047;&#1072;&#1082;&#1088;&#1099;&#1090;&#1099;&#1081; &#1073;&#1072;&#1089;&#1089;&#1077;&#1081;&#1085;"));
	this.Images[ImageLength++] = new Array("1061.jpg", "1062.jpg", new Array("Havuz 1", 			"Schwimmbad 1", 				"Pool 1", 				"&#1041;&#1072;&#1089;&#1089;&#1077;&#1081;&#1085; 1"));
	this.Images[ImageLength++] = new Array("1071.jpg", "1072.jpg", new Array("Havuz 2", 			"Schwimmbad 2", 				"Pool 2",				"&#1041;&#1072;&#1089;&#1089;&#1077;&#1081;&#1085; 2"));
	this.Images[ImageLength++] = new Array("1081.jpg", "1082.jpg", new Array("Havuz 3", 			"Schwimmbad 3", 				"Pool 3", 				"&#1041;&#1072;&#1089;&#1089;&#1077;&#1081;&#1085; 3"));
	this.Images[ImageLength++] = new Array("1101.jpg", "1102.jpg", new Array("Havuz 4", 			"Schwimmbad 4", 				"Pool 4", 				"&#1041;&#1072;&#1089;&#1089;&#1077;&#1081;&#1085; 4"));
	this.Images[ImageLength++] = new Array("1111.jpg", "1112.jpg", new Array("Havuz 5", 			"Schwimmbad 5", 				"Pool 5", 				"&#1041;&#1072;&#1089;&#1089;&#1077;&#1081;&#1085; 5"));
	this.Images[ImageLength++] = new Array("1121.jpg", "1122.jpg", new Array("Havuz 6", 			"Schwimmbad 6", 				"Pool 6", 				"&#1041;&#1072;&#1089;&#1089;&#1077;&#1081;&#1085; 6"));
	this.Images[ImageLength++] = new Array("1141.jpg", "1142.jpg", new Array("Havuz 7", 			"Schwimmbad 7", 				"Pool 7", 				"&#1041;&#1072;&#1089;&#1089;&#1077;&#1081;&#1085; 7"));
	this.Images[ImageLength++] = new Array("1151.jpg", "1152.jpg", new Array("Havuz 8", 			"Schwimmbad 8", 				"Pool 8", 				"&#1041;&#1072;&#1089;&#1089;&#1077;&#1081;&#1085; 8"));
	this.Images[ImageLength++] = new Array("1161.jpg", "1162.jpg", new Array("Havuz 9", 			"Schwimmbad 9", 				"Pool 9", 				"&#1041;&#1072;&#1089;&#1089;&#1077;&#1081;&#1085; 9"));
	this.Images[ImageLength++] = new Array("1201.jpg", "1202.jpg", new Array("Plaj 1", 				"Strand 1", 					"Beach 1", 				"&#1055;&#1083;&#1103;&#1078; 1"));
	this.Images[ImageLength++] = new Array("1211.jpg", "1212.jpg", new Array("Plaj 2", 				"Strand 2", 					"Beach 2", 				"&#1055;&#1083;&#1103;&#1078; 2"));
	this.Images[ImageLength++] = new Array("1221.jpg", "1222.jpg", new Array("Plaj 3", 				"Strand 3", 					"Beach 3", 				"&#1055;&#1083;&#1103;&#1078; 3"));
	this.Images[ImageLength++] = new Array("1231.jpg", "1232.jpg", new Array("Plaj 4", 				"Strand 4", 					"Beach 4", 				"&#1055;&#1083;&#1103;&#1078; 4"));
	this.Images[ImageLength++] = new Array("1251.jpg", "1252.jpg", new Array("Plaj 5", 				"Strand 5", 					"Beach 5", 				"&#1055;&#1083;&#1103;&#1078; 5"));
	this.Images[ImageLength++] = new Array("1261.jpg", "1262.jpg", new Array("Plaj 6", 				"Strand 6", 					"Beach 6", 				"&#1055;&#1083;&#1103;&#1078; 6"));
	this.Images[ImageLength++] = new Array("1281.jpg", "1282.jpg", new Array("Plaj 7", 				"Strand 7", 					"Beach 7", 				"&#1055;&#1083;&#1103;&#1078; 7"));
	this.Images[ImageLength++] = new Array("1291.jpg", "1292.jpg", new Array("Kids Animasyon", 		"Kinder Animation", 			"Kids Animation", 		"&#1044;&#1077;&#1090;&#1089;&#1082;&#1072;&#1103; &#1072;&#1085;&#1080;&#1084;&#1072;&#1094;&#1080;&#1103;"));
	this.Images[ImageLength++] = new Array("1311.jpg", "1312.jpg", new Array("Kids Club 1", 		"Kinder Club 1", 				"Kids Club 1", 			"&#1052;&#1080;&#1085;&#1080; &#1082;&#1083;&#1091;&#1073; 1"));
	this.Images[ImageLength++] = new Array("1321.jpg", "1322.jpg", new Array("Kids Club 2", 		"Kinder Club 2", 				"Kids Club 2", 			"&#1052;&#1080;&#1085;&#1080; &#1082;&#1083;&#1091;&#1073; 2"));
	this.Images[ImageLength++] = new Array("2041.jpg", "2042.jpg", new Array("Disco", 				"Disco", 						"Disco", 				"&#1044;&#1080;&#1089;&#1082;&#1086;&#1090;&#1077;&#1082;&#1072;"));
	this.Images[ImageLength++] = new Array("2051.jpg", "2052.jpg", new Array("Bowling", 			"Bowling Saal", 				"Bowling", 				"&#1041;&#1086;&#1091;&#1083;&#1080;&#1085;&#1075;"));
	this.Images[ImageLength++] = new Array("2071.jpg", "2072.jpg", new Array("Animasyon 1", 		"Animation 1", 					"Animation 1", 			"&#1040;&#1085;&#1080;&#1084;&#1072;&#1094;&#1080;&#1103; 1"));
	this.Images[ImageLength++] = new Array("2131.jpg", "2132.jpg", new Array("Animasyon 2", 		"Animation 2", 					"Animation 2", 			"&#1040;&#1085;&#1080;&#1084;&#1072;&#1094;&#1080;&#1103; 2"));
	this.Images[ImageLength++] = new Array("2091.jpg", "2092.jpg", new Array("Su Sporları 1", 		"Wasser Sports 1", 				"Water Sports 1", 		"&#1042;&#1086;&#1076;&#1085;&#1099;&#1077; &#1074;&#1080;&#1076;&#1099; &#1089;&#1087;&#1086;&#1088;&#1090;&#1099; 1"));
	this.Images[ImageLength++] = new Array("2081.jpg", "2082.jpg", new Array("Su Sporları 2", 		"Wasser Sports 2", 				"Water Sports 2", 		"&#1042;&#1086;&#1076;&#1085;&#1099;&#1077; &#1074;&#1080;&#1076;&#1099; &#1089;&#1087;&#1086;&#1088;&#1090;&#1099; 2"));
	this.Images[ImageLength++] = new Array("2151.jpg", "2152.jpg", new Array("Su Sporları 3", 		"Wasser Sports 3", 				"Water Sports 3", 		"&#1042;&#1086;&#1076;&#1085;&#1099;&#1077; &#1074;&#1080;&#1076;&#1099; &#1089;&#1087;&#1086;&#1088;&#1090;&#1099; 3"));
	this.Images[ImageLength++] = new Array("2171.jpg", "2172.jpg", new Array("Kongre 1", 			"Kongresse 1", 					"Congresse 1", 			"&#1050;&#1086;&#1085;&#1075;&#1088;&#1077; 1"));
	this.Images[ImageLength++] = new Array("2191.jpg", "2192.jpg", new Array("Kongre 2", 			"Kongresse 2", 					"Congresse 2", 			"&#1050;&#1086;&#1085;&#1075;&#1088;&#1077; 2"));
	this.Images[ImageLength++] = new Array("2241.jpg", "2242.jpg", new Array("Kongre 3", 			"Kongresse 3", 					"Congresse 3", 			"&#1050;&#1086;&#1085;&#1075;&#1088;&#1077; 3"));
	this.Images[ImageLength++] = new Array("2251.jpg", "2252.jpg", new Array("Restoran 1", 			"Restaurant 1", 				"Restaurant 1", 		"&#1056;&#1077;&#1089;&#1090;&#1086;&#1088;&#1072;&#1085; 1"));
	this.Images[ImageLength++] = new Array("2281.jpg", "2282.jpg", new Array("Restoran 2", 			"Restaurant 2",	 				"Restaurant 2", 		"&#1056;&#1077;&#1089;&#1090;&#1086;&#1088;&#1072;&#1085; 2"));
	this.Images[ImageLength++] = new Array("2221.jpg", "2222.jpg", new Array("Restoran 3", 			"Restaurant 3", 				"Restaurant 3", 		"&#1056;&#1077;&#1089;&#1090;&#1086;&#1088;&#1072;&#1085; 3"));
	this.Images[ImageLength++] = new Array("3031.jpg", "3032.jpg", new Array("Bahçe 1", 			"Garten 1", 					"Garden 1", 			"&#1057;&#1072;&#1076; 1"));
	this.Images[ImageLength++] = new Array("3041.jpg", "3042.jpg", new Array("Bahçe 2", 			"Garten 2", 					"Garden 2", 			"&#1057;&#1072;&#1076; 2"));
	this.Images[ImageLength++] = new Array("3051.jpg", "3052.jpg", new Array("Bahçe 3", 			"Garten 3", 					"Garden 3", 			"&#1057;&#1072;&#1076; 3"));
	this.Images[ImageLength++] = new Array("3061.jpg", "3062.jpg", new Array("Bahçe 4", 			"Garten 4", 					"Garden 4", 			"&#1057;&#1072;&#1076; 4"));
	this.Images[ImageLength++] = new Array("1001.jpg", "1002.jpg", new Array("Genel 1", 			"Allgemein 1", 					"General View 1", 		"&#1054;&#1073;&#1097;&#1080;&#1081; 1"));
        this.Images[ImageLength++] = new Array("3081.jpg", "3082.jpg", new Array("Genel 2", 			"Allgemein 1", 					"General View 1", 		"&#1054;&#1073;&#1097;&#1080;&#1081; 1"));
	this.Images[ImageLength++] = new Array("3111.jpg", "3112.jpg", new Array("Genel 3", 			"Allgemein 2", 					"General View 2", 		"&#1054;&#1073;&#1097;&#1080;&#1081; 2"));
	this.Images[ImageLength++] = new Array("3141.jpg", "3142.jpg", new Array("Genel 4", 			"Allgemein 3", 					"General View 3", 		"&#1054;&#1073;&#1097;&#1080;&#1081; 3"));
	this.Images[ImageLength++] = new Array("3091.jpg", "3092.jpg", new Array("Genel 5", 			"Allgemein 4", 					"General View 4", 		"&#1054;&#1073;&#1097;&#1080;&#1081; 4"));
	this.Images[ImageLength++] = new Array("3121.jpg", "3122.jpg", new Array("Genel 6", 			"Allgemein 5", 					"General View 5", 		"&#1054;&#1073;&#1097;&#1080;&#1081; 5"));
	this.Images[ImageLength++] = new Array("3131.jpg", "3132.jpg", new Array("Genel 7", 			"Allgemein 6", 					"General View 6", 		"&#1054;&#1073;&#1097;&#1080;&#1081; 6"));
	this.Images[ImageLength++] = new Array("3101.jpg", "3102.jpg", new Array("Genel 8", 			"Allgemein 7", 					"General View 7", 		"&#1054;&#1073;&#1097;&#1080;&#1081; 7"));
	this.Images[ImageLength++] = new Array("3181.jpg", "3182.jpg", new Array("Resepsiyon", 			"Rezeption", 					"Reception",			"&#1056;&#1077;&#1089;&#1077;&#1087;&#1096;&#1077;&#1085;"));
	this.Images[ImageLength++] = new Array("3171.jpg", "3172.jpg", new Array("Lobi 1", 				"Vorhalle 1", 					"Lobby 1", 				"&#1051;&#1086;&#1073;&#1073;&#1080; 1"));
	this.Images[ImageLength++] = new Array("3161.jpg", "3162.jpg", new Array("Lobi 2", 				"Vorhalle 2", 					"Lobby 2", 				"&#1051;&#1086;&#1073;&#1073;&#1080; 2"));
	this.Images[ImageLength++] = new Array("3191.jpg", "3192.jpg", new Array("Lobi 3", 				"Vorhalle 3", 					"Lobby 3", 				"&#1051;&#1086;&#1073;&#1073;&#1080; 3"));
	this.Images[ImageLength++] = new Array("3251.jpg", "3252.jpg", new Array("Oda 1", 				"Zimmer 1", 					"Room 1", 				"&#1053;&#1086;&#1084;&#1077;&#1088; 1"));
	this.Images[ImageLength++] = new Array("3181.jpg", "3182.jpg", new Array("Oda 2", 				"Zimmer 2", 					"Room 2",				"&#1053;&#1086;&#1084;&#1077;&#1088; 2"));
	this.Images[ImageLength++] = new Array("3201.jpg", "3202.jpg", new Array("Suit 1", 				"Suite 1", 						"Suite 1", 				"&#1057;&#1091;&#1081;&#1090; 2"));
	this.Images[ImageLength++] = new Array("3231.jpg", "3032.jpg", new Array("Suit 2", 				"Suite 2", 						"Suite 2", 				"&#1057;&#1091;&#1081;&#1090; 2"));
	this.Images[ImageLength++] = new Array("3261.jpg", "3262.jpg", new Array("Suit Teras", 			"Suite Terrase", 				"Suite Terrace",		"&#1057;&#1091;&#1081;&#1090; &#1090;&#1077;&#1088;&#1072;&#1089;"));
	this.Images[ImageLength++] = new Array("1051.jpg", "1052.jpg", new Array("Deniz Yatağı", 		"See bett", 					"Sea Bed", 				"&#1052;&#1086;&#1088;&#1089;&#1082;&#1072;&#1103;&nbsp; &#1082;&#1088;&#1086;&#1074;&#1072;&#1090;&#1100;"));
	
function CreateThumbNailTable(LangIndex)
{
	this.LanguageIndexer = LangIndex;
	var Table = FindObject(this.ThumbNailHtmlAreaID);
	var OutPut = "<table border=\'0\' cellspacing=\'0\' cellpadding=\'0\'>";
	var Counter = this.HorizontalLength;
	for (var i = 0;i<this.Images.length;i++)
	{
		if (Counter == this.HorizontalLength)
		{
			OutPut += "<tr>";
		}
		
		OutPut +="	<td>";
		OutPut +=		CreateItemTable(i, Counter) ;
		OutPut +="	</td>";	
		
		Counter--;
			
		if (Counter == 0)
		{
			OutPut +="</tr>";
			Counter = this.HorizontalLength;
		}
	}
	
	OutPut += "</table>";
	Table.innerHTML = OutPut;
	//this.WriteImage();
}
function WriteImage()
{
	var TempFile = "";
	for (var i = 0;i<this.Images.length;i++)
	{
		TempFile += "<img src=\'"+ this.ImagePath + this.Images[i][1] +"\' border=0 width=1 height=1>";
	}
	TempFile = "<div style=\"z-index: 1; width: 1; height: 1;\">"+ TempFile+ "</div>";
	document.write(TempFile);
}

function CreateItemTable(Indexer, Counter)
{
	var OutPut = "";
	OutPut +="<table border='0' cellspacing='0' cellpadding='0'>\n";
	OutPut +="	\t<tr>\n";
	OutPut +="		\t\t<td><a name=\"Location_"+ Indexer.toString() +"\"></a>\n";
	OutPut +="			\t\t\t<table rules=\'none\' border=\'1\' bordercolor=\'#9999A3\' cellpadding=\'0\' cellspacing=\'0\' style=\'border-collapse:collapse;\' height=\'78\' width=\'78\'>\n";
	OutPut +="				\t\t\t\t<tr>\n";
	OutPut +="        			\t\t\t\t\t<td align=\'center\' valign=\'middle\'><a href=\""+ this.PageName +"?Item="+ Indexer.toString() +"\"><img src=\'"+ this.ImagePath + this.Images[Indexer][0] +"\' width=\'78\' height=\'78\' border=\'0\'></a></td>\n";
	OutPut +="				\t\t\t\t</tr>\n";
	OutPut +="			\t\t\t</table>\n";
	OutPut +="		\t\t</td>\n";
	OutPut +="		\t\t<td>";
	if (Counter != 1)
	{
		OutPut +="			<img src=\'../Images/Pixel.gif\' height=\'1\' width=\'22\'>";
	}		
	OutPut +="		</td>\n";
	OutPut +="	\t</tr>\n";
	OutPut +="	\t<tr>\n";
	OutPut +="		\t\t<td align=\'center\'><span id=\"Text_"+ Indexer.toString() +"\"><small>"+ this.Images[Indexer][2][this.LanguageIndexer]+"</small></span></td>\n";
	OutPut +="		\t\t<td>&nbsp;</td>\n"
	OutPut +="	\t</tr>\n";
	OutPut +="	\t<tr>\n";
	OutPut +="		\t\t<td colspan=\'2\'><img src=\'../Images/Pixel.gif\' height=\'10\' border=\'0\' width=\'22\'></td>\n";
	OutPut +="	</tr>\n";
	OutPut +="</table>\n";
	
	return OutPut;
}
function ShowImage(Indexer)
{
	Indexer = Indexer == null ? 0 : Indexer;
	var PriviewArea = FindObject(this.ThumbNailPriviewAreaID);
	var ImageName = this.Images[Indexer][1];
	var TempImage = new Image();
	TempImage.src = this.ImagePath + ImageName
	
	PriviewArea.src = TempImage.src ;
	
	var TitleArea = FindObject(this.ThumbNailTitleAreaID);
	TitleArea.innerHTML =  "<strong>" + this.Images[Indexer][2][this.LanguageIndexer] +"</strong>";
	
	this.ClearBgColor();
	var ThumbNailAreaTitle = FindObject("Text_"+ Indexer.toString());
	ThumbNailAreaTitle.parentElement.style.backgroundColor = this.BgColor;
	
	this.CreateButtons(Indexer);	
	
	
}
function ClearBgColor()
{
	for (var i = 0;i<this.Images.length;i++)
	{
		FindObject("Text_"+ i.toString()).parentElement.style.backgroundColor = "";
	}
}
function CreateButtons(Indexer)
{
	var NextButton = FindObject(this.NextButtonID);
	var BackButton = FindObject(this.PreviousButtonID);
	var ImageLength = this.Images.length
	
	BackButton.innerHTML = "<a href=\""+ this.PageName +"?Item="+ (parseInt(Indexer) -1 ).toString()  +"\"><img src=\"../Images/geri.gif\" border=\"0\"></a>";
	NextButton.innerHTML = "<a href=\""+ this.PageName +"?Item="+ (parseInt(Indexer) +1 ).toString()  +"\"><img src=\"../Images/ileri.gif\" border=\"0\"></a>";
	NextButton.style.display =  (Indexer == ImageLength-1) ? "none" : "";
	BackButton.style.display = (Indexer == 0) ? "none" : "";	
	this.location = "#Location_"+ Indexer.toString();
}

function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  } 
  return null
}
