function seekTo(page) {
	var api = $("#promo #browsable").data("scrollable");
    api.seekTo(page);
}


function loadView(page)
	{
		$("#MainContent").load(page);
	}


$(document).ready(function(){
			var pagestr=((window.location.href.split("/"))[3]).split("?")[0];
					   
			if(pagestr == "koleksiyon") 
				{
				seekToPage=1
				}
			else if	(pagestr == "haberler")
				{
				seekToPage=2
				}
			else if	(pagestr == "ulasim")
				{
				seekToPage=3
				}
			else if	(pagestr == "iletisim")
				{
				seekToPage=4
				}
			else
				{
				seekToPage=0
				}

    function formatTitle(title, currentArray, currentIndex, currentOpts) {
        return '<div id="tip7-title">' + (title && title.length ? '<b>' + title + '</b>&nbsp;&nbsp;&nbsp;&nbsp; ' : '' ) + ' ' + (currentIndex + 1) + '/' + currentArray.length +'<br />' + currentOpts.detail+ '</div>';    }


    $(".collection").click(function() {
        var rel = $(this).attr('rel');
        $.fancybox(collections['s'+rel], {
            'padding'			: 3,
            'transitionIn'		: 'none',
            'transitionOut'		: 'none',
            'type'              : 'image',
            'titleFormat'		: formatTitle,
            'titlePosition'     : 'inside',
            'changeFade'        : 0
        });
    });

    $(".fajax").fancybox({
        'width'				: 500,
        'height'			: 400,
        'autoScale'     	: false,
        'transitionIn'		: 'none',
        'transitionOut'		: 'none',
        'type'				: 'iframe'
    });


    $("#promo #browsable").scrollable().navigator();
    var api = $("#promo #browsable").data("scrollable").seekTo(seekToPage);

});
