//begin sid check
function chkSid () {

  	if (document.sid.num.value == "")
  	{
    alert("Sid numarası eksik!");
    document.sid.num.focus();
    return false;
  	}

 	 var chkZ = 1;
 	 for (i = 0; i < document.sid.num.value.length; ++i)
   	 if (document.sid.num.value.charAt(i) < "0" ||
        document.sid.num.value.charAt(i) > "9")
      chkZ = -1;
  	if (chkZ == -1) {
    alert("Lütfen sadece Rakam yazın!");
    document.sid.num.focus();
    return false;
  	}
 }


 //sid check end

 //begin timer

var countDown = {
	onFinish: function(){
		location = "reload.php" ;;
	},
	countDownId: new Array("countDown", "countDown2"),
	toggleId: new Array("toggle"),
	toggleText: {
		isRunning: "<img src='images/icon/stop.png' alt='stop' title='Zaman&#305; durdur yayin degismesin' />",
		notRunning: "<img src='images/icon/run.png' alt='run' title='devam et otomatik yayin' />"
	},
	remaining: 900 * 1000,

	//Interieur functions
	lastTime: false,
	show: function(){
		if (!this.lastTime) return;
		var d = new Date();
		this.remaining -= d - this.lastTime;
		this.lastTime = d;
		if (this.remaining <= 0){
			this.onFinish();
			this.remaining = 0;
			this.run = false;
		}
		d = new Date(this.remaining);
		var str = "";
		var el;
		if ((el = d.getUTCHours()) != 0) str += el + ":";
		str += d.getMinutes().toZeros(2) + ":";
		str += d.getSeconds().toZeros(2);

		if (this.countDownId.constructor == Array){
			for (var i = 0; i < this.countDownId.length; i++){
				document.getElementById(this.countDownId[i]).innerHTML = str;
			}
		}
		else{
			document.getElementById(this.countDownId).innerHTML = str;
		}

		if (this.run){
			var This = this;
			window.setTimeout(function(){
				This.show();
			}, 100);
		}
		else{
			this.lastTime = false;
		}
	},
	run: false,
	toggle: function(){
		if (this.run){
			this.run = false;
			var str = this.toggleText.notRunning;
		}
		else{
			this.run = true;
			var str = this.toggleText.isRunning;
			this.lastTime = new Date();
			this.show();
		}
		if (this.toggleId.constructor == Array){
			for (var i = 0; i < this.toggleId.length; i++){
				document.getElementById(this.toggleId[i]).innerHTML = str;
			}
		}
		else{
			document.getElementById(this.toggleId).innerHTML = str;
		}
	}
};

Number.prototype.toZeros = function(nr){
	var ret = this.toString();
	while(ret.length < nr){
		ret = "0" + ret;
	}
	return ret;
};

//end timer


//begin radio size

function setHeight(flath){
document.getElementById("flatcast").style.height= flath+"px";
}
function setWidth(flatw){
document.getElementById("flatcast").style.width= flatw+"px";
}
//end radio size

//begin radio dhtml

var ie=document.all
var dom=document.getElementById
var ns4=document.layers
var calunits=document.layers? "" : "px"

var bouncelimit=32 //(must be divisible by 8)
var direction="up"

function initbox(){
if (!dom&&!ie&&!ns4)
return
crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
crossobj.top=scroll_top-250+calunits
crossobj.visibility=(dom||ie)? "visible" : "show"
dropstart=setInterval("dropin()",50)
}

function dropin(){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
if (parseInt(crossobj.top)<-10+scroll_top) //die hoehe festlegen
crossobj.top=parseInt(crossobj.top)+40+calunits
else{
clearInterval(dropstart)
bouncestart=setInterval("bouncein()",50)
}
}

function bouncein(){
crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits
if (bouncelimit<0)
bouncelimit+=8
bouncelimit=bouncelimit*-1
if (bouncelimit==0){
clearInterval(bouncestart)
}
}

function dismissbox(){
if (window.bouncestart) clearInterval(bouncestart)
crossobj.visibility="hidden"
}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}


window.onload=initbox


//end radio dhtml
