﻿// iframe ile ilgili f'nlar
function hesapla_yukseklik()
{
  document.getElementById('iframe_main').height=document.getElementById('iframe_main').contentWindow.document.body.scrollHeight + 40;
}

function hesapla_yukseklik_galeri()
{
  parent.document.getElementById('iframe_galeri').height
    = parent.document.getElementById('iframe_galeri').contentWindow.document.body.scrollHeight + 10;
}

function kontrol_ced()
{
	if (parent != self)
		parent.window.location = 'granduysal.aspx';
	hesapla_yukseklik();
}

//
function acYukleniyor() {
	parent.document.getElementById('yukleniyor_div').style.visibility = 'visible'; 
    ayarlaYukleniyor();
}

function kapatYukleniyor() {
	parent.document.getElementById('yukleniyor_div').style.visibility = 'hidden'; 
}

function ayarlaYukleniyor() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = parent.window.innerWidth;
    myHeight = parent.window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = parent.document.documentElement.clientWidth;
    myHeight = parent.document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = parent.document.body.clientWidth;
    myHeight = parent.document.body.clientHeight;
  }
  parent.document.getElementById('yukleniyor_div').style.width = myWidth - 100;
  parent.document.getElementById('yukleniyor_div').style.height = 1000;
}

// ziyaretçi defterine yazı yollama
function mesaj_yolla()
{
  var mail = document.getElementById('txt_mail').value;
  var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  if (document.getElementById('txt_isim').value == '') { alert('Lütfen isim kısmını doldurun.\nPlease fill in the name field.'); return; }
  if (filter.test(mail) == false) { alert('e-posta adresi yanlış.\ne-mail adress is wrong.\nFalsche Mail adress'); return; }
  if (document.getElementById('txt_mesaj').value == '') {alert('Lütfen yorum kısmını doldurun.\nPlease fill in the comment field.'); return; }
  __doPostBack('btn_send',''); 
}

function popUpImg(url, pageWidth, pageHeight)
{
    var args = "width=" + (pageWidth + 20) + ",height=" + (pageHeight + 10) + ",scrollbars,resizable";
    var date = new Date();
    var now = date.getTime();
    var name = (now).toString(10);
    
    _w = window.open('',name,args);
    _w.document.open();
    _w.document.write("<html>\n<head><title>Viewing " + url + "</title>\n</head>\n<body style='margin: 0px'>\n");
    _w.document.write("<meta http-equiv='imagetoolbar' content='no'>");
    _w.document.write("<table width='100%' border='0' cellpadding='0' cellspacing='0' style='height: 100%'>\n<tr>\n<td align='center' valign='middle'>\n");
    _w.document.write("<a href='javascript:window.close();'><img src='" + url + "' alt='Click to close' border='0' height='600' width='800' /></a>\n");
    _w.document.write("</td></tr></table>\n");
    _w.document.write("</body>\n</html>");
    _w.document.close();
}

var x = 0
var speed = 70
var text = "..:: Grand Uysal Hotel ::.."
var course = 120
var text2 = text

function Scroll() {
    window.status = text2.substring(0, text2.length)

    if (course < text2.length) {
        setTimeout("Scroll2()", speed)
    } else {
        text2 = " " + text2
        setTimeout("Scroll()", speed);
    }
}

function Scroll2() {
    window.status = text2.substring(x, text2.length)

    if (text2.length - x == text.length) { 
        text2 = text
        x = 0
        setTimeout("Scroll()", speed);
    } else {
        x++
        setTimeout("Scroll2()", speed);
    }
}
