function initLinks(){ $('a').bind('click',function(event){ if($(this).attr('target')!='_blank' && $(this).attr('class')!='noajax' && $(this).attr('rel')!='lightbox' && $(this).attr('rel')!='lightbox[rel]' && this.href.substring(0, 6)!='mailto' && this.href.substring(0, 10)!='javascript' && this.href.substring(0, 5)!='skype'){ event.preventDefault(); changeLocation($('base').attr('href'), this.href.substring($('base').attr('href').length)); document.title = this.title; $(this).attr('class', 'a'); loadPage(); } }) $('#content a[rel]').lightBox(); $('#content .easy_slideshow').each(function(){ speed = parseInt($(this).attr('speed')); interval = parseInt($(this).attr('interval')); $(this).find('a').hide(0); $(this).find('.index_0').show(0); $(this).oneTime(interval, function(){ $(this).everyTime(parseInt($(this).attr('speed')), function(i){ index=i%$(this).find('a').length; $(this).find('a').fadeOut(2000); $(this).find('.index_'+index).slideDown(2000); }); }); }); } function initLinks_(){ $('#content a').bind('click',function(event){ if($(this).attr('target')!='_blank' && $(this).attr('class')!='noajax' && $(this).attr('rel')!='lightbox' && $(this).attr('rel')!='lightbox[rel]' && this.href.substring(0, 6)!='mailto' && this.href.substring(0, 10)!='javascript' && this.href.substring(0, 5)!='skype'){ event.preventDefault(); changeLocation($('base').attr('href'), this.href.substring($('base').attr('href').length)); document.title = this.title; loadPage(); } }); $('#content .easy_gallery').each(function(){ width = $(this).find('a').width(); height = $(this).find('a').height(); margin = parseInt($(this).find('a').css('margin-top')); border = parseInt($(this).find('a').css('border-width')); $(this).html('
'+$(this).html()+'
'); $('.container').css('height', height+margin+border*2+'px'); $('.container').css('width', $(this).width()-$('.prev').width()-$('.next').width()+'px'); $('.prev').css('height', height+'px'); $('.next').css('height', height+'px'); }); $('#content a[rel]').lightBox(); $('#content .easy_slideshow').each(function(){ speed = parseInt($(this).attr('speed'))*1000; $(this).find('a').fadeOut(0); $(this).find('.index_0').fadeIn(1000); $(this).everyTime(parseInt($(this).attr('speed'))*1000, function(i){ index=i%$(this).find('a').length; $(this).find('a').fadeOut(1000); $(this).find('.index_'+index).fadeIn(1000); }); }); } function slider(obj, dir){ container = $(obj).find('.container'); if(dir==1){ $(container).find('a:visible:first').hide(500); } if(dir==0){ $(container).find('a:hidden:last').show(500); } } function loadPage(){ //alert(SWFAddress.getValue()); if(SWFAddress.getValue()=='/') return false; $.ajax({ async: true, url: $('base').attr('href')+SWFAddress.getValue()+(SWFAddress.getValue().indexOf('ajax')!=-1?'':'ajax/1/'), cache: false, beforeSend: function(){ $("#content").fadeOut(1000, function(){ $('#preloader').show(); }); //$("#content_anim").html($("#content").html()); //$("#content").hide(0); //$("#content_anim").show(0); }, success: function(html){ $("#content").html(html); //$("#content_container").height($("#content_anim").height()); //$("#content_anim").css({'position':'relative'}); $("#content").fadeIn(1000); initLinks_(); $('#preloader').hide(); }, //timeout: 20, complete: function(html){ } }); } function changeLocation(base, link){ SWFAddress.setValue( link ); } function evalScripts(html){ var script_fragment = '(?:)((\n|\r|.)*?)(?:<\/script>)'; //replace(/<\/?[^>]+>/gi, ''); var re = new RegExp(script_fragment, "g"); var scripts = html.match(re); if(scripts){ for(var i=0; i]+>/gi, '')); } } }