//----------------------------------------------------------------------------
// Code to determine the browser and version.
//----------------------------------------------------------------------------

var uloop=true;
var dloop=true;
function Is() {
    agent  = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.ns    = ((agent.indexOf('mozilla')   !=   -1) &&
                 ((agent.indexOf('spoofer')   ==   -1) &&
                 (agent.indexOf('compatible') ==   -1)));
    this.ns2   = (this.ns && (this.major      ==    3));
    this.ns3   = (this.ns && (this.major      ==    3));
    this.ns4b  = (this.ns && (this.major      ==    4) &&
                 (this.minor                  <= 4.03));
    this.ns4   = (this.ns && (this.major      >=    4));
    this.ns6    = (this.ns && (this.major     >=    5));
    this.ie    = (agent.indexOf("msie")       !=   -1);
    this.ie3   = (this.ie && (this.major      <     4));
    this.ie4   = (this.ie && (this.major      ==    4) &&
                 (agent.indexOf("msie 5.0")   ==   -1));
    this.ie5   = (this.ie && (this.major      ==    4) &&
                 (agent.indexOf("msie 5.0")   !=   -1));
    this.ie55  = (this.ie && (this.major      ==    4) &&
                 (agent.indexOf("msie 5.5")   !=   -1));
}

var is = new Is();
if(is.ns4) {
    doc = "document";
    sty = "";
    htm = ".document"
    xpos = "e.pageX";
    ypos = "e.pageY";
} else if(is.ie4 || is.ie5) {
    doc = "document.all";
    sty = ".style";
    htm = ""
    xpos = "event.x";
    ypos = "event.y";
}
function movelayer(nsn,loc)
{
lyr1Obj = eval(doc + '[nsn]' + sty);
lyr1Obj.top = loc;
}

function noScroll() {
if (dloop) dloop=false;
if (uloop) uloop=false;
}

function check()
{
if (!dloop) dloop=true;
if (!uloop) uloop=true;
}
function scroll(obj,step,pos) {
//alert(pos);
lyr1Obj = eval(doc + '[obj]' + sty);
var x_pos1 = parseInt(lyr1Obj.top);
if (step>0) 
	{
	if(x_pos1+step < pos) 
	{
		lyr1Obj.top = x_pos1+step;
		if (uloop) 
		{
			dloop=false;
			setTimeout("scroll('"+obj+"',"+step+","+pos+")", 500);
		}
	}
	else
	{
		lyr1Obj.top = pos
	}
}
if (step<0) 
{
	if(x_pos1+step > pos) 
	{
		lyr1Obj.top = x_pos1+step;
		if (dloop) 
		{
			uloop=false;
			setTimeout("scroll('"+obj+"',"+step+","+pos+")", 500);
		}
	}
	else
	{
		lyr1Obj.top = pos
	}
}
}

function animateLayers1(obj,pos) {
lyr1Obj = eval(doc + '[obj]' + sty);
var x_pos1 = parseInt(lyr1Obj.top);
if(x_pos1+5 < pos) 
{
	lyr1Obj.top = x_pos1+10;
	setTimeout("animateLayers1('"+obj+"',"+pos+")", 1);
}
else
{
	lyr1Obj.top = pos
}
}

function animateLayers(obj,pos) {
lyr1Obj = eval(doc + '[obj]' + sty);
var x_pos1 = parseInt(lyr1Obj.top);
if(x_pos1+5 < pos) 
{
	lyr1Obj.top = x_pos1+5;
	setTimeout("animateLayers('"+obj+"',"+pos+")", 100);
}
else
{
	lyr1Obj.top = pos
}
}

function menu_play()
{
setTimeout("animateLayers('menu_kim_title',52)",0);
setTimeout("animateLayers('menu_ne_title',52)",700);
setTimeout("animateLayers('menu_nasil_title',52)",1400);
setTimeout("animateLayers('menu_neden_title',52)",2100);
setTimeout("animateLayers('menu_nerede_title',52)",2800);
}

function dialogImage(txtName)
{
	var html = showModalDialog("/Common/htmlEdit/dialog/kh_image.html", txtName.value, "dialogWidth:" + 400 + "px;dialogHeight:" + 380 + "px;help:no;scroll:no;status:no");
	// The response is the IMG tag HTML
	if (html != null)
		txtName.value = html ;
}

function UpdateSecFormInfo(value)
{
	if (value=="Add")
	{
	document.Add.submit();
	}
	if (value=="Yeni")
	{
	document.Yeni.submit();
	}
	if (value=="Liste")
	{
	document.Liste.submit();
	}
	if (value=="Filtre")
	{
	document.Filtre.submit();
	}
	if (value=="IlceKombo")
	{
	document.IlceKombo.submit();
	}
	if (value=="IlKombo")
	{
	document.IlKombo.submit();
	}
	if (value=="Edit")
	{
	document.Edit.submit();
	}
	if (value=="Tema")
	{
	document.Tema.submit();
	}
}

