function gosterDun()
{
	document.getElementById('coku_hafta').style.display = 'none';
	document.getElementById('coku_ay').style.display = 'none';

	document.getElementById('dun').style.color = '#ffffff';
	document.getElementById('buhafta').style.color = '#f9b611';
	document.getElementById('buay').style.color = '#f9b611';
	
	document.getElementById('coku_dun').style.display = 'block';
}
function gosterHafta()
{
	document.getElementById('coku_dun').style.display = 'none';
	document.getElementById('coku_ay').style.display = 'none';

	document.getElementById('dun').style.color = '#f9b611';
	document.getElementById('buhafta').style.color = '#ffffff';
	document.getElementById('buay').style.color = '#f9b611';
	
	document.getElementById('coku_hafta').style.display = 'block';
}
function gosterAy()
{
	document.getElementById('coku_dun').style.display = 'none';
	document.getElementById('coku_hafta').style.display = 'none';

	document.getElementById('dun').style.color = '#f9b611';
	document.getElementById('buhafta').style.color = '#f9b611';
	document.getElementById('buay').style.color = '#ffffff';
	
	document.getElementById('coku_ay').style.display = 'block';
}


function yazar(did)
{
	document.getElementById('yazar_res_1').style.display = 'none';
	document.getElementById('yazar_res_2').style.display = 'none';
	document.getElementById('yazar_res_3').style.display = 'none';
	document.getElementById('yazar_res_4').style.display = 'none';
	document.getElementById('yazar_res_5').style.display = 'none';
	document.getElementById('yazar_res_6').style.display = 'none';
	document.getElementById('yazar_res_7').style.display = 'none';
	document.getElementById('yazar_res_8').style.display = 'none';
	document.getElementById('yazar_res_9').style.display = 'none';
	document.getElementById('yazar_res_10').style.display = 'none';

	document.getElementById('yazar_ad_1').style.display = 'none';
	document.getElementById('yazar_ad_2').style.display = 'none';
	document.getElementById('yazar_ad_3').style.display = 'none';
	document.getElementById('yazar_ad_4').style.display = 'none';
	document.getElementById('yazar_ad_5').style.display = 'none';
	document.getElementById('yazar_ad_6').style.display = 'none';
	document.getElementById('yazar_ad_7').style.display = 'none';
	document.getElementById('yazar_ad_8').style.display = 'none';
	document.getElementById('yazar_ad_9').style.display = 'none';
	document.getElementById('yazar_ad_10').style.display = 'none';

	document.getElementById('yazar_ga_1').style.display = 'none';
	document.getElementById('yazar_ga_2').style.display = 'none';
	document.getElementById('yazar_ga_3').style.display = 'none';
	document.getElementById('yazar_ga_4').style.display = 'none';
	document.getElementById('yazar_ga_5').style.display = 'none';
	document.getElementById('yazar_ga_6').style.display = 'none';
	document.getElementById('yazar_ga_7').style.display = 'none';
	document.getElementById('yazar_ga_8').style.display = 'none';
	document.getElementById('yazar_ga_9').style.display = 'none';
	document.getElementById('yazar_ga_10').style.display = 'none';

	document.getElementById('yazar_ya_1').style.display = 'none';
	document.getElementById('yazar_ya_2').style.display = 'none';
	document.getElementById('yazar_ya_3').style.display = 'none';
	document.getElementById('yazar_ya_4').style.display = 'none';
	document.getElementById('yazar_ya_5').style.display = 'none';
	document.getElementById('yazar_ya_6').style.display = 'none';
	document.getElementById('yazar_ya_7').style.display = 'none';
	document.getElementById('yazar_ya_8').style.display = 'none';
	document.getElementById('yazar_ya_9').style.display = 'none';
	document.getElementById('yazar_ya_10').style.display = 'none';
	
	document.getElementById('yazar_res_'+did).style.display = 'block';
	document.getElementById('yazar_ad_'+did).style.display = 'block';
	document.getElementById('yazar_ga_'+did).style.display = 'block';
	document.getElementById('yazar_ya_'+did).style.display = 'block';
}


