var evt=function(){};

evt.prototype = {
	Yer:'sahne',
	Yukleniyor:function(yer){
		var yukle = (yer=="") ? Olay.Yer : yer;
		$("#"+yukle).html("<div class='loading'><center><br><img src='images/loading.gif'><br>Yükleniyor..<br></center></div>");	
	},
	ZIndex:function(){
		var d = new Date();
		return Math.round(d.getTime()/1000);
	},	
	is_object:function(mixed_var){
		if (mixed_var instanceof Array) {
			return false;
		} else {
			return (mixed_var !== null) && (typeof( mixed_var ) == 'object');
		}
	},
	Eleman:function(elm){
		return (this.is_object(elm)) ? $(elm).attr("id") : elm;
	},
	Uyar:function(elm,msg){

		var el = '#'+this.Eleman(elm);
		
		$(el).css('border','1px solid #E0011B')
			 .css('background-color','#FBE3E4');
		if (msg!=""){
			$(el).focus();
			$(el).select();
			alert(msg);
		}
	},
	UyarTekSil:function(elm){
		var el = '#'+this.Eleman(elm);
		$(el).css('border','1px solid #A4A4A4')
			 .css('background-color','#FBFBFB');	
	},
	UyarSil:function(frm){
		var el = '#'+this.Eleman(frm);
		//alert(frm+' - '+el);
		$(el).find('input, select, checkbox, textarea').each(function(){
			if (this.id!=""){
				Olay.UyarTekSil(this.id);
			}
		});		
	},
	FrmTemizle:function(frm){
		if (confirm("Formu Temizlemek İstediğinizden Emin Misiniz?")){
			var el 	= '#'+this.Eleman(frm);
			var tip = "";
			//alert(frm+' - '+el);
			$(el).find('input, select, checkbox, textarea').each(function(){
				tip	= this.type;
				if (tip=="checkbox"){
					$(this).removeAttr('checked');
				}else{
					$(this).val("");
				}
			});		
		}
	},
	Trim:function(str){
		return str.replace(/^\s+|\s+$/g,"");
	},
	in_array:function(needle, haystack, strict){
		var found = false, key, strict = !!strict; 
		for (key in haystack) {
			if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {
				found = true;
				break;
			}
		}
		return found;		
	},
	implode:function(ayrac, deger){
		return deger.join(ayrac);
	},
	explode:function(ayrac,deger){
		return deger.split(ayrac);
	}	
}

var Olay = new evt;