function pencereac(adres,w,en,boy,Icerik)
{
window.open(adres,'','width='+en+', height='+boy+' ,scrollbars=yes,toolbar=no,location=no,directories=no,menubar=no,resizable=no,status=no,copyhistory=no' );
//document.write(Icerik);
}

function Browser() {

  var ua, s, i;

  this.isIE    = false;  // Internet Explorer
  this.isNS    = false;  // Netscape
  this.version = null;

  ua = navigator.userAgent;

  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as NS 6.1.

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}

var browser = new Browser();
var LastmenuId = "";
var LastButton=null;

function Celal(Olay, menuId) {

	var button;
  	// Get the target button element.

 	if (browser.isIE)
    	button = window.event.srcElement;
  	else
    	button = Olay.currentTarget;

  	if (LastButton!=null)
  	{
	  	LastButton.menu.style.background="url(/Resources/Images/buton.gif)";
	}

  	button.menu = document.getElementById(menuId);
  	button.menu.style.background="url(/Resources/Images/butondown.gif)";
  	LastButton = button;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) 
  {
  if ((appName=="Netscape")&&(parseInt(appVersion)==4)) 
  	{
    document.MM_pgW=innerWidth; 
    document.MM_pgH=innerHeight; 
    onresize=MM_reloadPage; 
    }
  }
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->

<!--show hide layers script-->

function MM_showHideLayersEx() { //v1.2
  var i, visStr, args, theObj;
  args = MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) { //with arg triples (objNS,objIE,visStr)
    visStr   = args[i+2];
    if (navigator.appName == 'Netscape' && document.layers != null) {
      theObj = eval(args[i]);
      if (theObj) theObj.visibility = visStr;
    } else if (document.all != null) { //IE
      if (visStr == 'show') visStr = 'visible'; //convert vals
      if (visStr == 'hide') visStr = 'hidden';
      theObj = eval(args[i+1]);
      if (theObj) theObj.style.visibility = visStr;
  } }
}

<!--preload script-->

function MM_preloadImages() { //v1.2
  if (document.images) {
    var imgFiles = MM_preloadImages.arguments;
    var preloadArray = new Array();
    for (var i=0; i<imgFiles.length; i++) {
      preloadArray[i] = new Image;
      preloadArray[i].src = imgFiles[i];
    }
  }
}


<!--mm swapimage-->

function MM_swapImage() { //v1.2
  var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;
  for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
    objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
    if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
        (objStr.indexOf('document.all[')   ==0 && document.all   ==null))
      objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
    obj = eval(objStr);
    if (obj != null) {
      swapArray[j++] = obj;
      swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
      obj.src = MM_swapImage.arguments[i+2];
  } }
  document.MM_swapImgData = swapArray; //used for restore
}



<!--mm swapimage restore-->

function MM_swapImgRestore() { //v1.2
  if (document.MM_swapImgData != null)
    for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
      document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
}


<!--mm go to url-->

function MM_goToURL() { //v1.2
  for (var i=0; i< (MM_goToURL.arguments.length - 1); i+=2) //with arg pairs
    eval(MM_goToURL.arguments[i]+".location='"+MM_goToURL.arguments[i+1]+"'");
  document.MM_returnValue = false;

}


<!--mm go to url-->

function MM_goToURL() { //v1.2
  for (var i=0; i< (MM_goToURL.arguments.length - 1); i+=2) //with arg pairs
    eval(MM_goToURL.arguments[i]+".location='"+MM_goToURL.arguments[i+1]+"'");
  document.MM_returnValue = false;


function WM_netscapeCssFix() {
  // This part was inspired by Matthew_Baird@wayfarer.com
  // It gets around another unfortunate bug whereby Netscape 
  // fires a resize event when the scrollbars pop up. This 
  // checks to make sure that the window's available size 
  // has actually changed.
  if (document.WM.WM_netscapeCssFix.initWindowWidth != window.innerWidth || document.WM.WM_netscapeCssFix.initWindowHeight != window.innerHeight) {
    document.location = document.location;
  }
}

function WM_netscapeCssFixCheckIn() {
  // This function checks to make sure the version of Netscape 
  // in use contains the bug; if so, it records the window's 
  // width and height and sets all resize events to be handled 
  // by the WM_netscapeCssFix() function.
  if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
    if (typeof document.WM == 'undefined'){
      document.WM = new Object;
    }
    if (typeof document.WM.WM_scaleFont == 'undefined') {
      document.WM.WM_netscapeCssFix = new Object;
      document.WM.WM_netscapeCssFix.initWindowWidth = window.innerWidth;
      document.WM.WM_netscapeCssFix.initWindowHeight = window.innerHeight;
    }
    window.onresize = WM_netscapeCssFix;
  }
}}

<!--mm open new window-->


function MM_openBrWindow(theURL,winName,features) { //v1.2
  window.open(theURL,winName,features);
}<!--superfly layer display by form-->