jQuery.noConflict();
jQuery(document).ready(function(){
	if ( jQuery("#islogged").html() == '0' ) {
		jQuery("#user-info").css("display","none");
		jQuery("#reg-form").css("display","block");
	}else if ( jQuery("#islogged").html() == '1' )  {
	
		jQuery("#user-info").css("display","block");
		jQuery("#reg-form").css("display","none");
	} 
	
	
	/*  Image Zoom  */
	jQuery('#product-detail-image').attr('href',jQuery('#product-detail-large-image img').attr('src'));
	var options = {
	    zoomWidth: 300,
	    zoomHeight: 250,
		xOffset: 10,
		yOffset: 0,
		position: "right",
		title: false
	};
	jQuery('#product-detail-image').jqzoom(options);
	
	/*  Tabs  */
	//jQuery('#product-tabs').tabs();
	
	/*FB.init({ 
		appId:'109454003307',
		cookie:false, 
		status:true, 
		xfbml:true
	});*/
	
	update_fbbox_pos();
});
jQuery(window).resize(function(){
	update_fbbox_pos();
});
function update_fbbox_pos(){
	var window_width = parseInt(jQuery(window).width());
	jQuery('.social').unbind('mouseenter mouseleave');
	if (window_width <= 1050) {
		jQuery('.social').css({'left':'-58px'});
		jQuery('.social').hover(function(){
			jQuery('.social').css({'left':'0'});
		},function(){
			jQuery('.social').css({'left':'-58px'});
		});
	}else{
		jQuery('.social').css({'left':'0'});
	}
	
	//Update count
	/*FB.api('/109454003307', function(response) {
		jQuery('#fans-count').html(response.likes);
	});*/
}
/*
function preloadMenuImages(images){
	for (i = 0; i < images.length; i++) {
		console.log( i );
		console.log( images[i] );
		var img = new Image();
		J(img).load(function () {
			console.log('Loaded '+this.src);
		}).attr('src', images[i]);
	}
}
*/
