var VTP_Dizi = new Array(), MES_Dizi = new Array();
function VTP (_kod, _ad){
	this.Kod = (_kod)?_kod:0;
	this.Ad  = (_ad)?_ad:"Ad Yok";
}
function MES (_kod, _ad, _vtp){
	this.Kod = (_kod)?_kod:0;
	this.Ad  = (_ad)?_ad:"Ad Yok";
	this.vtp = (_vtp)?_vtp:0;
}
function AddVTP (_kod, _ad){
	VTP_Dizi [VTP_Dizi.length] = new VTP (_kod, _ad);
}
function AddMES (_kod, _ad, _vtp){
	MES_Dizi [MES_Dizi.length] = new MES (_kod, _ad, _vtp);
}
AddMES (0, 'Meslek Seçiniz..', 0);
function FillVTP (_select) {
	_select.options.length = 0;
	var temp;
	for (i=0; (i<VTP_Dizi.length) && (typeof((temp=VTP_Dizi[i]))!="undefined");  i++) {
			_select.options[ _select.options.length ] = new Option(temp.Ad, temp.Kod);
			_select.options[ _select.options.length - 1 ].selected = (temp.Kod == 0);
	}
}
function FillMES (_select) {
	var tempSel = document.getElementById ('drpMES');
	var selKod = _select.options[_select.selectedIndex].value ;
	tempSel.options.length = 0;
	var temp;
	for (i=0;(i<MES_Dizi.length) && (typeof((temp=MES_Dizi[i]))!="undefined");i++ )
		if (temp.Kod == 0 || temp.vtp == selKod)
			tempSel.options[ tempSel.options.length ] = new Option(temp.Ad, temp.Kod);
	tempSel.selectedIndex = 0;
}
function ShowVTP (VTP, MES, ULK){
	var drpVTP = document.getElementById(VTP);
	VTP = drpVTP.options[drpVTP.selectedIndex].value;
	if (VTP == '0')
		return HataVar('Lütfen vize tipi seçiniz...');
	var drpMES = document.getElementById(MES);
	MES = drpMES.options[drpMES.selectedIndex].value;
	if (drpMES.options.length > 1)
		if (MES=='0')
			return HataVar('Lütfen meslek tipi seçiniz...');
	document.getElementById('ifVTP').src= 'vizetipi.aspx?VTP=' + VTP + '&MES=' + MES + '&ID=' + ULK;
	var divVTP = document.getElementById('divVTP');
	divVTP.style.visibility = "visible";
	divVTP.style.display = "";
}
function HideVTP () {
	var divVTP = document.getElementById('divVTP');
	divVTP.style.visibility = "hidden";
	divVTP.style.display = "none";
}
function tarih() {
var gun=new Date();
var gunler=new Array("Pazar","Pazartesi","Salı","Çarsamba", "Persembe","Cuma","Cumartesi");
var aylar=new Array("Ocak","Subat","Mart","Nisan","Mayis","Haziran", "Temmuz","Agustos","Eylül","Ekim","Kasim","Aralik");
return gun.getDate()+' '+aylar[gun.getMonth()]+' '+gun.getYear()+' '+gunler[gun.getDay()];
}

function zaman() {
var saat=new Date();
var durum=new Array(" Günaydın !"," İyi Günler !"," İyi Akşamlar !", " İyi Geceler !");
if (saat.getHours()>=6 && saat.getHours()<10)
	return durum[0];
if (saat.getHours()>=10 && saat.getHours()<17)
	return durum[1];
if (saat.getHours()>=17 && saat.getHours()<22)
	return durum[2];
if ((saat.getHours()>=22)||(saat.getHours()<6))
	return durum[3];
}
function openPas(_sender){
	try {
	var XY = GetCoor(_sender);
	XY.Y = XY.Y + _sender.offsetHeight;
	with(document.getElementById('pasara').style) {
		left = XY.X + 'px';
		top  = XY.Y + 'px';
		display='block';
		visibility='visible';
	}
	}catch(Hata){alert (Hata.description);}
}
function Coor(X, Y) {this.X = (X)?X:0;this.Y = (Y)?Y:0;this.ToString=function (){return "X : " + this.X + " , Y : " + this.Y;}}
function GetCoor (obj) {
	if (typeof(obj)=="string")
		obj = document.getElementById(obj);
	if (!obj) return (new Coor(0, 0));
	try {
		var Left=obj.offsetLeft, Top=obj.offsetTop;
		var Parent = obj.offsetParent;
		while (Parent != null){
			Left += Parent.offsetLeft;
			Top  += Parent.offsetTop ;
			Parent = Parent.offsetParent;
		}
	}
	catch(Hata) {return (new Coor(0, 0));}
	return (new Coor(Left, Top));
}
function PasKontrol(Prefix){
	if ( BoslukBuda(Prefix + '_txtPas').length < 3 )
		return HataVar('Lütfen pasaport numarası giriniz...');
	return true;
}
var Durum = new Array();
Durum[0] = "Beklemede";
Durum[1] = "Durum 1";
Durum[2] = "Durum 2";
Durum[3] = "Durum 3";
function getDurum(_id){
	document.write(Durum[_id]?Durum[_id]:"");
}