var startTime = $time();
function startList(){
	//code only for IE
	if(!document.body.currentStyle) return;
	var subs = document.getElementsByName('submenu');
	for(var i=0; i<subs.length; i++) {
		var xx = subs[i].parentNode;
		if(xx && xx.lastChild.style) {
			xx.onmouseover = function() {
				this.lastChild.style.visibility = 'visible';
			}
			xx.onmouseout = function() {
			    this.lastChild.style.visibility = 'hidden'
			}
		}
	}
}
function getObject(obj) {
  var theObj;
  if(document.all) {
    if(typeof obj=="string") {
      return document.all(obj);
    } else {
      return obj.style;
    }
  }
  if(document.getElementById) {
    if(typeof obj=="string") {
      return document.getElementById(obj);
    } else {
      return obj.style;
    }
  }
  return null;
}

function arax(deger,e){
//alert($('tt-'+deger+'i').id);
var posx=0,posy=0;
if(e==null) e=window.event;
//if(e.pageX || e.pageY){
//    posx=e.pageX; posy=e.pageY;
//    }
//else if(e.clientX || e.clientY){
//    if(document.documentElement.scrollTop){
//        posx=e.clientX-document.documentElement.scrollLeft;
//        posy=e.clientY-document.documentElement.scrollTop;
//        }
//    else{
//        posx=e.clientX-document.body.scrollLeft;
//        posy=e.clientY-document.body.scrollTop;
//        }
//    }
    
//document.getElementById('tt-'+deger).style.left=(e.clientX-20)+'px';
//document.getElementById('tt-'+deger).style.top=(e.clientY-20)+'px';


$('tt-'+deger+'i').set('html','<img src="resimler/loading2.gif" alt="" style="border:0px;" />')

var urlSi = 'arax.asp?dil=tr&ara=' + Url.encode(deger);
var req = new Request.HTML({url: urlSi , 
		onSuccess: function(html) {
			//Clear the text currently inside the results div.
			$('tt-'+deger+'i').set('text', '');
			//Inject the new DOM elements into the results div.
			$('tt-'+deger+'i').adopt(html);
		},
		//Our request will most likely succeed, but just in case, we'll add an
		//onFailure method which will let the user know what happened.
		onFailure: function() {
			$('tt-'+deger+'i').set('text', 'The request failed.');
		}
	});
req.send();
}



