/*
01. ACCORDION MENU & AUTO CLASSIFIED CURRENT PAGE LINK
    <div class="accordion">
        <h4 class="accordion-header"><a href="">Trigger link</a></h4>
        <ul class="accordion-content">
        <li><a href="">lorem ipsum</a></li>
        <li>lorem ipsum</li>
        </ul>
    </div>
    &
    <div class="accordion">
        <h4 class="accordion-header"></h4>
        <div class="accordion-content">
            ...
        </div>
    </div>
02. NEWS SLIDER 
    <ul class="marquee">
    <li><a href=""></a></li>
    </ul>
03. BROWSER BASE CLASSIFIED
04. CLASSIFIED FORM ELEMENTS FOR IE6&IE7
05. FLASH and NEW ICONS
06. CLASSIFIED FILE TYPES
07. FORM VALIDATOR
08. AUTOMATICALLY ADD TABLE ROW COUNT
    <table class="auto-number">
    </table>
09. PRINT PAGE
    <a class="print" href="#print">Sayfayı Yazdır!</a>
10. CAPTCHA REFRESH
11. EASY SLIDER
    <div class="slider">
        <ul>
        <li></li>
        </ul>
    </div>
12. COLORBOX
    <a class="" href="" rel="{GROUPNAME}"></a>
13. FONT REPLACEMENT
14. ADD TO FAVORITES
15. SET HOMEPAGE
==================================================================================================== */

