// NewCMS created by Şevket Bulamaz - 2009

$(document).ready(function(){
	var msie6 = false;
	if(jQuery.browser.msie == true && jQuery.browser.version == "6.0"){
		msie6 = true;
	}
	
	$('.tBtn').click(function(){
		var Cont = $(this).attr('rel');
		if($('#tDiv'+Cont).css('display') == 'none'){
			$('.tDiv').css('display','none');
			var Cont2 = "";
			$('.tBtn').each(function(){
			Cont2 = $(this).attr('rel');
				$(this).css('background-image','url(./images/sub/uM'+Cont2+'_1.jpg)');	
			});
			$(this).css('background-image','url(./images/sub/uM'+Cont+'_2.jpg)');
			$('#tDiv'+Cont).css('display','block');
		}
	});
});

$(function() {
		$('.planBtn').each(function(){
		
			$(this).attr("title",$(".tBtn:first").html());
		
		});
		$('.planBtn').lightBox();
});

function jAlert(veri){
	var msg="";
	var ekleme = 0;
	
	if($("#jAlert").css("display") == "block"){
		ekleme = 1;
	}
	veri = veri.replace(/</g, "&lt;").replace(/>/g, "&gt;");
	if(ekleme == 0){
		msg += "<div id='jAlert' style='border:2px solid #fff;'>";
		msg += "<h3 style='font-size:22px; text-align:center; font-weight:bold; color:#ff0000; padding-left:20px;'><span style='float:left;'>Uyarı</span><input type='button' value='X' onclick='$(\"#jAlert\").remove();' class='jInput' style='float:right;' /></h3>";
		msg += "<p id='veri' style='padding:10px; font-size:12px; font-family:Arial, Helvatica; clear:both;'>" + veri + "</p>";
		msg += "<p align='right' style='padding:10px 10px 10px 0px;'></p>";
		msg += "</div>";
		$('body').append(msg);
		var hgt = $("#jAlert").height() / 2;
		$("#jAlert").css("margin-top","-" + hgt + "px");
	}else if(ekleme == 1){
		$("#veri").append("<br />" + veri);
		var hgt = $("#jAlert").height() / 2;
		$("#jAlert").css("margin-top","-" + hgt + "px");
	}else{
		
	}
}

function pngFixle(gelen){
		asilSrc = document.getElementById(gelen).getAttribute('src');
		var control = asilSrc.substring(asilSrc.length-3,asilSrc.length);
		if(control == "gif"){
			asilSrc = document.getElementById(gelen).getAttribute('rel');
		}
		document.getElementById(gelen).setAttribute('rel',asilSrc);
		document.getElementById(gelen).setAttribute('src','images/main/blank.gif');
		gelenCss = document.getElementById(gelen).style.cssText;
		document.getElementById(gelen).style.cssText = "filter: progid:DXImageTransform.Microsoft.AlphaImageLoader (src='"+ asilSrc +"'); " + gelenCss;
}