$(document).ready(function()
{
var name = "#previewbox";
if($('.previewbox-fixed').length)
{
var Yloc = null;
if($(name).offset()!=null)
{
var otop = $(name).offset().top;
$(name).removeClass('previewbox-fixed');
$('#builder_tab_title1').live('click', function() 
{
$(name).addClass('previewbox-fixed')
if($(name).length==1)
{
Yloc = parseFloat($(name).css("top").substring(0,$(name).css("top").indexOf("px")))
$(window).scroll(function ()
{
var offset = (Yloc-(0.16*($(document).scrollTop())));
if ($(name).offset().top<=otop)
offset=otop;
offset+="px";
//$(name).css('top',offset);
$(name).animate({top:offset},{duration:1,queue:false});
});
}
});
$('#builder_tab_title0').live('click', function() 
{
if($(name).length==1)
{
$(name).removeClass('previewbox-fixed');
}
});
$('#builder_tab_title2').live('click', function() 
{
if($(name).length==1)
{
$(name).removeClass('previewbox-fixed');
}
});
}
}
});
