var animate = true;

$(function(){
	var arVersion = navigator.appVersion.split("MSIE")
	var version = parseFloat(arVersion[1])
	if ((version >= 5.5) && (document.body.filters)) 
	{
	  for(var i=0; i<document.images.length; i++)
	  {
		 var img = document.images[i]
		 var imgName = img.src.toUpperCase()
		 if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
		 {
			var imgID = (img.id) ? "id='" + img.id + "' " : ""
			var imgClass = (img.className) ? "class='" + img.className + "' " : ""
			var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
			var imgStyle = "display:inline-block;" + img.style.cssText 
			if (img.align == "left") imgStyle = "float:left;" + imgStyle
			if (img.align == "right") imgStyle = "float:right;" + imgStyle
			if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
			var strNewHTML = "<span " + imgID + imgClass + imgTitle
			+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
			+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
			+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
			img.outerHTML = strNewHTML
			i = i-1
		 }
	  }
	}
	
	$("#solMenu", "tr").each(function(){
		$("td", this).each(function(){
			if($(this).attr("class") != "noEffect"){
				$(this).hover(
					function(){
						if(animate == true){
							animate = false;
							$(this).animate({backgroundColor:"#555354"}, 200, function(){
								animate = true;
							}).find("a").animate({color:"#DBD9DA"}, 150);
						}
					},
					function(){
						animate = true;
						$(this).animate({backgroundColor:"#DBD9DA"}, 50).find("a").animate({color:"#3D3D3D"}, 20);
					}
				);
			}
		});
	});
});

function sayfaDegis(adres){
	window.location.href = adres;
}

function galeriYap(str){
	$(str).lightBox({
		overlayBgColor: '#000',
		overlayOpacity: 0.7,
		imageLoading: 'JS/jQuery/lightbox/images/lightbox-ico-loading.gif',
		imageBtnClose: 'JS/jQuery/lightbox/images/lightbox-btn-close.gif',
		imageBtnPrev: 'JS/jQuery/lightbox/images/lightbox-btn-prev.gif',
		imageBtnNext: 'JS/jQuery/lightbox/images/lightbox-btn-next.gif',
		containerResizeSpeed: 350 /*,
		txtImage: 'Imagem',
		txtOf: 'de'*/
	});
}

function secAll(me){
	var val = $(me).attr("checked");
	$("input[sec=1]").each(function(){
		$(this).attr("checked", val);
	});
}

function ajaxDiyalog(baslik, adres){
	$('.dialog-content').css("overflow-x", null).css("overflow-y", null);
	$.weeboxs.open('Lütfen Bekleyiniz...',{
		title: 'Lütfen Bekleyiniz...'
	});
	
	$.get(adres, function(data){
		$.weeboxs.close();
		$.weeboxs.open(data,{
			title: baslik,
			width:600,
			height: 500
		});
	});
}
function frameDiyalog(baslik, adres){
	$.weeboxs.open('<iframe width="600" height="500" style="border:0; margin:0px 0px 0px 0px; padding:0px 0px 0px 0px;" scrolling="auto" src="'+ adres +'">',{
		title: baslik,
		width:606
	});
	$('.dialog-content').css("overflow-x", "hidden").css("overflow-y", "hidden");
}