function mycarousel_initCallback(carousel)
{
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

jQuery(document).ready(function() {
    jQuery('#kayanhaber').jcarousel({
		auto: 8,
        wrap: 'last',
		scroll: 5,
		size: 15,
        initCallback: mycarousel_initCallback
    });
});

//Font Büyüt
var tgs = new Array('span');
var szs = new Array('11px','12px','13px','14px','16px','18px','20px');
var startSz = 2;

function ts( trgt,inc ) {
	if (!document.getElementById) return
	var d = document,cEl = null,sz = startSz,i,j,cTags;
	
	sz += inc;
	if ( sz < 0 ) sz = 0;
	if ( sz > 6 ) sz = 6;
	startSz = sz;
		
	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

	cEl.style.fontSize = szs[ sz ];

	for ( i = 0 ; i < tgs.length ; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
	}
}


//Yorum Sayfasý

function CheckForm ( thisForm ) {
	TrimAll( thisForm );
	ClearAll( thisForm );
	ErrorExists = false;
	if ( thisForm.ad.value == "" ) {
		ErrorExists = true;
		getObject("hataad").innerHTML = "* Lütfen doldurun!";
	}
	if ( thisForm.soyad.value == "" ) {
		ErrorExists = true;
		getObject("hatasoyad").innerHTML = "* Lütfen doldurun!";
	}
	if ( thisForm.eposta.value == "" ) {
		ErrorExists = true;
		getObject("hataeposta").innerHTML = "* Lütfen doldurun!";
	}
	else if ( !checkEmail( thisForm ) ) {
		ErrorExists = true;
		getObject("hataeposta").innerHTML = "* Hatalý E-Posta!";
	}
	if ( thisForm.yorum.value == "" ) {
		ErrorExists = true;
		getObject("hatayorum").innerHTML = "* Lütfen doldurun!";
	}

	if ( ErrorExists )
		return false;
	else
		return true;
}

function getObject( objName ) {
	var ns4 = ( document.layers ) ? true : false;
	var w3c = ( document.getElementById ) ? true : false;
	var ie4 = ( document.all ) ? true : false;

	if ( ns4 ) return eval( 'document.' + objName );
	if ( w3c ) return document.getElementById( objName );
	if ( ie4 ) return eval( 'document.all.' + objName );
	return false;
}

function trim ( s ) {
	s = s.replace(/^\s*/,'').replace(/\s*$/, '');
	return s;
}

function TrimAll ( form ) {
    for ( var i=0, j = form.elements.length; i < j; i++ ) {
        myType = form.elements[i].type;
        if ( myType == 'text' || myType == 'textarea' ) {
            form.elements[i].value = trim(form.elements[i].value);
		}
    }
}

function ClearInput( thisInput ) {
	getObject( thisInput ).innerHTML = "";
}

function ClearAll ( thisForm ) {
	getObject( "hataad" ).innerHTML = "";
	getObject( "hatasoyad" ).innerHTML = "";
	getObject( "hataeposta" ).innerHTML = "";
	getObject( "hatayorum" ).innerHTML = "";
}

function checkEmail ( thisForm ) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(thisForm.eposta.value)) {
		return (true)
	}
	return (false)
}

function confirmation( mesaj ) {
	if ( mesaj == "" )
		mesaj = "Emin misiniz?";

	var agree = confirm( mesaj );

	if ( agree )
		return true ;
	else
		return false ;
}

function textCounter ( field, cntfield, maxlimit ) {
	if ( field.value.length > maxlimit )
		field.value = field.value.substring( 0, maxlimit );
	else
		cntfield.value = maxlimit - field.value.length;
}

//Yorum Sayfasý Bitiþ

function CheckForm2 ( thisForm ) {
	TrimAll2( thisForm );
	ClearAll2( thisForm );
	ErrorExists = false;
	if ( thisForm.adsoyad.value == "" ) {
		ErrorExists = true;
		getObject("hadsoyad").innerHTML = "* Lütfen doldurun!";
	}
	if ( thisForm.eposta.value == "" ) {
		ErrorExists = true;
		getObject2("heposta").innerHTML = "* Lütfen doldurun!";
	}else if ( !checkEmail2( thisForm ) ) {
		ErrorExists = true;
		getObject2("heposta").innerHTML = "* Hatalý E-Posta!";
	}
	if ( thisForm.gadsoyad.value == "" ) {
		ErrorExists = true;
		getObject2("hgadsoyad").innerHTML = "* Lütfen doldurun!";
	}
	if ( thisForm.geposta.value == "" ) {
		ErrorExists = true;
		getObject2("geposta").innerHTML = "* Lütfen doldurun!";
	}else if ( !checkEmail3( thisForm ) ) {
		ErrorExists = true;
		getObject2("hgeposta").innerHTML = "* Hatalý E-Posta!";
	}
	if ( thisForm.yorum.value == "" ) {
		ErrorExists = true;
		getObject2("hyorum").innerHTML = "* Lütfen doldurun!";
	}

	if ( ErrorExists )
		return false;
	else
		return true;
}

function getObject2( objName ) {
	var ns4 = ( document.layers ) ? true : false;
	var w3c = ( document.getElementById ) ? true : false;
	var ie4 = ( document.all ) ? true : false;

	if ( ns4 ) return eval( 'document.' + objName );
	if ( w3c ) return document.getElementById( objName );
	if ( ie4 ) return eval( 'document.all.' + objName );
	return false;
}

function trim2 ( s ) {
	s = s.replace(/^\s*/,'').replace(/\s*$/, '');
	return s;
}

