/*
 * Copyright (c) 2010 
 * -------------------------------
 * powered by revaxarts.com (http://revaxarts.com)
 * original filename: portfolio.js
 * filesize: 2428 Bytes
 * last modified: Wed, 07 Jul 2010 09:51:46 +0200
 *
 */
$(document).ready(function () { easing = "myeasing"; $.localScroll({ duration:300, hash:false, offset: {top:-30}, easing:easing }); if($.getLocation() != 'undefined'){ target = '#'+$.getLocation().substr(1); if($(target).length){ setTimeout("$(\"a[href^='\"+target+\"']\").trigger('click');",600); }else{ location.href = "http://"+location.hostname+"/portfolio/"+location.search; }; } $(".movie").bind('click', function(){ var d = $(this).attr('rel').split('|'); $.lightbox.init(d[0],parseInt(d[1]),parseInt(d[2])); }); jQuery.extend({ lightbox: { init: function(url, w, h) { $('body').append('<div id="viewer"></div><div id="viewercont"></div>'); $('#viewer').css({opacity:0.8}); $('#viewer').fadeIn(); $('#viewercont').fadeIn('slow',function(){ $('#viewercont').css({ top:($(window).height()/2)-(h/2), left:($(window).width()/2)-(w/2) }); $('#viewercont').width(w); $('#viewercont').height(h); $('#viewercont').html($.lightbox.getHTML(url, w, h)); $(document).bind('keypress',function(event){ if(event.keyCode == 27){ $.lightbox.close(); } }); $('#viewer').bind('click',function(){ $.lightbox.close(); }); }); }, getHTML: function(url, w, h){ var ext = url.match(/(jpg|mov|mp4)$/); ext = ext[0]; switch(ext){ case 'mp4': html = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="'+w+'" height="'+h+'" >'+ '<param name="src" value="'+url+'" />'+ '<param name="autoplay" value="true" />'+ '<param name="controller" value="true" />'+ '<param name="bgcolor" value="#F9F5EA" />'+ '<embed width="'+w+'" height="'+h+'" pluginspage="http://www.apple.com/quicktime/download/" type="video/quicktime" controller="true" autoplay="true" src="'+url+'" scale="aspect" bgcolor="#F9F5EA" ></embed>'+ '</object>'; break; default: html = 'NO'; } return html }, close: function(){ $('#viewercont').empty(); $('#viewer, #viewercont').fadeOut('slow', function(){ $(this).remove(); }); } } }); }); 