// random background and color
var totalNum=3;var rndNum=(Math.floor(Math.random()*totalNum)+1);var rndNum2=(Math.floor(Math.random()*totalNum)+1);$(document).ready(function(){$("body").addClass("cl-0"+rndNum)});$(document).ready(function(){$("body").addClass("bg-0"+rndNum2)});
// cufon
Cufon.replace('h2');Cufon.replace('.work-item span.title');
// image transition
$(document).ready(function(){$("div#works .work-item img").attr("alt","")
$("div#works .work-item").hover(function(){var fadetext=$('> span.view-more',this);$(this).contents().find("img").hide();fadetext.fadeIn("fast");},function(){var fadetext=$('> span.view-more',this);$(this).contents().find("img").fadeIn("500");fadetext.fadeOut("500");});});
// setting the width to work container
$(document).ready(function(){var width=0;$('.work-item').each(function(){width+=$(this).outerWidth(true);});$('#works').css('width',width+20);windowwidth=$(window).width()
if(windowwidth<width){$('#title').css('width',width+60);}});$(window).resize(function(){var width=0;$('.work-item').each(function(){width+=$(this).outerWidth(true);});windowwidth=$(window).width()
if(windowwidth<width){$('#title').css('width',width+60);}else{$('#title').css('width','100%');}});
// localscroll
$(document).ready(function(){$('p.back').localScroll({duration:1000,axis:'x',});});
// back link fade
$(function(){$(window).scroll(function(){if($(this).scrollLeft()!=0){$('p.back').fadeIn();}else{$('p.back').fadeOut();}});});
