var emailFiltre=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
function hataTemizle() 
{
	return true;
}
window.onerror = hataTemizle;
function sssCevapGoster(id)
{
	
	if ($("#divTitle"+id+"").attr('class')=='faqStyle1')
	{
		$("#divTitle"+id+"").attr('class','faqStyle');
	}
	else
	{
		$("#divTitle"+id+"").attr('class','faqStyle1');
	}
	
	$("#divCevap"+id+"").slideToggle("slow");

}
function arkaPlanRengiDegistir(renk,obj)
{
	$('#'+obj+'').css("background-color",""+renk+"");
}
function setPiroBox()
{
	$('.piro_overlay,.pirobox_content').remove();
	jQuery().piroBox({
			my_speed: 600, 
			bg_alpha: 0.5,
			radius: 4, 
			scrollImage : false, 
			pirobox_next : 'piro_next',
			pirobox_prev : 'piro_prev',
			close_all : '.piro_close',
			slideShow : 'slideshow', 
			slideSpeed : 4 
	});	
}
function saat()
{	
	var d = new Date();
	var saat=("00"+d.getHours()).substr(("00"+d.getHours()).length-2,2);
	var dakika=("00"+d.getMinutes()).substr(("00"+d.getMinutes()).length-2,2);
	var saniye=("00"+d.getSeconds()).substr(("00"+d.getSeconds()).length-2,2);

	$('#saat').html(saat+":"+dakika+":"+saniye);
	tmrSaat=setTimeout("saat()",1000);
}
function yaziBoyutu(alan,buyuk)
{
	var boyutPx=""+$('#'+alan).css('fontSize')+"";
	var lhPx=""+$('#'+alan).css('lineHeight')+"";
	var boyut=boyutPx.split("px");
	var lh=lhPx.split("px");
	boyut[0]=boyut[0]*1;
	lh[0]=lh[0]*1;
	if (buyuk==true)
	{
		if (boyut[0]<20)
		{
			boyut[0]=boyut[0]+1;
			lh[0]=lh[0]+1;
		}
	}
	else
	{
		if (boyut[0]>10)
		{
			boyut[0]=boyut[0]-1;
			lh[0]=lh[0]-1;
		}
	}
	$("#"+alan).css("font-size",boyut[0]+"px");
	$("#"+alan).css("line-height",lh[0]+"px");
}
function post(postParam,btnName)
{
	$("#"+btnName).attr("disabled","disabled");
	$.post("_post/_post.php", postParam, function(){$("#"+btnName).attr("disabled","");}, "script");	
}
String.prototype.buyukHarf=function() 
{

	var str = [];
	for(var i = 0; i < this.length; i++) {
	var ch = this.charCodeAt(i);
	var c = this.charAt(i);
	if(ch == 105) str.push('İ');
	else if(ch == 305) str.push('I');
	else if(ch == 287) str.push('Ğ');
	else if(ch == 252) str.push('Ü');
	else if(ch == 351) str.push('Ş');
	else if(ch == 246) str.push('Ö');
	else if(ch == 231) str.push('Ç');
	else if(ch >= 97 && ch <= 122) str.push(c.toUpperCase());
	else str.push(c);
	}
	return str.join('');
}

function postSil(sayfa,islem,btnName,params)
{
	var sonuc=confirm("Silme işlemini onaylıyormusunuz?");
	if (sonuc==true)
	{
		$("#"+btnName).attr("disabled","disabled");
		$.post("_post/_post.php?rnd="+Math.random()+params, {sayfa:sayfa,islem:islem}, function(){$("#"+btnName).attr("disabled","");}, "script");		
	}
}
function getData(sayfa,content,param)
{
	$.get("_get/_get"+sayfa+".php?rnd="+Math.random()+param, function(data){$('#'+content+'').html(data);});
}
function yarisFotoUpload(url,fType,fDesc,maxSize,uploadLimit,txtHataMsg,txtYuklendi,txtYukleniyor,txtIptal,txtBeklemede,txtOrgDosya,bgImg,yarisId)
{
	var i=0;
	$(function(){
		$('#swfupload-control4').swfupload({
			upload_url: url,
			file_post_name: 'uploadfile',
			file_size_limit : maxSize,
			file_types : fType,
			file_types_description : fDesc,
			file_upload_limit : uploadLimit,
			flash_url : "_js/_module/swfupload/swfupload.swf",
			button_image_url : '_js/_module/swfupload/'+bgImg,
			button_width : 114,
			button_height : 29,
			button_placeholder : $('#button')[0],
			debug: false
		})
			.bind('fileQueued', function(event, file){
				var listitem='<li id="'+file.id+'" >'+
					txtOrgDosya + ': <em>'+file.name+'</em> ('+Math.round(file.size/1024)+' KB) <span class="progressvalue" ></span>'+
					'<div class="progressbar" ><div class="progress" ></div></div>'+
					'<p class="status" >' + txtBeklemede +'</p>'+
					'<span class="cancel" ></span>'+
					'<span class="cancelText" ><!--<div align="right" style=" cursor:pointer; color:red;">' + txtIptal + '</div>--></span></li>';
				$('#log4').append(listitem);
				$('li#'+file.id+' .cancel').bind('click', function(){
					var swfu = $.swfupload.getInstance('#swfupload-control4');
					swfu.cancelUpload(file.id);
					$('li#'+file.id).slideUp('fast');
				});
				
				$(this).swfupload('startUpload');
			})
			.bind('fileQueueError', function(event, file, errorCode, message){
											
				alert(txtHataMsg);
										
			})
		
			.bind('uploadStart', function(event, file){
				$('#log4 li#'+file.id).find('p.status').text(txtYukleniyor);
				$('#log4 li#'+file.id).find('span.progressvalue').text('0%');
				$('#log4 li#'+file.id).find('span.cancel').hide();
				
			})
			.bind('uploadProgress', function(event, file, bytesLoaded){
				var percentage=Math.round((bytesLoaded/file.size)*100);
				$('#log4 li#'+file.id).find('div.progress').css('width', percentage+'%');
				$('#log4 li#'+file.id).find('span.progressvalue').text(percentage+'%');
				
			})
			.bind('uploadSuccess', function(event, file, serverData){
				var item=$('#log4 li#'+file.id);
				item.find('div.progress').css('width', '100%');
				item.find('span.progressvalue').text('100%');
				
				
				var pathtofile='';
				item.addClass('success').find('p.status').html(txtYuklendi + '<br> '+pathtofile);
			})
			.bind('uploadComplete', function(event, file){
				$(this).swfupload('startUpload');
				getData("YarisFoto","fotoContent","&yarisId="+yarisId);

			})
		
	});	

}
function enterPost(e,postParam,btnName)
{
	var Ucode=e.keyCode? e.keyCode : e.charCode
	if (Ucode == 13)
	{
	  	$("#"+btnName).attr("disabled","disabled");
		$.post("_post/_post.php", postParam, function(){$("#"+btnName).attr("disabled","");}, "script");
	}
}