function TrimAll2 ( form ) {
    for ( var i=0, j = form.elements.length; i < j; i++ ) {
        myType = form.elements[i].type;
        if ( myType == 'text' || myType == 'textarea' ) {
            form.elements[i].value = trim(form.elements[i].value);
		}
    }
}

function ClearInput2( thisInput ) {
	getObject( thisInput ).innerHTML = "";
}

function ClearAll2 ( thisForm ) {
	getObject( "hadsoyad" ).innerHTML = "";
	getObject( "heposta" ).innerHTML = "";
	getObject( "hgadsoyad" ).innerHTML = "";
	getObject( "hgeposta" ).innerHTML = "";
	getObject( "hyorum" ).innerHTML = "";
}

function checkEmail2 ( thisForm ) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(thisForm.eposta.value)) {
		return (true)
	}
	return (false)
}
function checkEmail3 ( thisForm ) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(thisForm.geposta.value)) {
		return (true)
	}
	return (false)
}

function confirmation2( mesaj ) {
	if ( mesaj == "" )
		mesaj = "Emin misiniz?";

	var agree = confirm( mesaj );

	if ( agree )
		return true ;
	else
		return false ;
}

function textCounter2 ( field, cntfield, maxlimit ) {
	if ( field.value.length > maxlimit )
		field.value = field.value.substring( 0, maxlimit );
	else
		cntfield.value = maxlimit - field.value.length;
}

//Sayfa Scroll

var ScrollLinks = {

	currentHash: false,
	start: function(){
		this.scroll = new fx.Scroll({duration: 1500, transition: fx.sineOut, onComplete: function(){this.end();}.bind(this)});
		this.allinks = $c(document.getElementsByTagName('a'));
		
		for(var i=0; i<this.allinks.length; i++) {
		
			var lnk = this.allinks[i];
			
			if ((lnk.href && lnk.href.indexOf('#') != -1) && ( (lnk.pathname == location.pathname) 
				|| ('/'+lnk.pathname == location.pathname) ) && (lnk.search == location.search)) {
				lnk.num = i;
				lnk.onclick = function(){

					ScrollLinks.scroll.clearTimer();
					this.initialHref = this.href;
					this.initialHash = this.hash;
					this.href = "javascript:void(0)";
					setTimeout(function(){this.href = this.initialHref;}.bind(this), 200);
					ScrollLinks.go(this);
				}
			}
		};
	},

	go: function(link){
	  this.currentHash = link.initialHash.slice(1);
	  this.currentBlock = $(this.currentHash);
	  if (this.currentBlock) {
	    ScrollLinks.scroll.scrollTo(this.currentBlock);
	  }
	},

	end: function(){
		if (!/Konqueror|Safari|KHTML/.test(navigator.userAgent)) window.location.hash = "#"+this.currentHash;
		this.currentHash = false;
	}
}


function ara_op()
{
	if(document.getElementById("ara_op_in").value==0)
	{
		document.getElementById("ara_ayar").style.display = "";
		document.getElementById("ara_op_in").value = "1";
		document.getElementById("arama_enu2").className = "arama_enu2";
		document.getElementById("ara_ic_sol").className = "ara_ic_sol";
		document.getElementById("ara_ak_in").className = "ara_ak_in";
		document.getElementById("ara_ak_btn").className = "ara_ak_btn";
		document.getElementById("ara_op_img").src = "http://sohret.kontv.com/konya/images/ara_ayar_k.gif";
	}
	else if(document.getElementById("ara_op_in").value==1)
	{
		document.getElementById("ara_ayar").style.display = "none";
		document.getElementById("ara_op_in").value = "0";
		document.getElementById("arama_enu2").className = "arama_enu22";
		document.getElementById("ara_ic_sol").className = "ara_ic_sol2";
		document.getElementById("ara_ak_in").className = "ara_ak_in2";
		document.getElementById("ara_ak_btn").className = "ara_ak_btn2";
		document.getElementById("ara_op_img").src = "http://sohret.kontv.com/konya/images/ara_ayar.gif";
	}
}

//Alt Menüler
var timeout         = 500;
var closetimer		= 0;
var ddmenuitem      = 0;

function jsddm_open()
{	jsddm_canceltimer();
	jsddm_close();
	ddmenuitem = $(this).find('ul').eq(0).css('visibility', 'visible');}

function jsddm_close()
{	if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}

function jsddm_timer()
{	closetimer = window.setTimeout(jsddm_close, timeout);}

function jsddm_canceltimer()
{	if(closetimer)
	{	window.clearTimeout(closetimer);
		closetimer = null;}}

$(document).ready(function()
{	$('#menu > li').bind('mouseover', jsddm_open);
	$('#menu > li').bind('mouseout',  jsddm_timer);});

document.onclick = jsddm_close;

//Hava Durumu en üst



//Hava durumu
function iladgoster (sehirad)
{
	document.getElementById('ilad').innerHTML = sehirad;
}
function iladsil ()
{
	document.getElementById('ilad').innerHTML = '';
}