// JavaScript Document

function omover(obj){
	obj.className = "solMenuOver";
	obj.document.getElementByTagName('a')[0].className = "";
}

function omout(obj){
	obj.className = "solMenu";
}

function oclick(obj){
	var kopru = obj.getElementsByTagName('a')[0].href;
	location.href = kopru;
}

function imajYukle(img,divID){
	tempDiv = document.createElement('DIV');
	tempDiv.id = divID;
	tempDiv.style.position = 'absolute';
	tempDiv.style.display = "none";
	tempDiv.style.left = -150 + "px";
	tempDiv.style.top = -150 + "px";
	//tempDiv.style.z-index = divID*2;
	tempDiv.innerHTML = "<img src=\""+img+"\" />";
	document.body.appendChild(tempDiv);
}

//Saat Gösterme Fonksiyonu
function clockon() {
	var thistime = new Date()
	var hours = thistime.getHours()
	var minutes = thistime.getMinutes()
	var seconds = thistime.getSeconds()
	if (eval(hours) < 10) { hours="0"+hours }
	if (eval(minutes) < 10) { minutes="0"+minutes }
	if (seconds < 10) { seconds="0"+seconds }
	var saat = hours +" : "+minutes+" : "+seconds
	document.getElementById('saat').innerHTML = saat
	var timer=setTimeout("clockon()",1000)
}
window.onload = clockon;	
//Saat gösterme fonksiyonu

//eposta doğrulama///////////////////////////
function isEmail(str){
var re = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i
return re.test(str);
}
//eposta doğrulama/////////////////////////////

//İletişim Formu Denetle
function iletisimFormDenetle(){
    if (document.getElementById('isim').value == "") {alert('Dikkat!!!\n\nLütfen isminizi yazınız...');document.getElementById('isim').focus();return false;}
    else if (document.getElementById('mail').value == "") {alert('Dikkat!!!\n\nLütfen e-posta adresinizi yazınız...');document.getElementById('mail').focus();return false;}
    else if(!isEmail(document.getElementById('mail').value)){alert('Dikkat!!!\n\nE-Posta adresiniz doğru görünmemektedir. Lütfen kontrol ediniz.');document.getElementById('mail').focus();return false;}
	else if (document.getElementById('mesaj').value == ""){alert('Dikkat!!!\n\nLütfen mesajınızı yazınız...');document.getElementById('mesaj').focus();return false;}
	else {return true;}
}

function toggle(obj) {
	var id = document.getElementById(obj);
	
	if (id.style.display == "block" ) {
		id.style.display = "none";
	}else{
		id.style.display = "block";
	}
}


//haberModül Kodları
function haberAc(no){
  var haberSayi = document.getElementById('linkler').getElementsByTagName('div').length;
  for (var i = 0; i < haberSayi; i++){
	gizle('foto'+i);
	gizle('spot'+i);
  }
  goster('foto'+no);
  goster('spot'+no);
}



function gizle(obj){
	document.getElementById(obj).style.display = "none";
	return;
}

function goster(obj){
	document.getElementById(obj).style.display = "block";
	return;
}
//-----------------------------------------------------------

//yanıp sönme efekti...
function blink(elementid){ 
	colorarray = Array(
			'#000033',
			'#111111', 
			'#222222',
			'#333333',
			'#444444',
			'#555555',
			'#666666',
			'#777777',
			'#888888',
			'#999999',
			'#CCCCCC',
			'#DDDDDD',
			'#EEEEEE',
			'#FFFFFF'
	); 
i=0; 	
setInterval ("changecolor('"+elementid+"')",150);

}

function changecolor(x) { 

	var x= document.getElementById(x);
	if (x != null){
		x.style.color = colorarray[i];
		if (i==14){ i= 0;
			colorarray = colorarray.reverse();
		}
	}
	i++;
}
//Yanıp sönme efekti...


// flash versiyon kontrol...
function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}

