function degistir(obj, olay){

        if ( olay == 1 ) {
                obj.style.background = '#99CC33';
                                    obj.style.color = '#ffffff';
        }
        if ( olay == 0 ) {
                obj.style.background = 'ffffff';
                                    obj.style.color = '#000000';
                prevVal = obj.value;
        }

}

function yonetimgoster(kisi)
{
	window.open(kisi,"","width=350,height=372,left=75,top=105,scrollbars=yes");
}

function tarihgoster()
{
	print1="";
	print2="";
	print3="";
	today = new Date();
	weekday = today.getDay();
	if (weekday == 6) print1='Cumartesi';
	if (weekday == 0) print1='Pazar';
	if (weekday == 1) print1='Pazartesi';
	if (weekday == 2) print1='Salı';
	if (weekday == 3) print1='Çarşamba';
	if (weekday == 4) print1='Perşembe';
	if (weekday == 5) print1='Cuma';
	month = today.getMonth();
	if (month == 0) print2='Ocak';
	if (month == 1) print2='Şubat';
	if (month == 2) print2='Mart';
	if (month == 3) print2='Nisan';
	if (month == 4) print2='Mayıs';
	if (month == 5) print2='Haziran';
	if (month == 6) print2='Temmuz';
	if (month == 7) print2='Ağustos';
	if (month == 8) print2='Eylül';
	if (month == 9) print2='Ekim';
	if (month == 10) print2='Kasım';
	if (month == 11) print2='Aralık';
	date = today.getDate();
	year=today.getYear();
	sonuc = date + ' ' + print2 + ' ' + year +  ' - ' + print1;
	return sonuc;
}


function haberbulten(sayfa)
{
	if(this.haberlist.adi.value != "" && this.haberlist.email.value != "")
	{
		email = this.haberlist.email.value;

	        if((email.indexOf('@')>=0) && (email.indexOf('.')>=0))
       		{
			window.open(sayfa,"","width=300,height=200,left=260,top=150,scrollbars=yes");
	        }
		else
       		{
			alert("e-posta Adresinizi Yanlış Yazmışsınız.");
	        }
	}
}


function buyukgoster(resadi,resim,en,boy)
{
	sayfa = "resgoster.php?ulasbas=" + resadi + "&res=" + resim;
	window.open(sayfa,"","width=" + en + ",height=" + boy + ",left=100,top=100,scrollbars=no");
}



function echeck(str) {

                var at="@"
                var dot="."
                var lat=str.indexOf(at)
                var lstr=str.length
                var ldot=str.indexOf(dot)
                if (str.indexOf(at)==-1){
                   return false
                }

                if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
                   return false
                }

                if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
                    alert("E-Posta Adresinizi Yanlış Yazmışsınız.")
                    return false
                }

                 if (str.indexOf(at,(lat+1))!=-1){
                    alert("E-Posta Adresinizi Yanlış Yazmışsınız.")
                    return false
                 }

                 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
                    alert("E-Posta Adresinizi Yanlış Yazmışsınız.")
                    return false
                 }

                 if (str.indexOf(dot,(lat+2))==-1){
                    alert("E-Posta Adresinizi Yanlış Yazmışsınız.")
                    return false
                 }

                 if (str.indexOf(" ")!=-1){
                    alert("E-Posta Adresinizi Yanlış Yazmışsınız.")
                    return false
                 }

                  return true
        }



function duzelt(bir,iki,giris)
{
	bir.style.display='none';
	iki.style.display='block';
	degistir(giris,1);
	giris.focus();
}


function haberetkac(hid)
{
	window.open("haberetk.php?hid=" + hid,"","width=350,height=350,left=200,top=135,scrollbars=yes");
}


function dernekhaberac(hid)
{
	window.open("dernekhaber.php?hid=" + hid,"","width=450,height=280,left=150,top=155,scrollbars=yes");
}

function haberbulkayit(email)
{
	if(email != "")
	{
	        if(echeck(email))
       		{
				window.open("haberbulten.php?epostam="+email,"","width=300,height=200,left=260,top=150,scrollbars=yes");
	        }
	}
    else
    {
    		alert("Lütfen e-posta adresinizi giriniz...");
    }
}

function resimac(resim,gorunum,rid)
{
	window.open('resgoster.php?res=duzce/buyuk/' + resim + '&rid=' + rid ,'',gorunum + ',left=80,top=80,scrollbars=yes');
}