﻿// <![CDATA

	/**		
	 * Dynamix Portfolio, version 0.3 beta (Dynamix-0.3.0 b)
	 * (c) 2008 Amorphik / Marc Hottinger
	 *
	 * http://www.amorphik.com/
	 *
	 * This script may not be used, modified, copied, etc. without the
	 * autorisation of amorphik.
	 *
	 *
	 * This script is meant to be further used with a Content Management System (CMS) in the next release.
	 *
	 */

	// ----------------------------------------
	// moving the images by absolute values
	// ----------------------------------------

	function moveAbs(pos) {
	}


	// ----------------------------------------
	// moving the images by relative values
	// ----------------------------------------

	function moveRel(direction) {
	
		if (direction == 'previous') {
		} else if (direction == 'next') {
		}
		
	}


	// ----------------------------------------
	// moving the images freely
	// ----------------------------------------

	function setDraggables()
	{
	
		$('objects').setStyle({top:'0px',left:'0px'/*, width:'', heigth:''*/});
		new Draggable('objects',{constraint:'horizontal', snap: function(x,y) { return[ x<(-4224) ? -4224 : (x < 0 ? x : 0 ) , y<50 ? (y > 0 ? y : 0) : 50]; }});
		$('obj1').setStyle({top:'0px',left:'0px'/*, width:'', heigth:''*/});
		new Draggable('obj1',{constraint:'vertical', snap: function(x,y) { return[ x<(-4224) ? -4224 : (x < 0 ? x : 0 ) , y<(-300) ? -300 : (y < 0 ? y : 0)]; }});
		$('obj2').setStyle({top:'0px',left:'0px'/*, width:'', heigth:''*/});
		new Draggable('obj2',{constraint:'vertical', snap: function(x,y) { return[ x<(-4224) ? -4224 : (x < 0 ? x : 0 ) , y<(-300) ? -300 : (y < 0 ? y : 0)]; }});
		
	}


	// ----------------------------------------
	// setting vertical image sizes for each mode
	// ----------------------------------------

	function viewingMode() {
		
	}
	
	// ----------------------------------------
	// deprecated and/or under developement functions
	// ----------------------------------------

	// ----------------------------------------
	// old version of the moving function
	// ----------------------------------------

	function moveObject(diffX,diffY,mode)
	{
		if(mode == 'absolute')
		{
			
			new Effect.Move('objects',{ x:diffX, y:diffY, delay:0,  duration:0.8, mode: 'absolute'});
			
		}
		if(mode == 'relative')
		{
			debug($('objects').style.left);
			new Effect.Move('objects',{ x:diffX, y:diffY, delay:0,  duration:0.8, mode: 'relative'});
		}
	}
	
	// ----------------------------------------
	// checking the image properties
	// ----------------------------------------
	/*
	
	I should maybe do that when i'm not drunk, typing in the bus on a bumpy road...
	function objectsProperties() {
		var img_width = new Array();
		var img_height = new Array();
		
		for (var i = 0; i < numObjects; i++) {
			img_width[i] = $('img_'+i+1).style.width;
			img_height[i] = $('img_'+i+1).style.height;
			debug('image'+i+1+' width = '+img_width[i]+'height = '+img_height[i]+'');
			if (img_width[i] < img_height[i]) {
				$('img_'+i+1).setStyle.width = $('img_'+i+1)Style.width * 455 / $('img_'+i+1).Style.height;
				$('img_'+i+1).setStyle.height = 445;			
			}
		}
	}
	*/

// ]]>
