function refPic(picName,picContent){
	document.all['refContent'].innerHTML = '<img CLASS=img src="./img/refs/'+picName+'" border=0><br>'+picContent;
}

function refContent(content){
	document.all['refContent'].innerHTML = "";
	document.all['refContent'].innerHTML = content;
	alert(content);
}

function ilSubmit(elem) {
	if (elem.options[elem.selectedIndex].value != 0){
		document.forms['iller'].submit();
	}
}





function kayak_basla(page_content){
	document.all['pscroller'].innerHTML = replaceString('bip ', dot, document.all[page_content].innerHTML);
	kaydir('pscroller', '160');
}
function sol_basla(page_content){
	document.all['leftside'].innerHTML = replaceString('bip ', dit, document.all[page_content].innerHTML);
}
function sag_basla(page_content){
	document.all['pscroller'].innerHTML = replaceString('bip ', dot, document.all[page_content].innerHTML);
	kaygetir('pscroller', '160',1);
}
function holdThis(){
	kayak_ok = false;
}

function releaseThis(){
	kayak_ok = true;
}

function kaydir(scrollname, maxheight){
if (kayak == 2000){kayak=51;}
if (kayak == 50){kayak=2000;}

if(bw.ns){
	x = document.getElementById(scrollname).left;
	y = document.getElementById(scrollname).top;
	if (document.getElementById(scrollname).height){
		h = document.getElementById(scrollname).height;
	}else{
		h = document.getElementById(scrollname).clip.bottom - document.getElementById(scrollname).clip.top;
	}
}
if(bw.ie){
	x = document.all[scrollname].style.pixelLeft;
	y = document.all[scrollname].style.pixelTop;
	if (false && document.all[scrollname].style.pixelHeight){
		h = document.all[scrollname].style.pixelHeight;
    }else{
      h = document.all[scrollname].clientHeight;
	}
}

if ((y + h) < 0){
y = maxheight;
}else{
y = y - 1;
}

if (kayak_ok && kayak_enable){
	moveLayerTo(scrollname, x, y);
}
setTimeout("kaydir('" + scrollname + "', '" + maxheight + "');", kayak);
}


function hepkaydir(scrollname, maxheight){
if (kayak == 2000){kayak=41;}
if (kayak == 50){kayak=2000;}

if(bw.ns){
	x = document.getElementById(scrollname).left;
	y = document.getElementById(scrollname).top;
	if (document.getElementById(scrollname).height){
		h = document.getElementById(scrollname).height;
	}else{
		h = document.getElementById(scrollname).clip.bottom - document.getElementById(scrollname).clip.top;
	}
}
if(bw.ie){
	x = document.all[scrollname].style.pixelLeft;
	y = document.all[scrollname].style.pixelTop;
	if (false && document.all[scrollname].style.pixelHeight){
		h = document.all[scrollname].style.pixelHeight;
    }else{
      h = document.all[scrollname].clientHeight;
	}
}

if (y < (maxheight * -1)){
y = 0;
}else{
y = y - 1;
}

if (kayak_ok && kayak_enable){
	moveLayerTo(scrollname, x, y);
}
setTimeout("hepkaydir('" + scrollname + "', '" + maxheight + "');", kayak);
}



function kaygetir(scrollname, maxheight, owy){

var kaygetir_ok = true;

if(bw.ns){
	x = document.getElementById(scrollname).left;
	y = document.getElementById(scrollname).top;
	if (document.getElementById(scrollname).height){
		h = document.getElementById(scrollname).height;
	}else{
		h = document.getElementById(scrollname).clip.bottom - document.getElementById(scrollname).clip.top;
	}
}
if(bw.ie){
	x = document.all[scrollname].style.pixelLeft;
	y = document.all[scrollname].style.pixelTop;
	if (false && document.all[scrollname].style.pixelHeight){
		h = document.all[scrollname].style.pixelHeight;
    }else{
      h = document.all[scrollname].clientHeight;
	}
}

if (owy){y=0;}

if (y == 0){
y = maxheight;
}else if ( y < 6){
kaygetir_ok = false;
y = 1;
}else{
y = y - 5;
}

moveLayerTo(scrollname, x, y);
if (kaygetir_ok){
	setTimeout("kaygetir('" + scrollname + "', '" + maxheight + "');", 1);
}
}


function moveLayerTo(layer, x, y)
{
  if(bw.ns){
    document.getElementById(layer).moveTo(x, y);
  }
  if(bw.ie){
    document.all[layer].style.left = x;
    document.all[layer].style.top  = y;
  }
}
function replaceString(oldS,newS,fullS){
for (var i=0; i<fullS.length; i++) {
      if (fullS.substring(i,i+oldS.length) == oldS) {
	           fullS = fullS.substring(0,i)+newS+fullS.substring(i+oldS.length,fullS.length)
      }
   }
return fullS
}
function show_submenu(str_DivName){
// <div id="pack_programe" style="display:none">
	var obj_Div = eval('document.' + str_DivName);
	if (obj_Div.style.display == 'none'){
		obj_Div.style.display = 'block';
	} else {
		obj_Div.style.display = 'none';
	}
}

