/* Ajax XMLHttpRequest JavaScript */
function createObject() {
  var request_type;
  var browser = navigator.appName;
  if (browser == "Microsoft Internet Explorer") {
    request_type = new ActiveXObject("Microsoft.XMLHTTP");
  } else {
    request_type = new XMLHttpRequest();
  }
  return request_type;
}

var http = createObject();

function iso88599Escape(strText) {
  strText = escape(strText);
  strText = strText.replace(/ý/g, "%C4%B1");
  strText = strText.replace(/Ü/g, "%C3%9C");
  strText = strText.replace(/ü/g, "%C3%BC");
  strText = strText.replace(/ð/g, "%C4%9F");
  strText = strText.replace(/Ð/g, "%C49E%");
  strText = strText.replace(/ü/g, "%C3%BC");
  strText = strText.replace(/Ü/g, "%C3%9C");
  strText = strText.replace(/Ý/g, "%C4%B0");
  strText = strText.replace(/þ/g, "%C5%9F");
  strText = strText.replace(/Þ/g, "%C5%9E");
  strText = strText.replace(/ç/g, "%C3%A7");
  strText = strText.replace(/Ç/g, "%C3%87");
  strText = strText.replace(/ö/g, "%C3%B6");
  strText = strText.replace(/Ö/g, "%C3%96");
  return strText;
}
/* Ajax XMLHttpRequest JavaScript End */

/* KirliSakal Top Menu JavaScript JQuery */
$(document).ready(function() {
	$("#TopNavBar li").prepend("<span></span>");
	$("#TopNavBar li").each(function() {
		var linkText = $(this).find("a").html(); 
		$(this).find("span").show().html(linkText);
	}); 
	$("#TopNavBar li").hover(function() {
		$(this).find("span").stop().animate({ 
			marginTop: "-40"
		}, 250);
	} , function() { //On hover out...
		$(this).find("span").stop().animate({
			marginTop: "0"
		}, 250);
	});
});
/* KirliSakal Top Menu JavaScript JQuery End */

/* Mouse Hover BackGround Effect */
function BGStyleChange(itemo, durum) {
  if (durum != "off") {
    itemo.style.backgroundColor = "#494848";
  }
  else {
    itemo.style.backgroundColor = "";
  }
}

function BGStyleChange2(itemo, durum) {
  if (durum != "off") {
    itemo.style.backgroundColor = "#9eb1ba";
  }
  else {
    itemo.style.backgroundColor = "#FFFFFF";
  }
}
/* Mouse Hover BackGround Effect End*/
function Goster(id){
for (var i=1;i<=5;i++)
{
	if (i!=id)
		{
			document.getElementById("MScreen"+i).style.display='none';
		}
		else
		{
			document.getElementById("MScreen"+i).style.display='block';
			document.getElementById('NowPlay').value = i;
		}
	}					
}



function MansetAutomate() {
	var SimdiCalan = 0;
	var SimdiCalan = parseFloat(document.getElementById('NowPlay').value);
	var Toplam = document.getElementById("MansetScreen").getElementsByTagName("img").length;
	
	if (SimdiCalan > Toplam-1) 
		{SimdiCalan = 1;} 
	else 
		{SimdiCalan = parseFloat(SimdiCalan) + 1;}
	
	document.getElementById('NowPlay').value = SimdiCalan;
	Goster(SimdiCalan)
	setTimeout("MansetAutomate();", 5000);
}
