﻿function ekran(obj) {

var ekr = document.getElementById(obj);
ekr.style.posWidth = document.body.clientWidth;
ekr.style.posHeight = f_clientHeight();


switch(navigator.appName){
case  "Microsoft Internet Explorer":
var ekrContent = document.getElementById("ekranOrta");
//ekrContent.style.posHeight =document.documentElement.clientHeight-200;

break;
case "Netscape":
ekr.style.posWidth = document.body.clientWidth;
ekr.style.posHeight = f_clientHeight();
ekr.setAttribute("class", "ieHeight");
break;
}


switch (obj){
case 'ekran':
document.getElementById('DIVimgFotoSag').style.posTop = (document.body.clientHeight / 100)-8;
document.getElementById('DIVimgBtnMuzikFoto').style.posTop = (f_clientHeight() / 100)-8;
break;
}

reload();

}




window.onresize = resize;

function resize()
{

var ekr = null;
ekr = document.getElementById('ekran');
if (ekr != null){
ekran('ekran'); 
return;
}

if(ekr==null){ ekr = document.getElementById('ekranAltSayfa');}

if (ekr != null){ekranAltSayfa();}

}

function f_clientWidth() {
	return f_filterResults (
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}
function f_clientHeight() {
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}
function f_scrollLeft() {
	return f_filterResults (
		window.pageXOffset ? window.pageXOffset : 0,
		document.documentElement ? document.documentElement.scrollLeft : 0,
		document.body ? document.body.scrollLeft : 0
	);
}
function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}
           
function reload(){

/*client time
var currentTime = new Date()
var hours = currentTime.getHours()
*/
var ekranSag =  document.getElementById('ekranSag');
var ekranSol =  document.getElementById('ekranSol');

            
// server time

/// jquery server saat


                $.ajax({
                  type: "POST",
                  url: "default.aspx/time",
                  data: "{}",
                  contentType: "application/json; charset=utf-8",
                  dataType: "json",
                  success: function(msg) {
                  //saat = 
          
                   // $("#topla").fadeOut("slow",function() {
                   // $(this).html(String("Saat : "+msg))}).fadeIn("slow");
                   
        if (msg >= 16 && msg < 20)
        {//öğlen
           ekranSag.setAttribute("class", "ekranSag2");
            ekranSol.setAttribute("class", "ekranSol2"); 
            ekranSag.setAttribute("className", "ekranSag2");
            ekranSol.setAttribute("className", "ekranSol2"); 
 
        }
        else if (msg >= 20 || msg <= 6)
        {//gece
            ekranSag.setAttribute("class", "ekranSag3");
            ekranSol.setAttribute("class", "ekranSol3");
            ekranSag.setAttribute("className", "ekranSag3");
            ekranSol.setAttribute("className", "ekranSol3");
              
        }
        else
        {//gündüz
          ekranSag.setAttribute("class", "ekranSag1");
            ekranSol.setAttribute("class", "ekranSol1");
            ekranSag.setAttribute("className", "ekranSag1");
            ekranSol.setAttribute("className", "ekranSol1");
        }  }  
                });  
       

/// jquery server saat

// server time

     
}




function ekranAltSayfa() {

var ekr = document.getElementById("ekranAltSayfa");
ekr.style.posWidth = document.body.clientWidth;
ekr.style.posHeight = document.documentElement.clientHeight;

var ekrContent = document.getElementById("ekranOrta");
ekrContent.style.posHeight =document.documentElement.clientHeight-148;

switch(navigator.appName){
case  "Microsoft Internet Explorer":

break;
case "Netscape":
ekr.style.height = document.documentElement.clientHeight + "px";
break;
}


reload();


}