function clearAllDiv(){
	var obj_Div = eval('document.all.tip1');
	if (obj_Div.style.display == 'block'){obj_Div.style.display = 'none'}
	obj_Div = eval('document.all.tip2');
	if (obj_Div.style.display == 'block'){obj_Div.style.display = 'none'}
	obj_Div = eval('document.all.tip3');
	if (obj_Div.style.display == 'block'){obj_Div.style.display = 'none'}
}

function show_altmenu(str_DivName){
// <div id="pack_programe" style="display:none">
	clearAllDiv();
	obj_Div = eval('document.all.' + str_DivName);
	if (obj_Div.style.display == 'none'){
		obj_Div.style.display = 'block'
	}
}
function TitleR () {
	while (y ++ < z) {
	text = " " + text;
	}
	scroller();
}

function scroller() {
document.title = text.substring(x++, text.length);
if (x == text.length) {
x = 0;
}
setTimeout("scroller()", delay);
}


function fixElement(element, message) {
alert(message);
element.focus();
}

/* ############################### Form Checking Routines ###############################  */
function isMailReady(form) {
var passed = false;
    if (form.nnr_fullname.value == "") {
    fixElement(form.nnr_fullname, "Lütfen isminizi yazınız..");
    }
    else if (form.nnr_email.value.indexOf("@") == -1 ||
             form.nnr_email.value.indexOf(".") == -1) {
    fixElement(form.nnr_email, "Lütfen geçerli bir e-mail adresi yazınız..");
    }
    else {
    passed = true;
    }
return passed;
}
/*    onSubmit = "return isMailReady(this);"   */

function isMFormReady(form) {
var passed = false;
    if (form.nnr_fullname.value == "") {
    fixElement(form.nnr_fullname, "Lütfen isminizi yazınız..");
    }
    else if (form.nnr_email.value.indexOf("@") == -1 ||
             form.nnr_email.value.indexOf(".") == -1) {
    fixElement(form.nnr_email, "Lütfen geçerli bir e-mail adresi yazınız..");
    }
	else{
	 if (form.konu[0].checked == true){
	    passed = false;
		MYWidth = 405;
		MYHeight = 448;
		MYLeft = (screen.availWidth-MYWidth)/2;
		MYTop = (screen.availHeight-MYHeight)/2;
		KFeatures = "resize=no,width=" + MYWidth + ",height=" + MYHeight + ",left=" + MYLeft + ",top=" + MYTop;
		Loc = './register.php?ac=n&fn='+form.nnr_fullname.value+'&em='+form.nnr_email.value+'&l='+form.l.value;
		window.open(Loc,'MyPoPuP',KFeatures);
	}else{
		passed = true;
    }
	}
	return passed;
}

function isPFormReady(form) {
var passed = false;
    if (form.nnr_username.value == "") {
    fixElement(form.nnr_username, "Lütfen geçerli bir kullanıcı kodu yazınız..");
    }
	else if (form.nnr_password.value == "") {
    fixElement(form.nnr_password, "Lütfen şifrenizi yazınız..");
    }
    else {
    passed = true;
    }
return passed;
}

function resim(imgid, imgname){
	imgname = "./img/gui/" + imgname;
	if (bw.ie) {
		document.all[imgid].src = imgname;
	} else {
		myTD = document.getElementById(imgid);
  		myTD.src = imgname;
	}
}


function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion; this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5 || this.dom)
	return this
}

// -------------------------------------------------------------------

	var bw=new lib_bwcheck()
	var x = 0;
	var y = 0;
	var z = 140;
	var delay = 140; // Title Scroller Delay
	var kayak = 50; // Text Scroler Delay
	var kayak_ok = true;
	var kayak_enable = true;
	var dot = '<img src="./img/gui/o_bullet.gif" width=4 height=4 alt="" border=0 vspace=4>';
	var dit = '<img src="./img/gui/o_mavi.gif" width=5 height=5 alt="" border=0 vspace=1 hspace=4>';

	var a;
	a=new Date();
	lm_year=a.getYear();
	if (lm_year<1000){
		if (lm_year<70){
		lm_year=2000+lm_year;
		}
		else lm_year=1900+lm_year;
	}
	lm_month=a.getMonth()+1;
	if (lm_month<10){
		lm_month='0'+lm_month;
	}
	lm_day=a.getDate();
	if (lm_day<10){
		lm_day='0'+lm_day;
	}
	lm_dayname = a.getDay()+1;
	
	monthName = new Array(12)
	monthName[0] = 'Ocak'
	monthName[1] = 'Şubat'
	monthName[2] = 'Mart'
	monthName[3] = 'Nisan'
	monthName[4] = 'Mayıs'
	monthName[5] = 'Haziran'
	monthName[6] = 'Temmuz'
	monthName[7] = 'Ağustos'
	monthName[8] = 'Eylül'
	monthName[9] = 'Ekim'
	monthName[10] = 'Kasım'
	monthName[11] = 'Aralık'
	
	dayName = new Array(7)
	dayName[0] = 'Pazar'
	dayName[1] = 'Pazartesi'
	dayName[2] = 'Salı'
	dayName[3] = 'Çarşamba'
	dayName[4] = 'Perşembe'
	dayName[5] = 'Cuma'
	dayName[6] = 'Cumartesi'
	
	Bugun =  lm_day +' '+monthName[lm_month-1]+' '+lm_year+' - '+dayName[lm_dayname-1];



