//functions

function statusreport(id,obj,images,size) { //get position in specified element and change the image postition
	var segmentSize = size/images; // count how long it should be before image change
	var times = 1;	// just a variable to count with

	var oX = obj.offsetLeft;
	while(obj.parentNode){// finds the absolute position of the object 
	if(obj==document.getElementsByTagName('body')[0]){break} 
	else{obj=obj.parentNode;} 
	} 
	var rX=mX-oX;//relative X
	
	document.getElementById('debug_Input').value = "status: "+rX+"mx: "+mX+"ox: "+oX;
	
 	var status = rX;
	

	//get position
	while (true) //check the last of the segment the point is placed in, when the last is found the image will change
	{
		if (status >= (segmentSize*times)+2)
		{
			times=times+1;
		}
		else
		{
			document.getElementById(id).style.bottom=size*(times-1)+"px";
			return false;
		}
	}
}

var mX;var mY; 
function checkS(e){// captures the mouse position 
mX = 0;mY = 0; 
if (!e) {var e = window.event};//IE 
if (e.pageX || e.pageY){//Moz 
mX = e.pageX; mY = e.pageY; 
} 
else if (e.clientX || e.clientY){//IE 
mX = e.clientX-2; mY = e.clientY-2;//IE correction 
} 
} 


function linking(album,obj,images,size,mode) { //get position in specified element and change the image postition
	var segmentSize = size/images; // count how long it should be before image change
	var times = 1;	// just a variable to count with
	
	var oX = obj.offsetLeft;
	while(obj.parentNode){// finds the absolute position of the object 
	oX=oX+obj.parentNode.offsetLeft; 
	if(obj==document.getElementsByTagName('body')[0]){break} 
	else{obj=obj.parentNode;} 
	} 
	var rX=mX-oX;//relative X
	status=rX;
	while (true) 
	{
		if (status >= (segmentSize*times)+2)
		{
			times=times+1;
		}
		else
		{
			if(mode=='')
			{
				mode='grid';
			}
			goToUrl("?album="+album+"&view="+mode+"&color="+getURLParam('color'));

			return false;
		}
	}
}

function setBlue(id) {
	document.getElementById(id+"number").style.color='rgb(112, 176, 255)';
}

function resetting(id) {
	document.getElementById(id+"number").style.color='#999999';
	document.getElementById(id).style.bottom=0;
	mX=0;
	mY=0;
}