var $j = jQuery.noConflict();
$j(document).ready(function(){
    /*  Previews  */
    if($j('A.preview-thumbnail')){
        $j('A.preview-thumbnail').bind('mouseenter', function(){
            var originalImg = $j(this).attr('rel');
            $j('#preview-original-img').html('<img src="' + originalImg + '" alt="" />');
            if($j(this).children() && $j(this).children()[1]){
                $j('#preview-info').html($j($j(this).children()[1]).html());
            }
        });
    }

    /*  Option links  */
    if($j('.option-links A')){
        $j('.option-links A').bind('mouseenter', function(){
            $j('#option-description').html( $j(this).attr('title') );
        });
        $j('.option-links A').bind('mouseleave', function(){
            $j('#option-description').html('&nbsp;');
        });
    }

    $j(".product-thumb").mouseover(function() {
        var currentId = $j(this).attr("id");
        //var currentsrc = J(this).attr('src');         
        try {
            var swappreview = document.getElementsByName(currentId);
            $j(swappreview).mouseover();
        } catch (Error) { }
    });
    $j(".product-thumb").mouseout(function() {
        return false;
    });
	
    /*  Tabs  */
	$j('ul.top-list-sub').tabs();
});