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

$(function(){
	$("a[rel=lightbox]").lightBox({
		overlayBgColor: '#000000',
		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: 'Resim',
		txtOf: '/'
	});
	
	jqueryslidemenu.buildmenu("ustSlideMenu");
	
	$("#ustSlideMenu ul li").each(function(){
		if($("ul", this).length > 0){
			$("a", this).eq(0).click(function(){
				return false;
			});
		}
	})
		
	$("#icerikSol li").each(function(){
		if($("ul", this).length > 0){
			$("a", this).eq(0).click(function(){
				$("ul:eq(0)", $(this).parent()).slideToggle();
				
				return false;
			}).dblclick(function(){
				window.location.href = $(this).attr("href");
			});
		}
	});
	$("#icerikSol a.selected").parents("ul").css("display", "block");
	
	$("#solMenu td[rel=menu]").click(function(){
		var display = $(this).parent().next().find("td div").css("display");
		$("#solMenu td[rel=menu]").parent().next().find("td div").slideUp();
		
		if(display == "none"){
			$(this).parent().next().find("td div").slideDown();
		}
	});
	
	$("#solMenu a.active").css("font-weight", "bold").parents("div:eq(0)").css("display", "block");
	
	$('#slide').cycle({
		fx:		'fade',
		speed:	1000,
		timeout:5000,
		pager:	'#slideNav',
		 
		pagerAnchorBuilder: function(idx, slide) {
			return '<tr><td height="30" background="images/banner_dot2.png" style="background-position:bottom; background-repeat:no-repeat;"><span class="style12"><a href="#">'+ $(".slidetext", slide).html() +'</a></span></td></tr>'; 
		} 
	});
    
    $("#slideHaber").cycle({
        fx: "scrollUp",
        speed: 6000,
        easing: "linear",
        continuous:1,
        pause:1
    });
	
	$(".sssBaslik").click(function(){
		var sid = $(this).attr("sid");
		$("div[sid="+ sid +"]").slideToggle();
	});
});

function secAll(me){
	var val = $(me).attr("checked");
	var grup = $(me).attr("grup");
	$("input[grup="+ grup +"]").attr("checked", val);
}

function ajaxDiyalog(adres, options, ajaxOptions){
	$('.dialog-content').css("overflow-x", null).css("overflow-y", null);
	$.weeboxs.open('LÃ¼tfen Bekleyiniz...',{
		title: 'LÃ¼tfen Bekleyiniz...'
	});
	
	if(ajaxOptions){
		if(ajaxOptions.method == "post"){
			$.post(adres, ajaxOptions, function(data){
				$.weeboxs.close();
				$.weeboxs.open(data, options);
			});
		}else{
			$.get(adres, ajaxOptions, function(data){
				$.weeboxs.close();
				$.weeboxs.open(data, options);
			});
		}
	}else{
		$.get(adres, function(data){
			$.weeboxs.close();
			$.weeboxs.open(data, options);
		});
	}
}

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");
}
