function moveItem(draggable,droparea)
{
	var pos;

	var photoOrder = droparea.id.split('_');

	$('_currentSelection_').value=photoOrder[1];
	
	clearMO(photoOrder[1]);
	
	pos = draggable.src.lastIndexOf("/");

	img = draggable.src.substring(pos+1);
	//alert('dnd.js: '+img)
	//before anything happen get the confirmation first
	retrievePhotoInfo(img);


	// look for more infor reset in the ajax part of personalize.php

	new Effect.Opacity(draggable, {from:.0, to:.0, duration:0})


	
}




function moveItem_front( draggable,droparea)
{
	var pos;
	pos = draggable.src.lastIndexOf("/");
	img = draggable.src.substring(pos+1);
	tmpImg = img.split("?");
	img = tmpImg[0];
	//alert('dnd.js: '+img)
	//before anything happen get the confirmation first
	retrievePhotoInfo(img);

	// look for more info in the ajax part of personalize.php
	new Effect.Opacity(draggable, {from:.0, to:.0, duration:0})
}


function moveItem_front_multiphoto( draggable,droparea)
{
	
	var pos;
	var photoOrder = droparea.id.split('_');
	$('_currentSelection_').value=photoOrder[1];
	
	pos = draggable.src.lastIndexOf("/");
	img = draggable.src.substring(pos+1);
	tmpImg = img.split("?");
	img = tmpImg[0];
	//alert('dnd.js: '+img)
	//before anything happen get the confirmation first
	retrievePhotoInfo(img);

	// look for more info in the ajax part of personalize.php
	new Effect.Opacity(draggable, {from:.0, to:.0, duration:0})
}


function clearMO(selectedTarget)
{
	if ($('_templateID').value == 7)
	{
		photoCount = 3;
	}
	else if ($('_templateID').value == 5)
	{
		photoCount = 4;
	}
	else if ($('_templateID').value == 6)
	{
		photoCount = 6;
	}
	else
	{
		//alert('Need to declare new template in dnd.js');
	}
	
	for(i=1; i<=3; i++)
	{
		if (selectedTarget == i)
		{
			//$('personalizeClickEditPhoto'+i).onmouseover=new Function('enableMouseOverEdit('+i+')'); // enableMouseOver comes from personalize_comp_back.php
		}
		else
		{
			//$('personalizeClickEditPhoto'+i).onmouseover=new Function('enableMouseOver('+i+')'); // enableMouseOver comes from personalize_comp_back.php		
		}
	}
}