var mytimer = null;
var mySkytimer = null;
var mySky2timer = null;
var Ticker = new Class({
    setOptions: function(options) {
        this.options = Object.extend({
            speed: 1500,
            delay: 15000,
            direction: 'Vertical',
            onComplete: Class.empty,
            onStart: Class.empty
        }, options || {});
    },
    initialize: function(el, options) {
        this.setOptions(options);
        this.el = $(el);
        this.items = this.el.getElements('li');
        var w = 0;
        var h = 0;
        if (this.options.direction.toLowerCase() == 'horizontal') {
            h = this.el.getSize().y;
            this.items.each(function(li, index) {
                w += li.getSize().x;
            });
        } else {
            w = this.el.getSize().x;
            this.items.each(function(li, index) {
                h += li.getSize().y;
            });
        }
        this.el.setStyles({
            position: 'absolute',
            top: 0,
            left: 0,
            width: w,
            height: h
        });
        this.fx = new Fx.Morph(this.el, { duration: this.options.speed, onComplete: function() {
            var i = (this.current == 0) ? this.items.length : this.current;
            this.items[i - 1].injectInside(this.el);
            this.el.setStyles({
                left: 0,
                top: 0
            });
        } .bind(this)
        });
        this.current = 0;
        this.next();
    },
    next: function() {
        this.current++;
        if (this.current >= this.items.length) this.current = 0;
        var pos = this.items[this.current];
        this.fx.start({
            top: -pos.offsetTop,
            left: -pos.offsetLeft
        });
        //this.next.bind(this).delay(this.options.delay+this.options.speed);
        //In the next function, set the mytimer var to the delay timer.
        mytimer = this.next.bind(this).delay(this.options.delay + this.options.speed);
        //mySkytimer = this.next.bind(this).delay(this.options.delay+this.options.speed);
        //mySky2timer = this.next.bind(this).delay(this.options.delay+this.options.speed);
    },

    pause: function() {
        $clear(mytimer);
        mytimer = null;
    },
    resume: function() {
        if (mytimer == null) {
            this.next();
        }
    }

});



		function Login1(evt) {
		    var charCode = (evt.which) ? evt.which : event.keyCode
		    if (charCode == 13) {
		        $("kul_pas").focus();
		    }
		}
		function Login2(evt) {
		    var charCode = (evt.which) ? evt.which : event.keyCode
		    if (charCode == 13) {
		        uyegiris.submit();
		    }
		}

		function sadecesayi(evt) {
		    var charCode = (evt.which) ? evt.which : event.keyCode
		    if (charCode > 31 && (charCode < 48 || charCode > 57))
		        return false;
		    return true;
		}

		function saatlatlat() {
		    var time = new Date();
		    var hr = time.getHours();
		    var mins = time.getMinutes();
		    var secs = time.getSeconds();

		    if (hr <= 9) hr = "0" + hr;
		    if (mins <= 9) mins = "0" + mins;
		    if (secs <= 9) secs = "0" + secs;

		    $('time').set('text', hr + ':' + mins + ':' + secs);

		    setTimeout('saatlatlat()', 100);

		}


		window.addEvent('domready', function() {
		    //var FO = { movie: "mp3player/player-viral.swf", width: "250", height: "20", majorversion: "9", build: "0", bgcolor: "#111111", allowFullScreen: "false", menu: "false", flashvars: "duration=0&file=mp3player/muzik.mp3&backcolor=111111&frontcolor=999999&lightcolor=EEEEEE&screencolor=FFFFFFF&volume=30&dock=false&autostart=true&icons=false&repeat=always&stretching=none" };
		    //UFO.create(FO, "theMediaPlayer");

		    var so = new SWFObject('mp3player/player-viral.swf', 'mpl', '250', '20', '9');
		    so.addParam('allowfullscreen', 'true');
		    so.addParam('allowscriptaccess', 'always');
		    so.addParam('wmode', 'opaque');
		    so.addParam('bgcolor', '111111');
		    so.addVariable('duration', '0');
		    so.addVariable('file', 'mp3player/muzik.mp3');
		    so.addVariable('backcolor', '111111');
		    so.addVariable('frontcolor', '999999');
		    so.addVariable('lightcolor', 'EEEEEE');
		    so.addVariable('screencolor', 'FFFFFFF');
		    so.addVariable('volume', '30');
		    so.addVariable('dock', 'false');
		    so.addVariable('autostart', 'true');
		    so.addVariable('icons', 'false');
		    so.addVariable('repeat', 'always');
		    so.addVariable('stretching', 'none');
		    so.write('theMediaPlayer');

		    if ($('govde').hasChild('NewsTicker')) {
		        //$('NewsTicker').addEvent('mouseenter', function() { vert.pause(); });
		        //$('NewsTicker').addEvent('mouseleave', function() { vert.resume(); });
		    }
		    


		});

		window.addEvent('load', function() {
		    document.getElementById("hava").backgroundColor = "transparent";
		    document.getElementById("hava").background = "#111 url('/resimler/loading3.gif') center center no-repeat";
		    document.getElementById("hava").allowtransparency = "true";
		    document.getElementById("hava").src = "hava.asp?dil=tr";
		});

		function acilNoGetir(kat) {
		    $('yukleniyor').set('html', '<img src="/resimler/loading3.gif" alt="" style="border:0px;" />')

		    var urlSi = '/acil_goster.asp?dil=tr&id=' + kat;

		    var req = new Request.HTML({ url: '' + urlSi + '',
		        onSuccess: function(html) {
		            //Clear the text currently inside the results div.
		            $('acilNo').set('text', '');
		            //Inject the new DOM elements into the results div.
		            $('acilNo').adopt(html);
		            $('yukleniyor').set('html', '&nbsp;');
		        },
		        //Our request will most likely succeed, but just in case, we'll add an
		        //onFailure method which will let the user know what happened.
		        onFailure: function() {
		            $('acilNo').set('text', 'The request failed.');
		            $('yukleniyor').set('html', '&nbsp;');
		        }
		    });
		    req.send();
		}
		window.addEvent('domready', function() {
		    //document.body.addEvent('contextmenu', function(e) {
		    //    e.stop();
		    //});
		});