<!--//
$(function(){

	/* 01. ACCORDION MENU & AUTO CLASSIFIED CURRENT PAGE LINK--------------------------------------- */
	var bodyid=$('body').attr('id');
	$('#top-nav li[class="' + bodyid + '"]').addClass('current-page');
	$('#side-nav li[class="' + bodyid + '"]').addClass('current-page');
	$('#side-nav ul:has(".current-page")').slideDown('fast').prev('h4').addClass('active');
	$(".accordion .accordion-header").click(function(){
		$(this).next(".accordion-content").slideToggle("fast")
		.siblings(".accordion-content:visible").slideUp("fast");
		$(this).toggleClass("active");
		$(this).siblings(".accordion-header").removeClass("active");
		return false;
	});

	/* 02. NEWS SLIDER ----------------------------------------------------------------------------- */
	$('.marquee').wrap('<marquee direction="up" scrollamount="2" onmouseover="this.stop()" onmouseout="this.start()">' + '<\/marquee>');

	/* 03. BROWSER BASE CLASSIFIED ------------------------------------------------------------------ */
	if($.browser.msie){if($.browser.version=='8.0'){$('body').addClass('ie8');}else if($.browser.version=='7.0'){$('body').addClass('ie7');}else{$('body').addClass('ie6');}}
	if($.browser.safari){if(navigator.userAgent.indexOf('Safari') != -1){$('body').addClass('safari');}else{$('body').addClass('chrome');}}
	if($.browser.mozilla){$('body').addClass('ff3');}
	if($.browser.opera){$('body').addClass('opera');}
	//if(navigator.userAgent.indexOf('Windows') != -1){$('body').addClass('windows');}
	//else if(navigator.userAgent.indexOf('Mac') != -1){$('body').addClass('mac');}

	/* 04. CLASSIFIED FORM ELEMENTS FOR IE6&IE7 ---------------------------------------------------- */
	if($.browser.msie&&$.browser.version<8) {
		$('button[type=reset]')  .addClass('button-reset');
		$('button[type=submit]') .addClass('button-submit');
		$('input[type=button]')  .addClass('input-button');
		$('input[type=checkbox]').addClass('input-checkbox');
		$('input[type=file]')    .addClass('input-file');
		$('input[type=image]')   .addClass('input-image');
		$('input[type=password]').addClass('input-password');
		$('input[type=radio]')   .addClass('input-radio');
		$('input[type=reset]')   .addClass('input-reset');
		$('input[type=submit]')  .addClass('input-submit');
		$('input[type=text]')    .addClass('input-text');
		$('input[type=password],input[type=text],select,textarea').focus(function(){$(this).addClass('focus');});
		$('input[type=password],input[type=text],select,textarea').blur(function(){if($(this).find('.focus')){$(this).removeClass('focus');}});
	};

	// 05. FLASH and NEW ICONS --------------------------------------------------------------------- */
	$('.flash a').prepend('<img class="icon-flash" src="/theme/img/1px.gif" />');
	$('.icon-flash').attr('title','Flash');
	$('.new a').prepend('<img class="icon-new" src="/theme/img/1px.gif" />');
	$('.tr .icon-new').attr('title','Yeni');
	$('.en .icon-new').attr('title','New');
	$('.de .icon-new').attr('title','Neu');
	$('.cn .icon-new').attr('title','New');

	/* 06. CLASSIFIED FILE TYPES ------------------------------------------------------------------- */
	// document
	$('a[href$=".doc"],a[href$=".rtf"]').addClass('doc');
	$('a[href$=".pdf"]').addClass('pdf');
	$('a[href$=".ppt"]').addClass('ppt');
	$('a[href$=".csv"],a[href$=".xls"],a[href$=".xlt"]').addClass('xls');
	// image
	//$('a[href$=".gif"]').addClass('img');
	//$('a[href$=".jpg"]').addClass('img');
	//$('a[href$=".png"]').addClass('img');
	// audio
	$('a[href$=".au"],a[href$=".mid"],a[href$=".mp3"],a[href$=".wma"]').addClass('mid');
	// movie
	$('a[href$=".avi"],a[href$=".flv"],a[href$=".mov"],a[href$=".mpg"],a[href$=".wmv"]').addClass('mov');
	// zip
	$('a[href$=".gzip"],a[href$=".rar"],a[href$=".zip"]') .addClass('zip');
	// external link
	//$('a[href^="http://"]').addClass('external');
	//$('a[href^="http://www.asb.com.tr"]').removeClass('external');
	//$('a[href^="http://www.asbctaslak.com"]').removeClass('external');
	//$('a[href^="http://www.osmanyazici.com"]').removeClass('external');
	// e-mail
	$('a[href^="mailto:"]').addClass('mail');

	/* 07. FORM VALIDATOR -------------------------------------------------------------------------- */
	$('#newsletter-register-form').validate({errorElement:'small'});
	$('#contact-form').validate({errorElement:'small'});

	/* 08. AUTOMATICALLY ADD TABLE ROW COUNT | <table class="auto-number"></table> ----------------- */
	$('table').each(function(){if($(this).is('.auto-number')){$('thead th:first-child,thead td:first-child',this).each(function(){if($(this).is('td')) $(this).before('<td class="numeric">#<\/td>');else if($(this).is('th')) $(this).before('<th class="numeric">#<\/th>');});$('tbody td:first-child',this).each(function(i){$(this).before('<td class="numeric">'+(i+1)+'<\/td>');});}});

	/* 09. PRINT PAGE ------------------------------------------------------------------------------ */
	$('a.print').click(function() { window.print(); return false; });


});


/* 10. CAPTCHA REFRESH ----------------------------------------------------------------------------- */
/*
@version:1.0 @url:http://andreaslagerkvist.com/jquery/captcha-refresh/ @license: http://creativecommons.org/licenses/by/3.0/ @copyright:2008 Andreas Lagerkvist (andreaslagerkvist.com)
@exampleHTML: <img src="/aFramework/Utils/Captcha.php" alt="" />
@exampleJS: jQuery('#jquery-captcha-refresh-example').captchaRefresh({src: '/aFramework/Utils/Captcha.php'});
*/
jQuery.fn.captchaRefresh = function (conf) { var config = jQuery.extend({src:'/captcha.png',title:'Kodu hatalı yazdıysanız, yenilemek için tıklayınız!'}, conf); return this.each(function (x) { jQuery('img[src^="' + config.src + '"]', this).attr('title', config.title); jQuery(this).click(function (event) { var clicked = jQuery(event.target); if (clicked.attr('src') && clicked.attr('src').indexOf(config.src) === 0) { var now = new Date(); var separator = config.src.indexOf('?') == -1 ? '?' : '&'; clicked.attr('src', config.src + separator + now.getTime()); } }); }); };
jQuery('#captcha-refresh').captchaRefresh({src: '/aspcaptcha.asp'});

