﻿	// Xanadu Hotels - View, January 2011 //
	// Omega Graphic - Antalya / omegagraphic.com //
	// Author: Ozgur Gurckaya / gurckaya.com // 	

	//--------------- Jquery blog --------------------------

	$.fn.view = function(variables, init){
	
	variables = $.extend({}, {
		
			actionLock: false,
			mainMenuFlag: false,
			mainHeaderMenuFlag: false,
			currentSelection: '',
			mainMenuObjects: '',
			mainMenuProps: '',
			onlineFlag: false,
			languageFlag:false,
			pageType: '',
			padding: 0,
			newsletterName_Text: '',
			newsletterMail_Text: '',
			selectedNews: -1,
			newsCount: 0,
			currentNews: 0,
			openedContent: '',
			currentContent: ''
			
						
		}, variables);	
		
	init = $.extend({}, {
		
			processURL: '',
			processParameters: '',
			backResponse: function(){},
			ajaxResponse: ''
						
		}, init);			

		$(document).ready(function(){
			
			$('#prompt').css({top:$(window).height() / 2 - $('#prompt').height() / 2 + $(window).scrollTop() + 'px', left:$(window).width() / 2 - $('#prompt').width() / 2 + 'px'});
			$('#boxes').css({top:$(window).height() / 2 - $('#boxes').height() / 2 + $(window).scrollTop() - 25 + 'px', left:$(window).width() / 2 - $('#boxes').width() / 2 + 'px'});		
			//$('#subpage').css({top:$(window).height() / 2 - $('#subpage').height() / 2 + $(window).scrollTop() + 35 + 'px', left:$(window).width() / 2 - $('#subpage').width() / 2 + 'px'});	
			$('#subpage-gallery').css({top:$(window).height() / 2 - $('#subpage-gallery').height() / 2 + $(window).scrollTop() + 35 + 'px', left:$(window).width() / 2 - $('#subpage-gallery').width() / 2 + 'px'});
			
			$('.movie-container').css({top:$(window).height() / 2 - $('.movie-container').height() / 2 + $(window).scrollTop() + 'px', left:$(window).width() / 2 - $('.movie-container').width() / 2 + 'px'});
			
			$('#gallery-slider-app').css({left:$(window).width() / 2 - $('#gallery-slider-app').width() / 2 + 'px', top: $(window).height() / 2 - $('#gallery-slider-app').height() / 2 + $(window).scrollTop() + 'px'});	
			
			$('.social-container,.newsletter-container,.guest-container,.wedding-container,.antalya-container,.golf-container,.family-container,.villa-container,.entertainment-container,.bodrum-container,.shangdu-container,.skischool-container,.healthclub-container,.erzurum-container').css({left:$(window).width() / 2 - $('.social-container').width() / 2 + 'px',top:$(window).height() / 2 - $('.social-container').height() / 2 + 'px'});
					
			$('#overlay').css({'width':'100%','height':'100%'});
			
			$('.load-comments').click(function() {
											   
				variables.currentContent = $('.guest-content').html();
				
				init.processURL = "process.asp?action=getWeddings";
				
				init.backResponse = function() {
					
					
					
				};
				
				//ajax.get();
											   
			});

$('#hotel').change(function() {
	
	//var optionArray = new Array();
	
	switch ($('#hotel option:selected').val()) {

		case "1":
			
			var optionArray = {
				
				"Standart Room" 		: "Standart Room",
				"Junior Suite" 			: "Junior Suite",
				"Family Room" 			: "Family Room",
				"Family Suite" 			: "Family Suite",
				"Presidential Suite" 	: "Presidential Suite",
				"Presidential Villa" 	:  "Presidential Villa",
				"Golf Suite" 			: "Golf Suite"
			}
					
			break;
			
		case "2":
		
			var optionArray = {
				
				"Courtyard Suite" 			: "Courtyard Suite",
				"Connected Courtyard Suite"	: "Connected Courtyard Suit",
				"Manor House Suite"			: "Manor House Suite",
				"Romance Suite"				: "Romance Suite",
				"Sunset Suite"				: "Sunset Suite",
				"Deluxe Suite"				:  "Deluxe Suite",
				"Elegance Suite"			: "Elegance Suite",
				"Lavender Suite"			: "Lavender Suite",
				"Executive Suite"			: "Executive Suite",
				"Royal Suite" 				: "Royal Suite",
				"Premium Suite"				: "Premium Suite",
				"Royal Suite"				: "Royal Suite"
			}		

			break;
		
		case "3":
		
			var optionArray = {
				
				"Standart Room"				: "Standart Room",
				"Deluxe Rooms"				: "Deluxe Rooms",
				"Junior Suites" 			: "Junior Suites",
				"Presidential Suites"		: "Presidential Suites"
			}	
					
			break;		

	
	};
	
var select = $('#type');
if(select.prop) {
  var options = select.prop('options');
}
else {
  var options = select.attr('options');
}
$('#type option').remove();

		
	$.each(optionArray, function(val, text) {

	    $('#type').append("<option value='" + val + "'>" + text + "</option>")	;//$("#elementid").append("<option value='1'>Apples</option>")

	});
	

});
			
			$('.sendReservation').click(function() {
	
				var x = $('#frmReservation').serialize();

				init.processURL = "sendReservation.asp?" + x + "";

				init.backResponse = function() {
					
					if(init.ajaxResponse == 'ok') {
						
						window.location = 'default.asp?send=ok'
						
					} else {
						
						window.location = 'default.asp?send=failed&err=' + init.ajaxResponse;
						
					};
					
				};
				
				$('*[validation="true"]').each(function() {
					
					if ( $(this).val() =='') {
						alert("Lütfen doldurulması zorunlu alanları boş bırakmayın.");
						return false;
						//break;
						
					}
													  
				});				
				
				ajax.get();
				
			
			});	
			
			checkContactForm = function() {
				
				if(($('#adsoyad').val() == '') || ($('#Email').val() == '') || ($('#mesaj').val() == '')) {
alert("Lütfen doldurulması zorunlu alanları boş bırakmayın.");
return false;

} else {
$('#form2').submit();

}
				
			};
			
			$('.collapseButton').click(function() {
												
				var x = $(this).attr('valuex');
				
				$('#column_1').animate({height:'113px'}, 350, "backout");
				$('#column_2').animate({height:'113px'}, 350, "backout");
				$('#column_3').animate({height:'113px'}, 350, "backout");				
								
				if(x !== variables.openedContent) {
					$('#column_' + x).stop().animate({height:'680px'}, 350, "backout");	
					variables.openedContent = x;
				} else {
					$('#column_' + x).stop().animate({height:'113px'}, 350, "backout");	
					variables.openedContent = '';
				}
				
				
			
			});
			
			$('#social-share').css({top:$(window).height() / 2  - 71 + 'px', left:$(window).width() - 48 + 'px'});	
			
			$('#subpage_content_text').jScrollPane();
			
			$('#gallery-slider-app').hide();
			
			$('#departure').datepicker({'dateFormat':'dd.mm.yy',changeMonth: true,
				changeYear: true,
				dateFormat:'dd.mm.yy',
				showOtherMonths: true,
				regional: "tr"});
			$('#arrival').datepicker({'dateFormat':'dd.mm.yy',changeMonth: true,
				changeYear: true,
				dateFormat:'dd.mm.yy',
				showOtherMonths: true,
				regional: "tr"});

			$('.open-movies').click(function() {
											 
				$('#overlay').css({opacity:0}).show().animate({opacity:0.7}, 500, "easein", function() {
				
					$('.movie-container').css({opacity:0}).show().animate({opacity:1}, 500, "linear");
																									 
				});
			
			});
			
			$('.close-video').click(function() {
				
				$('.movie-container').animate({opacity:0}, 500, "easein", function() {
																				   
					$('.movie-container').hide();
				
					$('#overlay').animate({opacity:0}, 500, "linear", function() {
						$('#overlay').hide();
					});
																									 
				});	
				
				$('.movie-container').find('iframe').attr('src', 'movies.html');
											 
			 });
			
			var e = 0;
			
			variables.newsCount = $('#newsCount').val();
			
			$('.news-left-arrow').click(function() {
				
				if (eval(variables.currentNews) > 0) {
					
					$('.news-container').stop().animate({left: -1 * ((variables.currentNews - 1) * 440) + 'px'}, 750, "easeinout");					
					variables.currentNews--;

				};
				
			});
			
			$('.news-right-arrow').click(function() {
				
				if (eval(variables.currentNews) < variables.newsCount - 1) {
					
					variables.currentNews++;
					$('.news-container').stop().animate({left: -1 * ((variables.currentNews) * 440) + 'px'}, 750, "easeinout");					


				};
				
			});			
			
			$('#save-review').click(function() {
				
				var parameters = $('#frmReview').serialize();
				var getProcess = true;

				init.processURL = "process.asp?action=saveReview&" + parameters;
				
				$('.review-form[validate=true]').each(function() {
					
					if($(this).val() == '') {
						
						get.warn("Lütfen doldurulması zorunlu alanları boş bırakmayın", 128, "ogOkOnly");
						getProcess = false;
						return false;
						
					}
					
				});
				
				init.backResponse = function() {
	
					if (init.ajaxResponse == 'ok') {
					
						get.warn("Görüşleriniz başarıyla kaydedildi. Görüşleriniz, onaylandıktan sonra en kısa sürede yayına alınacaktır. İlginiz için teşekkür ederiz.", 32, "ogOkOnly");
						$('.review-form').val('');
						
					} else {
						
						get.warn(init.ajaxResponse, 128, "ogOkOnly");
						
					}
					
				}	
				
				if(getProcess) {
					ajax.get();				
				}
				
			});
			
			
			$('#sendNewsletter').click(function() {
				
				var x = $('form#frmNewsletter').serialize();
				
				ajaxFlag = true;
				
				$('*[validate=true]').each(function() {
					
					if($(this).val() == '') {
						
						alert("Lütfen doldurulması gerekli tüm alanları doldurun.");	
						ajaxFlag = false;
											
						return false;
						
					};
					
					
				});
				
				init.processURL = "process.asp?action=sendNewsletter&" + x + "";
				
				init.backResponse = function() {

					if (init.ajaxResponse == "ok") {
					
						alert("Kaydınız başarıyla yapıldı. İlginiz için teşekkürler.");
						
					} else {
					
						alert(init.ajaxResponse);
					
					};
					
					$('.newsletter-container').animate({opacity:0}, 250, "easeout", function() {
						
						$('.newsletter-container').hide();
		
						$('#overlay').animate({opacity:0}, 500, "easeout", function() {
							
							$('#overlay').hide();
							$('*[type=text]').val('');
							$('textarea').val('');							
							
						});
						
					});					
					
				};
				
				if(ajaxFlag) {
					ajax.get();
				};
				
			});
			
			$('.click-image').click(function() {
			
			
				var objectName = $(this).attr('object');
				
				$('#overlay').css({opacity:0}).show().stop().animate({opacity:0.7}, 500, "easein", function() {
					
					$('.' + objectName).css({opacity:0}).show().stop().animate({opacity:1}, 250, "easein");
					
					$('#overlay').unbind('click').bind('click', function() {
						
						$('.' + objectName).stop().animate({opacity:0}, 250, "easeout", function() {
							
							$('.' + objectName).hide();
			
							$('#overlay').stop().animate({opacity:0}, 500, "easeout", function() {
								
								$('#overlay').hide();	
								
							});
							
						});
						
					});
					
					$('.close-button').click(function() {
						
						$('#overlay').click();
												
					});					
					
				});			
			
			});
			
			$('#box-3').click(function() {
				
				$('#overlay').css({opacity:0}).show().animate({opacity:0.7}, 500, "easein", function() {
					
					$('.guest-container').css({opacity:0}).show().animate({opacity:1}, 250, "easein");
					
					$('#overlay').unbind('click').bind('click', function() {
						
						$('.guest-container').animate({opacity:0}, 250, "easeout", function() {
							
							$('.guest-container').hide();
			
							$('#overlay').animate({opacity:0}, 500, "easeout", function() {
								
								$('#overlay').hide();	
								
							});
							
						});
						
					});
					
					$('.close-button').click(function() {
						
						$('#overlay').click();
												
					});					
					
				});
				
			});

			$('#box-2').click(function() {
				
				$('#overlay').css({opacity:0}).show().animate({opacity:0.7}, 500, "easein", function() {
					
					$('.social-container').css({opacity:0}).show().animate({opacity:1}, 250, "easein");
					
					$('#overlay').unbind('click').bind('click', function() {
						
						$('.social-container').animate({opacity:0}, 250, "easeout", function() {
							
							$('.social-container').hide();
			
							$('#overlay').animate({opacity:0}, 500, "easeout", function() {
								
								$('#overlay').hide();	
								
							});
							
						});
						
					});
					
					$('.close-button').click(function() {
						
						$('#overlay').click();
												
					});						
					
				});
				
			});
			
			$('#box-1').click(function() {
				
				$('#overlay').css({opacity:0}).show().animate({opacity:0.7}, 500, "easein", function() {
					
					$('.newsletter-container').css({opacity:0}).show().animate({opacity:1}, 250, "easein");
					
					$('#overlay').unbind('click').bind('click', function() {
						
						$('.newsletter-container').animate({opacity:0}, 250, "easeout", function() {
							
							$('.newsletter-container').hide();
			
							$('#overlay').animate({opacity:0}, 500, "easeout", function() {
								
								$('#overlay').hide();	
								
							});
							
						});
						
					});
					
					$('.close-button').click(function() {
						
						$('#overlay').click();
												
					});						
					
				});
				
			});			
			
			
			
			$('.up-arrow').click(function() {
				
				var obj = $(this).attr('object');
				
				switch(obj) {
					
					case 'news':
												
						if (eval(variables.selectedNews) > -1) {
							
							variables.selectedNews--;
							getNews();
							
							
						};
					
						break;
					
				};
				
			});
			
			$('.down-arrow').click(function() {
				
				var obj = $(this).attr('object');
				
				switch(obj) {
					
					case 'news':
						
						var count = $('#news_count').val();

						if (eval(variables.selectedNews) < eval(count) - 2) {

							variables.selectedNews++;
							getNews();
							
						};
					
						break;
					
				};				
				

				
			});			
			
			getNews = function(){
				
				if (!variables.actionLock) {
					
					variables.actionLock = true;
						
					$('.news_content').animate({opacity:0}, 500, "easein");
					$('.news_photo').animate({opacity:0}, 500, "easein", function() {
						
						$('.news_photo').html('<img src="images/ani_loading.gif" style="padding-left:93px;padding-right:93px;padding-top:44px;padding-bottom:43px;border:1px solid #666;" width="23" height="23" />').animate({opacity:1}, 250, "easein", function() {																					
							
							init.processURL = "process.asp?action=getNews&seq=" + variables.selectedNews;
							
							init.backResponse = function() {
								
								var data = new Array();
								data = init.ajaxResponse.split('||');
								
								news_date = data[0];
								news_header = data[1];
								news_content = data[2];
								news_picture = data[3];	
								id = data[4];	
								
								if (news_picture == '') {
									
									news_picture = "noPictures.jpg";
									
								};
								
								var image = new Image();	
								
								$(image).load(function() {

									$('.news_photo').html('').append(image);
									
									$('.news_content').html('<span class="news-header"><a href="news.asp?id=' + id + '">' + news_header + '</a></span><br /><span class="news-date">' + news_date + '</span><br /><span class="news-content">' + news_content + '</span>')
									/*Cufon.replace('.news-header', {color: '#A1C93D'});	
									Cufon.replace('.news-date', {color: '#fff'});	*/	
									$('.news_content').animate({opacity:1}, 500, "easein");
									
										
									
									variables.actionLock = false;
									
								}).attr('src','images/content/' + news_picture);
													
							};
							
							ajax.get();							
							
							
						});
							
					});
					

				
				};
				
			};
			
			
						
			setUIArguments = function() {
				
				$('#gallery-app').hide().css({opacity:0});
				$('.gallery-app-bg').css({'position':'absolute',top:'0px',left:'0px',width:$(window).width(),height:$(window).height(),'background-color':'#000',opacity:0}).hide();								
			};
			
			$('.close-gallery').click(function() {
				
				$('#gallery-slider-app').animate({opacity:0}, 500, "easein", function() {
					
					$('#gallery-slider-app').hide();
					
					$('#overlay').animate({opacity:0}, 500, "easein", function() {
						
						$('#overlay').hide();
						
					});
					
				});
				
			});				
			
			setUIArguments();
			getNews();
			
			popUp = function(URL) {
				/*day = new Date();

				id = day.getTime();
				eval("page" + id + " = window.open('" + URL + "', '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=1000,height=650,left = 460,top = 215');");*/
				$('#overlay').css({opacity:0}).show().animate({opacity:0.7}, 500, "easein", function() {
					
					var gal_width = $('#gallery-slider-app').attr('w') == '100%' ? ($(window).width()) : ($('#gallery-slider-app').attr('w'));
					var gal_height = $('#gallery-slider-app').attr('h') == '100%' ? ($(window).height()) : ($('#gallery-slider-app').attr('h'));					

					$('#gallery-slider-app').css({opacity:0,left:$(window).width() / 2 - eval(gal_width) / 2 + 'px',top:($(window).height() / 2 - eval(gal_height) / 2) + $(window).scrollTop() + 'px'}).show().html('<iframe src="' + URL + '" frameborder="0" scrolling="no" width="' + gal_width + '" height="' + gal_height + '" allowtransparency="yes"></iframe>');
					$('#gallery-slider-app').animate({opacity:1}, 500, "easein");
				
				
				});
			};
			
			$('body').keydown(function(event) {

				if (event.keyCode==27) {
					
					closeGalleryApp();
					
				};
																
				
			});			
			


			closeGalleryApp = function()  {
				
				$('#gallery-slider-app').animate({opacity:0}, 500, "easein", function() {
				
					$('#gallery-slider-app').hide();
					$('#overlay').animate({opacity:0}, 500, "easein", function() {
					
						$('#overlay').hide();
						
					});
				
				});

			};			
						
			
			$('#save-review').click(function() {
				
				var parameters = $('#frmReview').serialize();
				var getProcess = true;

				init.processURL = "process.asp?action=saveReview&" + parameters;
				
				$('.review-form[validate=true]').each(function() {
					
					if($(this).val() == '') {
						
						get.warn("Lütfen doldurulması zorunlu alanları boş bırakmayın", 128, "ogOkOnly");
						getProcess = false;
						return false;
						
					}
					
				});
				
				init.backResponse = function() {
	
					if (init.ajaxResponse == 'ok') {
					
						get.warn("Görüşleriniz başarıyla kaydedildi. Görüşleriniz, onaylandıktan sonra en kısa sürede yayına alınacaktır. İlginiz için teşekkür ederiz.", 32, "ogOkOnly");
						$('.review-form').val('');
						
					} else {
						
						get.warn(init.ajaxResponse, 128, "ogOkOnly");
						
					}
					
				}	
				
				if(getProcess) {
					ajax.get();				
				}
				
			});				
			
			$('#newsletter_username').focus(function() {
				
				if(($(this).val() == 'Ad, Soyad') || ($(this).val() == 'Name, Surname') || ($(this).val() == 'Name, Vorname') || ($(this).val() == 'Имя, Фамилия') || ($(this).val() == 'Prénom, Nom')) {
					
					variables.newsletterName_Text = $(this).val();
					$(this).val('');
					
				};
				
			});
			
			$('#newsletter_username').blur(function() {
				
				if(($(this).val() == '')) {
					
					$(this).val(variables.newsletterName_Text);
					
				};
				
			});	
			
			$('#newsletter_mail').focus(function() {
				
				if(($(this).val() == 'E-Posta') || ($(this).val() == 'E-mail')) {
					
					variables.newsletterMail_Text = $(this).val();
					$(this).val('');
					
				};
				
			});
			
			$('#newsletter_mail').blur(function() {
				
				if(($(this).val() == '')) {
					
					$(this).val(variables.newsletterMail_Text);
					
				};
				
			});						
			
			$('#save-newsletter').click(function() {

				if(($('#newsletter_username').val() == '') || ($('#newsletter_username').val() == 'Ad, Soyad') || ($('#newsletter_username').val() == 'Name, Surname') || ($('#newsletter_username').val() == 'Name, Vorname') || ($('#newsletter_username').val() == 'Имя, Фамилия') || ($('#newsletter_username').val() == 'Prénom, Nom')) {
				
					get.warn("Lütfen adınızı ve soyadınızı yazıp yeniden deneyiniz", 16, "ogOkOnly");
					return false;
					
				};
				
				if(($('#newsletter_mail').val() == '') || ($('#newsletter_mail').val() == 'E-Posta') || ($('#newsletter_mail').val() == 'E-mail')) {
				
					get.warn("Lütfen e-posta adresinizi yazıp yeniden deneyiniz", 16, "ogOkOnly");
					return false;
					
				};
				
				if (newsletterValidation($('#newsletter_mail').val())){
				
					if(!init.actionLock) {												
						
						var parameters = $('#frmNewsletter').serialize();					
						
						init.processURL = "process.asp?action=saveVIAMail&" + parameters;
					
						init.backResponse = function() {
			
							if (init.ajaxResponse == 'ok') {
							
								get.warn("E-Posta adresiniz başarıyla kayıt edildi. İlginiz için teşekkür ederiz", 32, "ogOkOnly");
								$('#frmNewsletter input:not(#save-newsletter)').val('');
								
							} else {
								
								get.warn(init.ajaxResponse, 128, "ogOkOnly");
								
							};
							
						};
						
						ajax.get();
					
					};
					
				};
				
			});	
			
			newsletterValidation = function(str) {
		
				var at = "@";
				var dot = ".";
				var lat = str.indexOf(at);
				var lstr = str.length;
				var ldot = str.indexOf(dot);
			
				
				if (str.indexOf(at)==-1){
					
				   get.warn("Geçersiz bir e-posta adresi girdiniz. Lütfen kontrol edin", 64, "ogOkOnly");			  
				   return false;
				   
				};
		
				if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
					
				   get.warn("Geçersiz bir e-posta adresi girdiniz. Lütfen kontrol edin", 64, "ogOkOnly");
				   return false;
				   
				};
		
				if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
					
					get.warn("Geçersiz bir e-posta adresi girdiniz. Lütfen kontrol edin", 64, "ogOkOnly");
					return false;
					
				};
		
				 if (str.indexOf(at,(lat+1))!=-1){
					 
					get.warn("Geçersiz bir e-posta adresi girdiniz. Lütfen kontrol edin", 64, "ogOkOnly");
					return false;
					
				 };
		
				 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
					 
					get.warn("Geçersiz bir e-posta adresi girdiniz. Lütfen kontrol edin", 64, "ogOkOnly");
					return false;
					
				 };
		
				 if (str.indexOf(dot,(lat+2))==-1){
					 
					get.warn("Geçersiz bir e-posta adresi girdiniz. Lütfen kontrol edin", 64, "ogOkOnly");
					return false;
					
				 };
				
				 if (str.indexOf(" ")!=-1){
					 
					get.warn("Geçersiz bir e-posta adresi girdiniz. Lütfen kontrol edin", 64, "ogOkOnly");
					return false;
					
				 };
		
				 return true;					
			};				
			

		});//end ready			
			
		$(window).resize(function() {
			
			$('.gallery-app-bg').css({width:$(window).width(),height:$(window).height() + $(window).scrollTop() + 'px'});
			
			$('.social-container,.newsletter-container,.guest-container,.wedding-container,.antalya-container,.golf-container,.family-container,.villa-container,.entertainment-container,.bodrum-container,.shangdu-container,.skischool-container,.healthclub-container,.erzurum-container').css({left:$(window).width() / 2 - $('.social-container').width() / 2 + 'px',top:$(window).height() / 2 - $('.social-container').height() / 2 + $(window).scrollTop() + 'px'});
			
			$('#slider-content').css({left:$(window).width() / 2 - $('#slider-content').width() / 2 + 'px',top:$(window).height() / 2 - $('#slider-content').height() / 2 + 'px'});
			
			$('#boxes').css({top:$(window).height() / 2 - $('#boxes').height() / 2 + $(window).scrollTop() - 35 + 'px', left:$(window).width() / 2 - $('#boxes').width() / 2 + 'px'});
			
			//$('#subpage').css({top:$(window).height() / 2 - $('#subpage').height() / 2 + $(window).scrollTop() + 35 + 'px', left:$(window).width() / 2 - $('#subpage').width() / 2 + 'px'});	
			$('#subpage-gallery').css({top:$(window).height() / 2 - $('#subpage-gallery').height() / 2 + $(window).scrollTop() + 35 + 'px', left:$(window).width() / 2 - $('#subpage-gallery').width() / 2 + 'px'});
			
			$('#social-share').css({left:$(window).width() - 48 + 'px'});

			$('#overlay').css({'width':'100%','height':'100%'});			
			
			$('#prompt').css({top:$(window).height() / 2 - $('#prompt').height() / 2 + $(window).scrollTop() + 'px', left:$(window).width() / 2 - $('#prompt').width() / 2 + 'px'});
			
			var gal_width = $('#gallery-slider-app').attr('w') == '100%' ? ($(window).width()) : ($('#gallery-slider-app').attr('w'));
			var gal_height = $('#gallery-slider-app').attr('h') == '100%' ? ($(window).height()) : ($('#gallery-slider-app').attr('h'));					
				
			$('#gallery-slider-app').css({left:$(window).width() / 2 - eval(gal_width) / 2 + 'px',top:($(window).height() / 2 - eval(gal_height) / 2) - $(window).scrollTop() + 'px'});
			
			$('.gallery-slider-menu-container').css({left:($(window).width() / 2) - 500 + 'px',top:$(window).height() - 100 + 'px'});
			$('.gallery-slider-thumbnail-container').css({left:($(window).width() / 2) - 500 + 'px',top:'0px'});
			
			$('.movie-container').css({top:$(window).height() / 2 - $('.movie-container').height() / 2 + $(window).scrollTop() + 'px', left:$(window).width() / 2 - $('.movie-container').width() / 2 + 'px'});			
			
			//imageResize();
			
			$('.obj-1').css({left:$(window).width() / 2 - $('.obj-1').find('img').width() / 2 + 'px',top:$(window).height() / 2 - $('.obj-1').find('img').height() / 2 + 'px'});
			$('.obj-2').css({left:$(window).width() / 2 - $('.obj-2').find('img').width() / 2 + 'px',top:$(window).height() / 2 - $('.obj-2').find('img').height() / 2 + 'px'});	
			
			var currentObject;
			
			if (currentObject == 1) {			
										
				var image_width = $('.obj-2 img').width();
				var image_height = $('.obj-2 img').height();
				
				var image_width_org = image_width;
				var image_height_org = image_height;							
				
				var image_ratio = eval(image_width) > eval(image_height) ? (image_width / image_height) : (image_height / image_width);

		
				if (eval(image_width) > eval(image_height)) {

					$('.obj-2').css({width:$(window).width() + 'px',height:(image_height_org * $(window).width()) / image_width_org + 'px'});
					$('.obj-2 img').css({width:$(window).width() + 'px',height:(image_height_org * $(window).width()) / image_width_org + 'px'});
					
				} else {

					$('.obj-2').css({width:(image_width_org * $(window).height()) / image_height_org + 'px',height:$(window).height() + 'px'});
					$('.obj-2 img').css({width:(image_width_org * $(window).height()) / image_height_org + 'px',height:$(window).height() + 'px'});
					
				};
				$('.obj-2').css({left:$(window).width() / 2 - $('.obj-2').width() / 2 + 'px',top:$(window).height() / 2 - $('.obj-2').height() / 2 + 'px'});
				
			} else {
										
				var image_width = $('.obj-1 img').width();
				var image_height = $('.obj-1 img').height();
				
				var image_width_org = image_width;
				var image_height_org = image_height;								
				
				var image_ratio = eval(image_width) > eval(image_height) ? (image_width / image_height) : (image_height / image_width);
			
				if (eval(image_width) > eval(image_height)) {

					$('.obj-1').css({width:$(window).width() + 'px',height:(image_height_org * $(window).width()) / image_width_org + 'px'});
					$('.obj-1 img').css({width:$(window).width() + 'px',height:$(window).width() / image_ratio + 'px'});
					
				} else {

					$('.obj-1').css({width:(image_width_org * $(window).height()) / image_height_org + 'px',height:$(window).height() + 'px'});
					$('.obj-1 img').css({width:(image_width_org * $(window).height()) / image_height_org + 'px',height:$(window).height() + 'px'});
					
				};
		
				$('.obj-1').css({left:$(window).width() / 2 - $('.obj-1').width() / 2 + 'px',top:$(window).height() / 2 - $('.obj-1').height() / 2 + 'px'})	
				
			};						
			
			
		});
		
		$(window).scroll(function() {
			
			$('.gallery-app-bg').css({top:$(window).scrollTop() + 'px'});
			$('#prompt').css({top:$(window).height() / 2 - $('#prompt').height() / 2 + $(window).scrollTop() + 'px', left:$(window).width() / 2 - $('#prompt').width() / 2 + 'px'});
			$('#overlay').css({top: $(window).scrollTop() + 'px'});	
			$('#gallery-slider-app').css({top: $(window).scrollTop() + 'px'});	
			
			$('.social-container,.newsletter-container,.guest-container,.wedding-container,.antalya-container,.golf-container,.family-container,.villa-container,.entertainment-container,.bodrum-container,.shangdu-container,.skischool-container,.healthclub-container,.erzurum-container').css({top:$(window).height() / 2 - $('.social-container').height() / 2 + $(window).scrollTop() + 'px'})		
			
			$('#social-share').stop().animate({top:($(window).height() / 2)  - 71 + $(window).scrollTop() + 'px'}, 250, "backout");
			$('.movie-container').css({top:$(window).height() / 2 - $('.movie-container').height() / 2 + $(window).scrollTop()  + 'px', left:$(window).width() / 2 - $('.movie-container').width() / 2 + 'px'});			
			
		});		
	
			
		
		closeBox = function() {
			
			$('#overlay').animate({opacity:0}, 250, "easeout", function() {
				$('#prompt').hide().html('');
				$('#overlay').hide();
			});	
				
		};
		
		var ajax = {
			
			get: function() {
				
				
				var sb = init.processURL.replace('%40','@');
				
				$.post(sb, function(data) {	
			
					init.ajaxResponse = data;
					init.backResponse();
						
				});
				
				return;
				
			}
			
		};
		
		var get = {
				
			warn: function(text, icon, button) {
			
				$('#prompt').append('<div class="icon"><img src="images/prompt-icons/' + icon + '.png" /></div>')
				$('#prompt').append('<div class="p_text">' + text + '</div>')
				$('#prompt').append('<div class="buttons"><input type="button" onClick="closeBox();" value="Ok"/></div>')				
								
				$('#overlay').show().animate({opacity:0.4}, 250, "easeout", function() {
					
					$('#prompt').show();
				
				});
				
			},
			
			back: function() {
				

			}
			
		};	

	};
	//--------------------------------------------------------------
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
