function _darkBoxShow(obj) { var link = $(obj); if(!$('div.darkbox-frame').length) { darkbox = $('
').appendTo('body'); } var frame = darkbox.clone().appendTo('body').addClass('darkbox-frame-on'); var shadow = frame.find('div.darkbox-shadow').animate({opacity:0.6},300); var canvas = frame.find('div.darkbox-canvas'); var button = frame.find('div.darkbox-button'); var image = $(''+ link.attr('title') +''); image.appendTo(canvas); image.load(function(){ var imageWidth = image.width(); var imageHeight = image.height(); var frameWidth = frame.width()-40; var frameHeight = frame.height()-40; if(imageWidth > frameWidth) { imageWidth = frameWidth; image.width(imageWidth); while(image.height() > frameHeight) { image.width(imageWidth); imageWidth--; } imageHeight = image.height(); } if(imageHeight > frameHeight) { imageHeight = frameHeight; image.height(imageHeight); while(image.width() > frameWidth) { image.height(imageHeight); imageHeight--; } imageWidth = image.width(); } canvas.addClass('darkbox-canvas-load').animate({ width:imageWidth, marginLeft:-imageWidth/2, height:imageHeight, marginTop:-imageHeight/2 },500,function() { canvas.addClass('darkbox-canvas-done'); button.addClass('darkbox-button-on'); button.addClass(navigator.platform.toLowerCase().indexOf('mac')+1?'darkbox-button-left':'darkbox-button-right'); image.animate({opacity:1},500,function() { shadow.click(closer); button.click(closer); }); }); }); var closer = function() { canvas.remove(); shadow.animate({opacity:0},300,function() { frame.remove(); }); } $(document).keydown(function(e) { if(e.which==27) closer(); }); return false; } function dealerView5(obj) { var t = $(obj).next(); var p = $(obj).parent(); $('.sub1').css('display','none'); $('.sub1').each(function(i) { $(this).parent().removeClass('act'); }); t.css('display', 'block'); p.addClass('act'); } function dealerView(obj) { var t = $(obj).next(); var p = $(obj).parent(); if (t.css('display') == 'none') { t.css('display', 'block'); p.addClass('act'); } else { t.css('display', 'none'); p.removeClass('act'); } if (window.navigator.userAgent.indexOf ("MSIE") >= 0) { uaVers=window.navigator.userAgent.substr(window.navigator.userAgent.indexOf("MSIE")+5,3); } if ($.browser.msie && parseInt(uaVers) < 7){ if($('.empty-section')){ var t = $('.empty-section').height(); var to=$('.empty-section').css('top'); $('.empty-section').css('top',(document.body.clientHeight-t)+'px'); $('.footer-section').css('top',(document.body.clientHeight-t)+'px'); } if($('.empty-section3')){ var t = $('.empty-section3').height(); var to=$('.empty-section3').css('top'); $('.empty-section3').css('top',(document.body.clientHeight-t)+'px'); $('.footer-section3').css('top',(document.body.clientHeight-t)+'px'); } } }