// JavaScript Document

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function mahmut_abi_ayar(){
	document.getElementById('mahmut_abi').style.left=(document.getElementById('big_table').offsetLeft-199)+'px';
	document.getElementById('mahmut_abi').style.top=document.getElementById('search_table').offsetTop+'px';
	document.getElementById('mahmut_abi').style.visibility='visible';

	document.getElementById('saziye_teyze').style.left=(document.getElementById('big_table').offsetWidth+10+document.getElementById('big_table').offsetLeft)+'px';
	document.getElementById('saziye_teyze').style.top=(document.getElementById('search_table').offsetTop+102)+'px';
	document.getElementById('saziye_teyze').style.visibility='visible';
	

}
function kelime_show(id){
	text='<form action="javascript:kelime_ekle(\'yeni_kelime\');" method="post" name="yeni_kelime" id="yeni_kelime">';
	text+='<input type="hidden" name="action" value="new" />';
	text+='<input type="hidden" id="key" name="key" value="'+id+'" />';
	text+='<button type="button" onClick="bak();" class="submit_but">Bakiver</button><br>';
	text+='<textarea id="meaning" name="meaning" style="width:90%; height:150px; padding:10px;" class="ara_input"></textarea><br><br>';
	text+='<input type="submit" class="submit_but" value="yazdıklarımı ekle" />';
	text+='</form>';
	document.getElementById('ekkelime').innerHTML =text;
}
function kelime_hide(){
	document.getElementById('ekkelime').innerHTML ='<!--/* form area* /-->';	
}
function bisiler_show(id){
	text='<form action="javascript:bisiler_ekle(\'yenimanalar\');" method="post" name="yenimanalar" id="yenimanalar" >';
	text+='<input type="hidden" name="action" value="addmore" />';
	text+='<input type="hidden" id="key" name="key" value="'+id+'" />';
	text+='<button type="button" onClick="bak();" class="submit_but">Bakiver</button><br>';
	text+='<textarea id="meaning" name="meaning" style="width:90%; height:150px; padding:10px;" class="ara_input"></textarea><br><br>';
	text+='<input type="submit" class="submit_but" value="yazdıklarımı ekle" />';
	text+='</form>';
	document.getElementById('ekbisiler').innerHTML =text;
}
function bisiler_hide(){
	document.getElementById('ekbisiler').innerHTML ='<!--/* form area* /-->';
}

function login_show(errors){
	text='<form action="javascript:login(\'login_form\')" method="post" name="login_form" id="login_form">';
	text+='<table width="200" border="0" align="center" cellpadding="1" cellspacing="2">';
	if(errors.length){
		text+='<tr>';
		text+='<td colspan="2" class="all_text"><strong>'+errors+'</strong></td>';
		text+='</tr>';	
	}
	text+='<tr>';
	text+='<td colspan="2" class="all_text"><strong>Giriş</strong></td>';
	text+='</tr>';
	text+='<tr>';
	text+='<td class="all_text">Kullanıcıadı</td>';
	text+='<td><input name="username" type="text" class="ara_input" id="username"  /></td>';
	text+='</tr>';
	text+='<tr>';
	text+='<td class="all_text">Şifre</td>';
	text+='<td><input name="password" type="password" class="ara_input" id="password"  /></td>';
	text+='</tr>';
	text+='<tr>';
	text+='<td colspan="2" align="center"><button type="submit" class="submit_but" style="width:50px;">Giriş</button></td>';
	text+='</tr>';
	text+='</table>';
	text+='</form>';
	document.getElementById('login_details').innerHTML=text;
	document.getElementById('login_zimbirtilari').style.visibility='visible';
	
}