/* 11. EASY SLIDER 1.8 (modified by Kyle Florence)-------------------------------------------------- */
/*     http://cssglobe.com/post/5780/easy-slider-17-numeric-navigation-jquery-slider - http://archive.kflorence.com/projects/easySlider/ */
(function($){$.fn.easySlider=function(options){var defaults={prevId:'prevBtn',prevText:'Previous',nextId:'nextBtn',nextText:'Next',controlsShow:true,controlsBefore:'',controlsAfter:'',controlsFade:true,insertAfter:true,firstId:'firstBtn',firstText:'First',firstShow:false,lastId:'lastBtn',lastText:'Last',lastShow:false,vertical:false,speed:800,ease:'swing',auto:false,pause:3000,continuous:false,prevNext:true,numeric:false,numericId:'controls'};var options=$.extend(defaults, options);this.each(function(){var obj=$(this);var ul=obj.children("ul");var li=ul.children("li");var s=li.length;var w=obj.width();var h=obj.height();var t=0;var ts=s-1;var clickable=true;obj.css("overflow","hidden");li.each(function(){if(options.vertical) $(this).height(h);else $(this).width(w);});li.css('float','left');if(options.vertical) ul.height(s*w);else ul.width(s*h);if(options.continuous){if(options.vertical){ul.prepend(li.filter(":last-child").clone().css("margin-top","-"+ h +"px"));ul.append(li.filter(":nth-child(2)").clone());ul.height((s+1)*h);}else{ul.prepend(li.filter(":last-child").clone().css("margin-left","-"+ w +"px"));ul.append(li.filter(":nth-child(2)").clone());ul.width((s+1)*w);}};if(options.controlsShow){var html=options.controlsBefore;if(options.numeric){html += '<ol id="'+ options.numericId +'"></ol>';}if(options.firstShow){html += '<span id="'+ options.firstId +'"><a href="#">'+ options.firstText +'</a></span>';}if(options.prevNext){html += '<span id="'+ options.prevId +'"><a href="#">'+ options.prevText +'</a></span>';html += '<span id="'+ options.nextId +'"><a href="#">'+ options.nextText +'</a></span>';}if(options.lastShow){html += '<span id="'+ options.lastId +'"><a href="#">'+ options.lastText +'</a></span>';}html += options.controlsAfter;if(options.insertAfter) $(obj).after(html);else $(obj).before(html);};if(options.numeric){for(var i=0;i<s;i++){$(document.createElement("li")).attr('id',options.numericId + (i+1)).html('<a rel="'+ i +'" href="#"><span>'+ (i+1) +'</span></a>').appendTo($("#"+ options.numericId)).click(function(){animate($("a",$(this)).attr('rel'),true);return false;});};}if(options.prevNext){$("a","#"+options.nextId).click(function(){animate("next",true);return false;});$("a","#"+options.prevId).click(function(){animate("prev",true);return false;});$("a","#"+options.firstId).click(function(){animate("first",true);return false;});$("a","#"+options.lastId).click(function(){animate("last",true);return false;});};function setCurrent(i){i=parseInt(i)+1;$("li", "#" + options.numericId).removeClass("current");$("li#" + options.numericId + i).addClass("current");};function adjust(){if(t>ts) t=0;if(t<0) t=ts;if(!options.vertical){ul.css("margin-left",(t*w*-1));}else{ul.css("margin-top",(t*h*-1));}clickable=true;if(options.numeric) setCurrent(t);};function animate(dir,clicked){if(clickable){clickable=false;var ot=t;switch(dir){case "next":t=(ot>=ts) ? (options.continuous ? t+1 : ts) : t+1;break;case "prev":t=(t<=0) ? (options.continuous ? t-1 : 0) : t-1;break;case "first":t=0;break;case "last":t=ts;break;default:t=parseInt(dir);break;};var diff=Math.abs(ot-t);var speed=diff*options.speed;if(!options.vertical){p=(t*w*-1);ul.animate({marginLeft:p},{queue:false,duration:speed,easing:options.ease,complete:adjust});}else{p=(t*h*-1);ul.animate({marginTop:p},{queue:false,duration:speed,easing:options.ease,complete:adjust});};if(!options.continuous && options.controlsFade){if(t==0){$("a","#"+options.prevId).fadeOut('slow');$("a","#"+options.firstId).fadeOut('slow');}else if(t==ts){$("a","#"+options.nextId).fadeOut('slow');$("a","#"+options.lastId).fadeOut('slow');}else{$("a","#"+options.prevId).fadeIn('slow');$("a","#"+options.firstId).fadeIn('slow');$("a","#"+options.nextId).fadeIn('slow');$("a","#"+options.lastId).fadeIn('slow');};};if(clicked) clearTimeout(timeout);if(options.auto && dir=="next" && !clicked){;timeout=setTimeout(function(){animate("next",false);},diff*options.speed+options.pause);};};};var timeout;if(options.auto){;timeout=setTimeout(function(){animate("next",false);},options.pause);};if(options.numeric) setCurrent(0);if(!options.continuous && options.controlsFade){$("a","#"+options.prevId).hide();$("a","#"+options.firstId).hide();};});};})(jQuery);
$('#photos .slider').easySlider({
	auto:           true,
	continuous:     true,
	controlsBefore:'<div class="slider-nav">',
	controlsAfter: '</div>',
	numeric:        true,
	nextId:        'p-nextBtn',
	nextText:      '&rarr;',
	numericId:     'p-controls',
	prevId:        'p-prevBtn',
	prevText:      '&larr;',
	speed:400
});
$('#last-announcements .slider').easySlider({
	auto:           true,
	continuous:     true,
	controlsBefore:'<div class="slider-nav">',
	controlsAfter: '</div>',
	nextId:        'la-nextBtn',
	nextText:      '&darr;',
	numeric:        true,
	numericId:     'la-controls',
	prevId:        'la-prevBtn',
	prevText:      '&uarr;',
	speed:          400,
	vertical:       true
});

