// FUNCTION DEFINITIONS //
//		/		/		//

jQuery.fn.extend({
   findPos : function() {
       obj = jQuery(this).get(0);
       var curleft = obj.offsetLeft || 0;
       var curtop = obj.offsetTop || 0;
       while (obj = obj.offsetParent) {
                curleft += obj.offsetLeft
                curtop += obj.offsetTop
       }
       return {x:curleft,y:curtop};
   }
});

function goToByScroll(id){jQuery('html,body').animate({scrollTop: jQuery("#"+id).offset().top},10);}

function Hover_Product_Text(obj3) {
	jQuery("#pf-zone-text li").removeClass("li_on");
	jQuery(obj3).addClass("li_on");
}

function Hover_Product_Detail(nbp) {
	jQuery('#slideshow2').css('display', 'block').cycle(nbp);
	//jQuery('#slideshow2').css('display', 'block')
	return false;
}

function Get_Pos(obj) {
	//retourne les coordonnées via JQUERY
   pos = jQuery(obj).findPos();
   //alert('x: ' + pos.x + ' y: ' + pos.y);
   //alert(pos.y);
}

function Get_PosX(obj) {
	//get Coords via JQuery
   pos = jQuery(obj).findPos();
   return(pos.x);
}

function Get_PosY(obj) {
	//get Coords via JQuery
   pos = jQuery(obj).findPos();
   return(pos.y);
}

function Get_AreaX(obj) {
	//get Coords via JQuery
   pos = jQuery('#mask_zone_1').attr('coords').split(',');
   return(pos[0]);
}

function Get_AreaY(obj) {
	//get Coords via JQuery
   pos = jQuery('#mask_zone_1').attr('coords').split(',');
   return(pos[1]);
}

function ProductMoveTo(obj, px, py) {
	jQuery(obj).stop(true, true).animate({
		'marginLeft' : px,
		'marginTop' : py
	},300, function() {
	//alert('done');
	//jQuery(obj).css("filter","progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',sizingMethod='crop',src='" + imgSrc + "')");
  });
}

function ProductMoveToImpaakt(obj, opacityValue, px, py) {
	jQuery(obj).stop(true, true).animate({
		'marginLeft' : px,
		'marginTop' : py,
		opacity: opacityValue
	},300, function() {
  });
};


function ShowZoom(imgsrc) {
	window.document.getElementById(imgsrc).style.visibility='visible';
	window.document.getElementById(imgsrc).style.display='block';
}

function HideZoom(imgsrc) {
	window.document.getElementById(imgsrc).style.visibility='hidden';
	window.document.getElementById(imgsrc).style.display='none';
}