function login_hide(){
	document.getElementById('login_zimbirtilari').style.visibility='hidden';	
}
function draw_register_form(errors){
	var d=new Date();
	text='<div class="all_text" style="padding:10px;">\n';
	text+='<form action="javascript:register(\'register_form\');" method="post" name="register_form" id="register_form"><table border="0" align="center" cellpadding="1" cellspacing="2" class="all_text">\n';
	if(errors.length){
		text+='<tr>';
		text+='<td colspan="2" class="all_text"><strong>'+errors+'</strong></td>';
		text+='</tr>';	
	}
	text+='<tr>';
	text+='<td align="right">kullanıcıadı</td>';
	text+='<td><input name="register_nick" id="register_nick" type="text" class="ara_input" style="width:150px;" onkeyup="" /></td>';
	text+='</tr>';
	text+='<tr>';
	text+='<td align="right">email</td>';
	text+='<td><input name="register_email" id="register_email" type="text" class="ara_input" style="width:150px;" onkeyup="" /></td>';
	text+='</tr>';
	text+='<tr>';
	text+='<td align="right">şifre</td>';
	text+='<td><input name="register_password" id="register_password" type="password" class="ara_input" style="width:150px;" onkeyup="" /></td>';
	text+='</tr>';
	text+='<tr>';
	text+='<td align="right">doğum tarihi</td>';
	text+='<td><select name="register_day" id="register_day" class="ara_input">';
	text+='<option selected value="">Gün</option>';
	for (var i = 1; i < 32; i++) {
    	text+='<option value="'+i+'">'+i+'</option>';
    }	
	text+='</select>';
	text+='-';
	text+='<select name="register_month" id="register_month" class="ara_input">';
	text+='<option selected value="">Ay</option>';
	for (var i = 1; i < 13; i++) {
    	text+='<option value="'+i+'">'+i+'</option>';
    }
	text+='</select>';
	text+='-';
	text+='<select name="register_year" id="register_year" class="ara_input">';
	text+='<option selected value="">Yıl</option>';
	for (var i = 1940; i < d.getFullYear()-19; i++) {
    	text+='<option value="'+i+'">'+i+'</option>';
    }
	text+='</select>';
	text+='</td>';
	text+='</tr>';
	text+='<tr>';
	text+='<td align="right">cinsiyet</td>';
	text+='<td><select name="register_sex" id="register_sex" class="ara_input">';
	text+='<option selected value="">Seçelim</option>';
	text+='<option value="0">Bayan</option>';
	text+='<option value="1">Bay</option>';
	text+='</select>';
	text+='</td>';
	text+='</tr>';
	text+='<tr>';
	text+='<td align="right">şehir</td>';
	text+='<td><select name="register_city" id="register_city" class="ara_input">';
	text+='<option selected value="">Seçelim</option>';
	text+='<option value="Adana">Adana</option>';
	text+='<option value="Adıyaman">Adıyaman</option>';
	text+='<option value="Afyon">Afyon</option>';
	text+='<option value="Ağrı">Ağrı</option>';
	text+='<option value="Aksaray">Aksaray</option>';
	text+='<option value="Amasya">Amasya</option>';
	text+='<option value="Ankara">Ankara</option>';
	text+='<option value="Antalya">Antalya</option>';
	text+='<option value="Ardahan">Ardahan</option>';
	text+='<option value="Artvin">Artvin</option>';
	text+='<option value="Aydın">Aydın</option>';
	text+='<option value="Balıkesır">Balıkesır</option>';
	text+='<option value="Bartın">Bartın</option>';
	text+='<option value="Batman">Batman</option>';
	text+='<option value="Bayburt">Bayburt</option>';
	text+='<option value="Bilecik">Bilecik</option>';
	text+='<option value="Bingol">Bingol</option>';
	text+='<option value="Bitlis">Bitlis</option>';
	text+='<option value="Bolu">Bolu</option>';
	text+='<option value="Burdur">Burdur</option>';
	text+='<option value="Bursa">Bursa</option>';
	text+='<option value="Çanakkale">Çanakkale</option>';
	text+='<option value="Çankırı">Çankırı</option>';
	text+='<option value="Çorum">Çorum</option>';
	text+='<option value="Denizli">Denizli</option>';
	text+='<option value="Diyarbakır">Diyarbakır</option>';
	text+='<option value="Düzce">Düzce</option>';
	text+='<option value="Edirne">Edirne</option>';
	text+='<option value="Elazığ">Elazığ</option>';
	text+='<option value="Erzincan">Erzincan</option>';
	text+='<option value="Erzurum">Erzurum</option>';
	text+='<option value="Eskişehir">Eskişehir</option>';
	text+='<option value="Gaziantep">Gaziantep</option>';
	text+='<option value="Giresun">Giresun</option>';
	text+='<option value="Gumuşhane">Gumuşhane</option>';
	text+='<option value="Hakkari">Hakkari</option>';
	text+='<option value="Hatay">Hatay</option>';
	text+='<option value="Iğdır">Iğdır</option>';
	text+='<option value="Isparta">Isparta</option>';
	text+='<option value="İçel">İçel</option>';
	text+='<option value="İstanbul-Anadolu">İstanbul-Anadolu</option>';
	text+='<option value="İstanbul-Avrupa">İstanbul-Avrupa</option>';
	text+='<option value="İzmir">İzmir</option>';
	text+='<option value="Kahramanmaraş">Kahramanmaraş</option>';
	text+='<option value="Karabük">Karabük</option>';
	text+='<option value="Karaman">Karaman</option>';
	text+='<option value="Kars">Kars</option>';
	text+='<option value="Kastamonu">Kastamonu</option>';
	text+='<option value="Kayseri">Kayseri</option>';
	text+='<option value="Kırıkkale">Kırıkkale</option>';
	text+='<option value="Kırklareli">Kırklareli</option>';
	text+='<option value="Kırşehir">Kırşehir</option>';
	text+='<option value="Kilis">Kilis</option>';
	text+='<option value="Kocaeli">Kocaeli</option>';
	text+='<option value="Konya">Konya</option>';
	text+='<option value="Kütahya">Kütahya</option>';
	text+='<option value="Malatya">Malatya</option>';
	text+='<option value="Manisa">Manisa</option>';
	text+='<option value="Mardin">Mardin</option>';
	text+='<option value="Muğla">Muğla</option>';
	text+='<option value="Muş">Muş</option>';
	text+='<option value="Nevşehir">Nevşehir</option>';
	text+='<option value="Niğde">Niğde</option>';
	text+='<option value="Ordu">Ordu</option>';
	text+='<option value="Osmaniye">Osmaniye</option>';
	text+='<option value="Rize">Rize</option>';
	text+='<option value="Sakarya">Sakarya</option>';
	text+='<option value="Samsun">Samsun</option>';
	text+='<option value="Siirt">Siirt</option>';
	text+='<option value="Sinop">Sinop</option>';
	text+='<option value="Sivas">Sivas</option>';
	text+='<option value="Şanlıurfa">Şanlıurfa</option>';
	text+='<option value="Şırnak">Şırnak</option>';
	text+='<option value="Tekirdağ">Tekirdağ</option>';
	text+='<option value="Tokat">Tokat</option>';
	text+='<option value="Trabzon">Trabzon</option>';
	text+='<option value="Tunceli">Tunceli</option>';
	text+='<option value="Uşak">Uşak</option>';
	text+='<option value="Van">Van</option>';
	text+='<option value="Yalova">Yalova</option>';
	text+='<option value="Yozgat">Yozgat</option>';
	text+='<option value="Zonguldak">Zonguldak</option>';
	text+='<option value="Yurt Dışı">Yurt Dışı</option>';
	text+='</select>';
	text+='</td>';
	text+='</tr>';
	text+='<tr>';
	text+='<td colspan="2" align="center"><button type="submit" class="submit_but" style="width:150px;">kayıt işlemlerini başlat</button></td>';
	text+='</tr>';
	text+='</table>';
	text+='</form>';
	text+='</div>';
	document.getElementById('cloud').innerHTML=text;
}

function createQuery(form){
    var elements = form.elements;
    var pairs = new Array();
    for (var i = 0; i < elements.length; i++) {
        if ((name = elements[i].name) && (value = elements[i].value))
            pairs.push(name + "=" + encodeURIComponent(value));
    }
	return pairs.join("&");
}