/* 12. COLORBOX ------------------------------------------------------------------------------------ */
/* ColorBox v1.3.6 - a full featured, light-weight, customizable lightbox based on jQuery 1.4 */
(function(c){function r(b,d){d=d==="x"?m.width():m.height();return typeof b==="string"?Math.round(b.match(/%/)?d/100*parseInt(b,10):parseInt(b,10)):b}function M(b){b=c.isFunction(b)?b.call(i):b;return a.photo||b.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function Y(){for(var b in a)if(c.isFunction(a[b])&&b.substring(0,2)!=="on")a[b]=a[b].call(i);a.rel=a.rel||i.rel;a.href=a.href||i.href;a.title=a.title||i.title}function Z(b){i=b;a=c(i).data(q);Y();if(a.rel&&a.rel!=="nofollow"){g= c(".cboxElement").filter(function(){return(c(this).data(q).rel||this.rel)===a.rel});j=g.index(i);if(j<0){g=g.add(i);j=g.length-1}}else{g=c(i);j=0}if(!B){C=B=n;N=i;N.blur();c(document).bind("keydown.cbox_close",function(d){if(d.keyCode===27){d.preventDefault();e.close()}}).bind("keydown.cbox_arrows",function(d){if(g.length>1)if(d.keyCode===37){d.preventDefault();D.click()}else if(d.keyCode===39){d.preventDefault();E.click()}});a.overlayClose&&s.css({cursor:"pointer"}).one("click",e.close);c.event.trigger(aa); a.onOpen&&a.onOpen.call(i);s.css({opacity:a.opacity}).show();a.w=r(a.initialWidth,"x");a.h=r(a.initialHeight,"y");e.position(0);O&&m.bind("resize.cboxie6 scroll.cboxie6",function(){s.css({width:m.width(),height:m.height(),top:m.scrollTop(),left:m.scrollLeft()})}).trigger("scroll.cboxie6")}P.add(D).add(E).add(t).add(Q).hide();R.html(a.close).show();e.slideshow();e.load()}var q="colorbox",F="hover",n=true,e,x=!c.support.opacity,O=x&&!window.XMLHttpRequest,aa="cbox_open",H="cbox_load",S="cbox_complete", T="resize.cbox_resize",s,k,u,p,U,V,W,X,g,m,l,I,J,K,Q,P,t,E,D,R,y,z,v,w,i,N,j,a,B,C,$={transition:"elastic",speed:350,width:false,height:false,innerWidth:false,innerHeight:false,initialWidth:"400",initialHeight:"400",maxWidth:false,maxHeight:false,scalePhotos:n,scrolling:n,inline:false,html:false,iframe:false,photo:false,href:false,title:false,rel:false,opacity:0.9,preloading:n,current:"{current}/{total}",previous:"previous",next:"next",close:"close",open:false,overlayClose:n,slideshow:false, slideshowAuto:n,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false};e=c.fn.colorbox=function(b,d){var h=this;if(!h.length)if(h.selector===""){h=c("<a/>");b.open=n}else return this;h.each(function(){var f=c.extend({},c(this).data(q)?c(this).data(q):$,b);c(this).data(q,f).addClass("cboxElement");if(d)c(this).data(q).onComplete=d});b&&b.open&&Z(h);return this};e.init=function(){function b(d){return c('<div id="cbox'+ d+'"/>')}m=c(window);k=c('<div id="colorbox"/>');s=b("Overlay").hide();u=b("Wrapper");p=b("Content").append(l=b("LoadedContent").css({width:0,height:0}),J=b("LoadingOverlay"),K=b("LoadingGraphic"),Q=b("Title"),P=b("Current"),t=b("Slideshow"),E=b("Next"),D=b("Previous"),R=b("Close"));u.append(c("<div/>").append(b("TopLeft"),U=b("TopCenter"),b("TopRight")),c("<div/>").append(V=b("MiddleLeft"),p,W=b("MiddleRight")),c("<div/>").append(b("BottomLeft"),X=b("BottomCenter"),b("BottomRight"))).children().children().css({"float":"left"}); I=c("<div style='position:absolute; top:0; left:0; width:9999px; height:0;'/>");c("body").prepend(s,k.append(u,I));if(x){k.addClass("cboxIE");O&&s.css("position","absolute")}p.children().bind("mouseover mouseout",function(){c(this).toggleClass(F)}).addClass(F);y=U.height()+X.height()+p.outerHeight(n)-p.height();z=V.width()+W.width()+p.outerWidth(n)-p.width();v=l.outerHeight(n);w=l.outerWidth(n);k.css({"padding-bottom":y,"padding-right":z}).hide();E.click(e.next);D.click(e.prev);R.click(e.close);p.children().removeClass(F); c(".cboxElement").live("click",function(d){if(d.button!==0&&typeof d.button!=="undefined")return n;else{Z(this);return false}})};e.position=function(b,d){function h(A){U[0].style.width=X[0].style.width=p[0].style.width=A.style.width;K[0].style.height=J[0].style.height=p[0].style.height=V[0].style.height=W[0].style.height=A.style.height}var f=m.height();f=Math.max(f-a.h-v-y,0)/2+m.scrollTop();var o=Math.max(document.documentElement.clientWidth-a.w-w-z,0)/2+m.scrollLeft();b=k.width()===a.w+w&&k.height()=== a.h+v?0:b;u[0].style.width=u[0].style.height="9999px";k.dequeue().animate({width:a.w+w,height:a.h+v,top:f,left:o},{duration:b,complete:function(){h(this);C=false;u[0].style.width=a.w+w+z+"px";u[0].style.height=a.h+v+y+"px";d&&d()},step:function(){h(this)}})};e.resize=function(b){function d(){a.w=a.w||l.width();a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}function h(){a.h=a.h||l.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}function f(G){e.position(G,function(){if(B){if(x){A&&l.fadeIn(100);k[0].style.removeAttribute("filter")}if(a.iframe)l.append("<iframe id='cboxIframe'"+ (a.scrolling?" ":"scrolling='no'")+" name='iframe_"+(new Date).getTime()+"' frameborder=0 src='"+a.href+"' "+(x?"allowtransparency='true'":"")+" />");l.show();Q.show().html(a.title);if(g.length>1){P.html(a.current.replace(/\{current\}/,j+1).replace(/\{total\}/,g.length)).show();E.html(a.next).show();D.html(a.previous).show();a.slideshow&&t.show()}J.hide();K.hide();c.event.trigger(S);a.onComplete&&a.onComplete.call(i);a.transition==="fade"&&k.fadeTo(L,1,function(){x&&k[0].style.removeAttribute("filter")}); m.bind(T,function(){e.position(0)})}})}if(B){var o,A,L=a.transition==="none"?0:a.speed;m.unbind(T);if(b){l.remove();l=c('<div id="cboxLoadedContent"/>').html(b);l.hide().appendTo(I).css({width:d(),overflow:a.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(p);c("#cboxPhoto").css({cssFloat:"none"});O&&c("select:not(#colorbox select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("cbox_cleanup",function(){this.style.visibility="inherit"});a.transition=== "fade"&&k.fadeTo(L,0,function(){f(0)})||f(L);if(a.preloading&&g.length>1){b=j>0?g[j-1]:g[g.length-1];o=j<g.length-1?g[j+1]:g[0];o=c(o).data(q).href||o.href;b=c(b).data(q).href||b.href;M(o)&&c("<img />").attr("src",o);M(b)&&c("<img />").attr("src",b)}}else setTimeout(function(){var G=l.wrapInner("<div style='overflow:auto'></div>").children();a.h=G.height();l.css({height:a.h});G.replaceWith(G.children());e.position(L)},1)}};e.load=function(){var b,d,h,f=e.resize;C=n;i=g[j];a=c(i).data(q);Y();c.event.trigger(H); a.onLoad&&a.onLoad.call(i);a.h=a.height?r(a.height,"y")-v-y:a.innerHeight?r(a.innerHeight,"y"):false;a.w=a.width?r(a.width,"x")-w-z:a.innerWidth?r(a.innerWidth,"x"):false;a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=r(a.maxWidth,"x")-w-z;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh=r(a.maxHeight,"y")-v-y;a.mh=a.h&&a.h<a.mh?a.h:a.mh}b=a.href;J.show();K.show();if(a.inline){c('<div id="cboxInlineTemp" />').hide().insertBefore(c(b)[0]).bind(H+" cbox_cleanup",function(){c(this).replaceWith(l.children())}); f(c(b))}else if(a.iframe)f(" ");else if(a.html)f(a.html);else if(M(b)){d=new Image;d.onload=function(){var o;d.onload=null;d.id="cboxPhoto";c(d).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(a.scalePhotos){h=function(){d.height-=d.height*o;d.width-=d.width*o};if(a.mw&&d.width>a.mw){o=(d.width-a.mw)/d.width;h()}if(a.mh&&d.height>a.mh){o=(d.height-a.mh)/d.height;h()}}if(a.h)d.style.marginTop=Math.max(a.h-d.height,0)/2+"px";f(d);g.length>1&&c(d).css({cursor:"pointer"}).click(e.next); if(x)d.style.msInterpolationMode="bicubic"};d.src=b}else c("<div />").appendTo(I).load(b,function(o,A){A==="success"?f(this):f(c("<p>Request unsuccessful.</p>"))})};e.next=function(){if(!C){j=j<g.length-1?j+1:0;e.load()}};e.prev=function(){if(!C){j=j>0?j-1:g.length-1;e.load()}};e.slideshow=function(){function b(){t.text(a.slideshowStop).bind(S,function(){h=setTimeout(e.next,a.slideshowSpeed)}).bind(H,function(){clearTimeout(h)}).one("click",function(){d();c(this).removeClass(F)});k.removeClass(f+ "off").addClass(f+"on")}var d,h,f="cboxSlideshow_";t.bind("cbox_closed",function(){t.unbind();clearTimeout(h);k.removeClass(f+"off "+f+"on")});d=function(){clearTimeout(h);t.text(a.slideshowStart).unbind(S+" "+H).one("click",function(){b();h=setTimeout(e.next,a.slideshowSpeed);c(this).removeClass(F)});k.removeClass(f+"on").addClass(f+"off")};if(a.slideshow&&g.length>1)a.slideshowAuto?b():d()};e.close=function(){c.event.trigger("cbox_cleanup");a.onCleanup&&a.onCleanup.call(i);B=false;c(document).unbind("keydown.cbox_close keydown.cbox_arrows"); m.unbind(T+" resize.cboxie6 scroll.cboxie6");s.css({cursor:"auto"}).fadeOut("fast");k.stop(n,false).fadeOut("fast",function(){c("#colorbox iframe").attr("src","about:blank");l.remove();k.css({opacity:1});try{N.focus()}catch(b){}c.event.trigger("cbox_closed");a.onClosed&&a.onClosed.call(i)})};e.element=function(){return c(i)};e.settings=$;c(e.init)})(jQuery);
$('.cbox-onload').colorbox({open:true}); // Sayfa açılınca otomatik açılacak kutu
$('.cbox-auto').colorbox({}); // İçeriğe göre boyutu şekillenecek kutu
$('.cbox-movie').colorbox({}); // Tanıtım filmlerini gösterecek kutu
// full height
$('.cbox-fullh').colorbox({height:"100%"});
$('.cbox-fullh-slide').colorbox({height:"100%",slideshow:true});
$('.cbox-fullh-paused').colorbox({height:"100%",slideshow:true,slideshowAuto:false});
// full height, fixed width
$('.cbox-fullh-fixedw').colorbox({height:"100%",width:"550px"});
$('.cbox-fullh-fixedw-slide').colorbox({height:"100%",slideshow:true,width:"550px"});
$('.cbox-fullh-fixedw-paused').colorbox({height:"100%",slideshow:true,slideshowAuto:false,width:"550px"});
// max full height, fixed width
$('.cbox-maxfullh-fixedw').colorbox({maxHeight:"100%",width:"550px"});
$('.cbox-maxfullh-fixedw-slide').colorbox({maxHeight:"100%",slideshow:true,width:"550px"});
$('.cbox-maxfullh-fixedw-paused').colorbox({maxHeight:"100%",slideshow:true,slideshowAuto:false,width:"550px"});
// inline, fixed width
$('.cbox-inline-fixedw').colorbox({inline:true,href:"#frm-1",width:"550px"});
$('.cbox-inline-fixedw-slide').colorbox({inline:true,href:"#frm-1",slideshow:true,width:"550px"});
$('.cbox-inline-fixedw-paused').colorbox({inline:true,href:"#frm-1",slideshow:true,slideshowAuto:false,width:"550px"});
// full width
$('.cbox-fullw').colorbox({width:"100%"});
$('.cbox-fullw-slide').colorbox({slideshow:true,width:"100%"});
$('.cbox-fullw-paused').colorbox({slideshow:true,slideshowAuto:false,width:"100%"});
// max full width
$('.cbox-maxfullw').colorbox({maxWidth:"100%"});
$('.cbox-maxfullw-slide').colorbox({maxWidth:"100%",slideshow:true});
$('.cbox-maxfullw-paused').colorbox({maxWidth:"100%",slideshow:true,slideshowAuto:false});
// iframe
$('.cbox-iframe-fullh-fullw').colorbox({height:"100%",iframe:true,width:"100%"});
$('.cbox-iframe-maxfullh-maxfullw').colorbox({maxHeight:"100%",iframe:true,maxWidth:"100%"});
/* popup açılınca flash dosyasını içeren divi gizle! */
$(document).bind('cbox_open',function(){$('.movie-wrap').hide();}).bind('cbox_closed',function(){$('.movie-wrap').show();});

/* 13. FONT REPLACEMENT ---------------------------------------------------------------------------- */
Cufon.replace('.tr h2'/*, {color:'-linear-gradient(#0be, #0ad)'}*/);
Cufon.replace('.en h2'/*, {color:'-linear-gradient(#0be, #0ad)'}*/);
Cufon.replace('.de h2'/*, {color:'-linear-gradient(#0be, #0ad)'}*/);
Cufon.replace('.tr h3');
Cufon.replace('.en h3');
Cufon.replace('.de h3');
Cufon.replace('.tr .single #article h3', {color:'-linear-gradient(#9c0, #8b0)'});
Cufon.replace('.en .single #article h3', {color:'-linear-gradient(#9c0, #8b0)'});
Cufon.replace('.de .single #article h3', {color:'-linear-gradient(#9c0, #8b0)'});
Cufon.replace('.tr .single #article h4');
Cufon.replace('.en .single #article h4');
Cufon.replace('.de .single #article h4');

/* 14. ADD TO FAVORITES ---------------------------------------------------------------------------- */
function AddToFavorites(){
	title = "Avrupa Serbest Bölgesi";
	url   = "http:\/\/www.asb.com.tr";
	if (window.sidebar){window.sidebar.addPanel(title, url,"");}      // Mozilla Firefox Bookmark
	else if(window.external){window.external.AddFavorite(url,title);} // IE Favorite
	else if(window.opera&&window.print){return true;}                 // Opera Hotlist
}
/*
function addBookmark(title, url) {
	if (window.sidebar) { // firefox
		window.sidebar.addPanel(title, url, "");
	} else if(document.all && window.external) { //MSIE
		window.external.AddFavorite(url, title);
	} else {
		alert("Sorry, your browser doesn't support this");
	}
}
*/

/* 15. SET HOMEPAGE -------------------------------------------------------------------------------- */
/**
* Set Homepage Link plugin
* Copyright (c) 2009 Bibby Chung Blog: http://bibby.be
* Dual licensed under the MIT and GPL licenses: http://www.opensource.org/licenses/mit-license.php http://www.gnu.org/licenses/gpl.html
* just for ie and firefox
* @example: $('#Button1').click(function(){$.setHomepage('http://google.com');});
*/

jQuery.extend({
	setHomepage: function(url) {
		if (document.all) {
			document.body.style.behavior = 'url(#default#homepage)';
			document.body.setHomePage(url);
		}
		else if (window.sidebar) {
			if (window.netscape) {
				try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); }
				catch (e) {
					var strTemp = '';
						strTemp += "this action was aviod by your browser, if you want to enable,please enter about:config in your address line, and change the value of signed.applets.codebase_principal_support to true";
					alert(strTemp);
				}
			}
			var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
			prefs.setCharPref('browser.startup.homepage', url);
		}
	}
});
$('#set-homepage a').click(function() { $.setHomepage('http://www.asb.com.tr'); });

//-->

