function selHasChanged() {
	$('advancedSearchSubmit_btn').setStyle('color','#8fd302');
	$('arrow_right_more2').src = '/_images/common/right_arrow_green.gif';
	//*$('advancedSearchSubmit_btn').src = '/_images/common/search_btn_Green_whiteBg.gif';
	$('searchResults').innerHTML = '';
}

window.addEvent('domready',function(){
	
	// Topnav fontsizefix Safari
	/*
	if(BrowserDetect.browser == 'Safari' || BrowserDetect.OS == 'Mac'){

		$$('.topNavLink').setStyle('font-size','10px');

	}
	*/
	
	var article_search_temp;
	var searchFritextBox_temp;
	
	$$('#advancedSearchSubmit_btn').addEvent('click', function() {
		ColdFusion.Ajax.submitForm('advanced_search_form', '/_components/products.cfc?method=getAdvancedSearchResults', echoReturn, ajaxError);
	
		searchFritextBox_temp = $('searchFritextBox').value;
	});
	
	$$('#articleNumberSubmit_btn').addEvent('click', function() {
		article_search_temp = $('article_search').value;
		
		ColdFusion.Ajax.submitForm('article_search_form', '/_components/products.cfc?method=getArticleSearchResults', echoReturn, ajaxError);
	});
	
	function echoReturn(test) {
		newArray = eval("("+test+")");
		
		if (currentStageArray.length > 0) {
			currentThumbSize = thumbsizeSmall;
		};
	
		if (newArray.DATA.length <= 15) {
			thumbsizeSmall = [182,125];
			itemsPerRow = 5;
			zoomFunction = 0;
			imageFolder = '182x125';
		} else if (newArray.DATA.length <= 50) {
			thumbsizeSmall = [90,62];
			itemsPerRow = 10;
			zoomFunction = 1;
			imageFolder = '144x99';
		} else if (newArray.DATA.length <= 135) {
			thumbsizeSmall = [59,41];
			itemsPerRow = 15;
			zoomFunction = 1;
			imageFolder = '94x65';
		} else {
			thumbsizeSmall = [44,30];
			itemsPerRow = 20;
			zoomFunction = 1;
			imageFolder = '70x48';
		}
		
		currentThumbSize = thumbsizeSmall;
		
		activeAreaX = contentDiv.getCoordinates().left;
		activeAreaY = contentDiv.getCoordinates().top;
		activeAreaX2 = itemsPerRow * (thumbsizeSmall[0]) + activeAreaX;
		
		var totalHeight=0;
		var rowChk = 1;
		
		if (newArray.DATA.length > 0) {
			$('searchResults').setStyles({'color':'#dc195f'})
			$('searchResults').innerHTML = 'DIN SÖKNING GAV '+newArray.DATA.length+' TRÄFFAR'
		} else {
			$('searchResults').setStyles({'color':'#dc195f'})
			$('searchResults').innerHTML = 'DIN SÖKNING GAV INGA TRÄFFAR'
		}
		
		
		for (i = 0; i < newArray.DATA.length; i++) {
			if (rowChk == itemsPerRow || i == newArray.DATA.length) {
				rowChk = 1;
				totalHeight = totalHeight + (thumbsizeSmall[1]+imageBorder);
			} else {
				rowChk++;
			}
		}

		activeAreaY2 = totalHeight + activeAreaY;

		if(newArray.DATA.length > 0) {
			if (currentStageArray.length > 0) {
				clearStage(currentStageArray,newArray.DATA, currentThumbSize);
			} else {
				renderStage(newArray.DATA, currentThumbSize);	
			}
		} else {
			if (currentStageArray.length > 0) {
				emptyStage(currentStageArray);
			}
		}
	}

	function ajaxError(test) {
		alert(test);
	}
	
	/*** PRODUCT FAMILY SEARCH ***/
	doProductFamilySearch = function(familyID) {
		
		Mediabox.close();
		showSearch();
		
		(function wait() {
			optionDivs = $ES('option', 'produktfamilj');
			optionDivs.each(function(oOpt) {
				if (oOpt.getProperty('value') == familyID) {
					oOpt.setAttribute('selected',true)
				}
			});
		
			ColdFusion.Ajax.submitForm('advanced_search_form', '/_components/products.cfc?method=getAdvancedSearchResults', echoReturn, ajaxError);
		}).delay(200);
	} 
	
	var btn = $$("#showSearch");
	btn.addEvent('click', function(){
		showSearch();
		document.getElementById('advanced_search_form').reset();
		document.getElementById('article_search_form').reset();
		$('articleNumberSubmit_btn').setStyle('color','#898989');
		$('arrow_right_more1').src = '/_images/common/right_arrow_grey.gif';
		$('advancedSearchSubmit_btn').setStyle('color','#898989');
		$('arrow_right_more2').src = '/_images/common/right_arrow_grey.gif';
		$('searchResults').setHTML('');
	});
	
	var draggableOptions = {
		onStart:function() {
			$('advancedSearch').setOpacity(.8);
		},
		onComplete:function() {
	      $('advancedSearch').setOpacity(1);
	    }
	};

	dragWindow = new Drag.Move($('advancedSearch'),draggableOptions);
	$('advancedSearch').setOpacity(0);
	
	$('searchFormContainer').addEvent('mouseenter', function() {
		dragWindow.detach();
	});

	$('searchFormContainer').addEvent('mouseleave', function() {
		dragWindow.attach();
	});

	$('closeSearch').addEvent('mouseenter', function() {
		dragWindow.detach();
	});
	
	$('closeSearch').addEvent('mouseleave', function() {
		dragWindow.attach();
	});
	
	$('closeSearch').addEvent('mouseenter', function() {
		dragWindow.detach();
	});

	$('closeSearch').addEvent('mouseleave', function() {
		dragWindow.attach();
	});

	var logo = $$("#logo");
	logo.addEvent('click', function() {
		location.href='/';
	});
	
	// NAVLINE
	/*
	(function() {
		var fxNavLine = new Fx.Styles($('navLine'), { 
			wait: false,
			duration: 1500,
			transition: Fx.Transitions.Circ.easeOut,
			onComplete: function() {}
		});
		fxNavLine.start({
			'width': '918px'
		});
	}).delay(100);
	*/
	
	var sizeRatioFocus = 1.6;
	var sizeRatioTop = 1.4;
	var sizeRatioCorners = 1.3;
	
	var imageBorder = 2;
	var zoomFunction = 0;
	animationDone = 1;
	
	
	// IMAGE ARRAYS 
	var contentDiv = $("mainBody");
	var itemsPerRow = 10;
	var currentStageArray = new Array();
	
	getArrayData = function(id) {
		if (animationDone == 1) {
			var request = new Json.Remote('/_components/products.cfc?method=getProductNavigation&productCategoryID='+id, {
				onComplete: function(jsonObj) {
					currentCategoryID = id;
					
					if (currentStageArray.length > 0) {
						currentThumbSize = thumbsizeSmall;
					};
					
					if (jsonObj.DATA.length <= 15) {
						thumbsizeSmall = [182,125];
						itemsPerRow = 5;
						zoomFunction = 0;
						imageFolder = '182x125';
					} else if (jsonObj.DATA.length <= 50) {
						thumbsizeSmall = [90,62];
						itemsPerRow = 10;
						zoomFunction = 1;
						imageFolder = '144x99';
					} else if (jsonObj.DATA.length <= 135) {
						thumbsizeSmall = [59,41];
						itemsPerRow = 15;
						zoomFunction = 1;
						imageFolder = '94x65';
					} else {
						thumbsizeSmall = [44,30];
						itemsPerRow = 20;
						zoomFunction = 1;
						imageFolder = '70x48';
					}
					
					activeAreaX = contentDiv.getCoordinates().left;
					activeAreaY = contentDiv.getCoordinates().top;
					activeAreaX2 = itemsPerRow * (thumbsizeSmall[0]) + activeAreaX;
					
					var totalHeight=0;
					var rowChk = 1;
					
					for (i = 0; i < jsonObj.DATA.length; i++) {
						if (rowChk == itemsPerRow || i == jsonObj.DATA.length) {
							rowChk = 1;
							totalHeight = totalHeight + (thumbsizeSmall[1]+imageBorder);
						} else {
							rowChk++;
						}
					}
					
					activeAreaY2 = totalHeight + activeAreaY;
					
					if(jsonObj.DATA.length > 0) {
						if (currentStageArray.length > 0) {
							clearStage(currentStageArray,jsonObj.DATA);
						} else {
							renderStage(jsonObj.DATA, thumbsizeSmall);	
						}
					} else {
						if (currentStageArray.length > 0) {
							emptyStage(currentStageArray);
						} else {
							contentDiv.empty();
						}
					}
				}
			}).send();
		}
		//animationDone = 0;
	}
	
	//getArrayData(0);

	// SHOWPAGE
	showPage = function(navID) {
		//console.log('showPage');
		if (animationDone == 1) {
			zoomFunction = 0;
			if (currentStageArray.length > 0) {
				clearStageShowPage(currentStageArray,navID);
			} else {
				displayPage(navID);	
			}
		}
	}

	// VARIABLES
	var leftImage;
	var rightImage;
	var topImage;
	var bottomImage;
	var topLeftImage;
	var topRightImage;
	var bottomLeftImage;
	var bottomRightImage;
	var focusImage;
	
	var mouseX = 0;
	var mouseY = 0;

	var randomChainArray = new Array();
	
	// STAGE PROPERTIES
	
	var stageLeft = 0;
	var stageTop = 0;
	var stageWidth = 918;
	var IE = document.all?true:false;
	var startAnimationDuration = 500;
	var startAnimationInterval = 1;
	var currentCategoryID;
	
	//********** MAIN FUNCTION **********//
	function stopCheckMousePos() {
		//var IE = document.all?true:false;
		if (!IE) document.releaseEvents(Event.MOUSEMOVE);
		$('mainBody').onmousemove = null;
	}

	// CLEARSTAGE
	function clearStageShowPage(arrayOfImages) {
		animationDone = 0;
		stopCheckMousePos();
		currentThumbSize = thumbsizeSmall;
		
		var zoomImgs = $$(".zoomImg");
		var xDiff = currentThumbSize[0]-(currentThumbSize[0]*0.001);
		var yDiff = currentThumbSize[1]-(currentThumbSize[1]*0.001);
		
		// RANDOMIZE ARRAY
		shuffleArray = function(o){
	    	for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
	     	return o;
	    };
	    
	    var tempArray = new Array();
	    
	    for (i=0; i<arrayOfImages.length; i++) {
	    	tempArray.push(i);	 
	    }
	    
	    
	    
	    
	    var randomThumbArray = shuffleArray(tempArray);
	    var startFadeArr = new Array();

	    // SET THE NUMBER OF IMAGES TO HIDE, DEPENDING ON HOW MANY THERE ARE IN STAGE
		if (randomThumbArray.length <= 15) {
			numInStartArr = 1;
		} else if (randomThumbArray.length <= 50) {
			numInStartArr = 2;
		} else if (randomThumbArray.length <= 135) {
			numInStartArr = 4;
		} else if (randomThumbArray.length <= 200) {
			numInStartArr = 8;
		}

	    var fadeStart = function() {
	    	startFadeArr = new Array();
	    	
	    	for(var i=0; i < numInStartArr; i++) { 
	    		startFadeArr.push(randomThumbArray[i]);
	    	}
	    	
	    	randomThumbArray.splice(0,numInStartArr);
		    
		    startFadeArr.each(function(o) {
		    	if(document.getElementById('i'+ o)) {
		    		$('i'+ o).getParent().remove();
		    	}
		    });
		    
		    if(randomThumbArray.length == 0) {
		    	$clear(timer);
		    	contentDiv.empty();
		    	currentStageArray = '';
		    	displayPage();
		    	(function() {animationDone = 1}).delay(500);
		    }
	    }; 
	    var timer = fadeStart.periodical(10);
	}
	
	
	function emptyStage(arrayOfImages) {
		animationDone = 0;
		stopCheckMousePos();
		currentThumbSize = thumbsizeSmall;	
		
		// RANDOMIZE ARRAY
		shuffleArray = function(o){
	    	for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
	     	return o;
	    };
	    
	    var tempArray = new Array();
	    
	    for (i=0; i<currentStageArray.length; i++) {
	    	tempArray.push(i);	 
	    }
	    
	    var randomThumbArray = shuffleArray(tempArray);
	    var startFadeArr = new Array();
	    
	    // SET THE NUMBER OF IMAGES TO HIDE, DEPENDING ON HOW MANY THERE ARE IN STAGE
		if (randomThumbArray.length <= 15) {
			numInStartArr = 1;
		} else if (randomThumbArray.length <= 50) {
			numInStartArr = 2;
		} else if (randomThumbArray.length <= 135) {
			numInStartArr = 4;
		} else if (randomThumbArray.length <= 200) {
			numInStartArr = 8;
		}
	    
	    var fadeStart = function() {
	    	for(var i=0; i < numInStartArr; i++) { 
	    		startFadeArr.push(randomThumbArray[i]);
	    	}
	    	
	    	randomThumbArray.splice(0,numInStartArr);
		    
		    startFadeArr.each(function(o) {
		    	if(document.getElementById('i'+ o)) {
		    		$('i'+ o).setStyles({'opacity':0,'visibility':'hidden'});
		    		//document.getElementById('i'+ o).style.opacity = 0;
					//document.getElementById('i'+ o).style.visibility = 'hidden';
		    	}
		    });
		    
		    if(randomThumbArray.length == 0) {
		    	$clear(timer);
		    	//renderStage();
		    	contentDiv.empty();
		    	currentStageArray = '';
		    	//startCheckMousePos();
		    	(function() {animationDone = 1}).delay(500);
		    }
	    }; 
	    
	    var timer = fadeStart.periodical(10);
	}

	// CLEAR STAGE AND SHOW NEW
	function clearStage(arrayOfImages,newArrayOfImages,currentThumbSize) {
		//console.log('clearStage')
		animationDone = 0;
		stopCheckMousePos();
		currentThumbSize = thumbsizeSmall;
		
		var zoomImgs = $$(".zoomImg");
		var xDiff = currentThumbSize[0]-(currentThumbSize[0]*0.001);
		var yDiff = currentThumbSize[1]-(currentThumbSize[1]*0.001);

		// RANDOMIZE ARRAY
		shuffleArray = function(o){
	    	for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
	     	return o;
	    };
	    
	    var tempArray = new Array();
	    
	    for (i=0; i<arrayOfImages.length; i++) {
	    	tempArray.push(i);	 
	    }
	    
	    var randomThumbArray = shuffleArray(tempArray);
	    var startFadeArr = new Array();

	    // SET THE NUMBER OF IMAGES TO HIDE, DEPENDING ON HOW MANY THERE ARE IN STAGE
		if (randomThumbArray.length <= 15) {
			numInStartArr = 1;
		} else if (randomThumbArray.length <= 50) {
			numInStartArr = 2;
		} else if (randomThumbArray.length <= 135) {
			numInStartArr = 4;
		} else if (randomThumbArray.length <= 200) {
			numInStartArr = 8;
		}

	    var fadeStart = function() {
	    	startFadeArr = new Array();
	    	
	    	for(var i=0; i < numInStartArr; i++) { 
	    		startFadeArr.push(randomThumbArray[i]);
	    	}
	    	
	    	randomThumbArray.splice(0,numInStartArr);
		    
		    startFadeArr.each(function(o) {
		    	if(document.getElementById('i'+ o)) {
		    		$('i'+ o).getParent().remove();
		    	}
		    });
		    
		    if(randomThumbArray.length == 0) {
		    	$clear(timer);
		    	(function() {animationDone = 1}).delay(500);
		    	(function() {renderStage(newArrayOfImages, currentThumbSize)}).delay(5);
		    }
	    }; 
	    var timer = fadeStart.periodical(10);
	}

	// DISPLAY PAGE
	function displayPage() {
		var pageDiv = new Element('div').setProperty('id','pageDiv').setStyles({
			'width':'918 px', 
			'height':'100%', 
			'position':'absolute', 
			'top':'31px', 
			'left':'0px', 
			'z-index':'1',
			'font-weight':'normal',
			'background-color':'#000000',
			'display':'block'
		});
		
		var pageContent = new Json.Remote('/_components/pages.cfc?method=getPageContent', {
			onComplete: function(jsonData) {	
				pageDiv.setHTML(jsonData);
				pageDiv.inject(contentDiv);	
				sIFR.replace(helveticaNeue, {
					  selector: 'h4',
					  wmode: 'transparent'
					  ,css: [
					      '.sIFR-root { text-align: left; color: #FFFFFF; font-size: 18px; }'
					  ]
					  
					});
				var fx = new Fx.Styles(pageDiv, {
					duration:2000, 
					wait:false, 
					transition:Fx.Transitions.Circ.easeOut,
					onComplete:function() {
						animationDone = 1;
					}
				});
				
				fx.start({
					'opacity': 1
				});
				
			}
		}).send();
	}

	
	// CREATE GRID
	function renderStage(arrayOfImages, thumbsizeSmall) {
		animationDone = 0;
		contentDiv.empty();
		currentStageArray = arrayOfImages;
		currentThumbSize = thumbsizeSmall;
		
		var leftPosition = stageLeft - imageBorder;
		var topPosition = stageTop;
		var positionCounter = 1;
		var tempArray = new Array();
		
		for (gi = 0; gi < arrayOfImages.length; gi++) {
			tempArray.push(gi);
			
			var gridItem = new Element('div').setProperty('id',gi).setProperty('class','zoomImg').setStyles({
				'width':thumbsizeSmall[0]+'px', 
				'height':thumbsizeSmall[1]+'px', 
				'position':'absolute', 
				'top':topPosition+'px', 
				'left':leftPosition+'px', 
				'z-index':'1'
			});

			var thumbImage = new Element('img').setProperty('id','i'+gi).setProperty('src','/_images/products/'+ imageFolder +'/'+ arrayOfImages[gi][1]).setProperty('class','fisheyeImage').setStyles({
				'border':imageBorder+'px solid black',
				'opacity':0
			});
			
			thumbImage.inject(gridItem);
			gridItem.inject(contentDiv);
			
			if (positionCounter == itemsPerRow) {
				positionCounter = 1;
				leftPosition = stageLeft - imageBorder;
				topPosition = topPosition + thumbsizeSmall[1] + imageBorder;
			} else {
				leftPosition = leftPosition + thumbsizeSmall[0] + imageBorder;
				positionCounter++;
			}
			
		}
		
		// SET THUMBNAIL RATIOS & LINK
		var zoomImgs = $$(".zoomImg");
		zoomImgs.each(function(zoomImg) {
			zoomImg.getFirst().setStyles({'width':thumbsizeSmall[0]+'px','height':thumbsizeSmall[1]+'px','cursor':'pointer'});
			
			zoomImg.addEvent('click', function(){
				parent.Mediabox.open("/startpage/view_product.cfm?pID="+arrayOfImages[zoomImg.getProperty('id')][0]+"&cID="+arrayOfImages[zoomImg.getProperty('id')][2], "Products", "mediabox[918 580]"); 
			});
			
			zoomImg.getFirst().setStyles({'opacity':0});
			
			// MOUSE OVER GRID
			zoomImg.addEvent('mouseenter', function() {
				if (zoomFunction == 1) {
					
					focusImage = zoomImg.getProperty('id').toInt();
					
					leftImage = focusImage - 1;
					rightImage = focusImage + 1;
					
					topImage = focusImage - itemsPerRow.toInt();
					bottomImage = focusImage + itemsPerRow.toInt();
					
					topLeftImage = topImage - 1;
					topRightImage = topImage + 1;
					bottomLeftImage = bottomImage - 1;
					bottomRightImage = bottomImage + 1;
					
					if(typeof(new_active) == 'undefined') {
						new_active = [];
					}
					
					new_active[0] = focusImage;
					
					new_active[1] = leftImage;
					new_active[2] = rightImage;
					
					new_active[3] = topImage;
					new_active[4] = bottomImage;
					
					new_active[5] = topLeftImage;
					new_active[6] = topRightImage;
					
					new_active[7] = bottomLeftImage;
					new_active[8] = bottomRightImage;
					
					if(typeof(old_active) == 'undefined') {
						old_active = [];
					} else {
						old_active.each(function(currOld) {
							isInNewActive = false;
							
							new_active.each(function(currNew) {
								if(currOld == currNew) {
									isInNewActive = true;
								}
							});
							
							if(!isInNewActive) {
								$$('#i'+ currOld).setStyles({'border':imageBorder+'px solid black','width':currentThumbSize[0],'height':currentThumbSize[1]});
								$$('#i'+ currOld).getParent().setStyles({'z-index':'1','margin-left':'0','margin-top':'0'});
							}
						});
					}
					
					old_active[0] = focusImage;
					
					old_active[1] = leftImage;
					old_active[2] = rightImage;
					
					old_active[3] = topImage;
					old_active[4] = bottomImage;
					
					old_active[5] = topLeftImage;
					old_active[6] = topRightImage;
					
					old_active[7] = bottomLeftImage;
					old_active[8] = bottomRightImage;
				}
			});
		});
		
		// RANDOMIZE ARRAY
		shuffleArray = function(o) {
	    	for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
	     	return o;
	    };

	    var randomThumbArray = shuffleArray(tempArray);
	    var startFadeArr = new Array();
	    
	    // SET THE NUMBER OF IMAGES TO SHOW, DEPENDING ON HOW MANY THERE ARE IN STAGE
		if (randomThumbArray.length <= 15) {
			numInStartArr = 1;
		} else if (randomThumbArray.length <= 50) {
			numInStartArr = 2;
		} else if (randomThumbArray.length <= 135) {
			numInStartArr = 4;
		} else if (randomThumbArray.length <= 200) {
			numInStartArr = 8;
		}
	    
	    var fadeStart = function() {
	     	 startFadeArr = new Array();
	    	  
	    	for(var i=0; i < numInStartArr; i++) {
	    		startFadeArr.push(randomThumbArray[i]);
	    	}

	    	randomThumbArray.splice(0,numInStartArr);
	    	
		    startFadeArr.each(function(o) {
		    	if(document.getElementById('i'+ o)) {
		    		$('i'+ o).setStyles({'opacity':1,'visibility':'visible'});
		    	}
		    });
		    
		    if(randomThumbArray.length == 0) {
		    	$clear(timer);
		    	startCheckMousePos();
		    	(function() {animationDone = 1}).delay(500);
		    }
	    };
  
	    var timer = fadeStart.periodical(10);
	   
	}

	// FISHEYE FUNCTIONS
	$('article_search').addEvent('keyup', function() {
		if($('article_search').value.length > 0) {
			$('articleNumberSubmit_btn').setStyle('color','#8fd302');
			$('arrow_right_more1').src = '/_images/common/right_arrow_green.gif';
		} else {
			$('articleNumberSubmit_btn').setStyle('color','#898989');
			$('arrow_right_more1').src = '/_images/common/right_arrow_grey.gif';
		}
	});

	$('article_search').addEvent('keydown', function() {
		if (article_search_temp != $('article_search').value) {
			$('searchResults').innerHTML = '';
		}
	});
	
	$('advanced_search_form').addEvent('submit', function(e) {
		new Event(e).stop();
		ColdFusion.Ajax.submitForm('advanced_search_form', '/_components/products.cfc?method=getAdvancedSearchResults', echoReturn, ajaxError);
	});
	
	$('article_search_form').addEvent('submit', function(e) {
		new Event(e).stop();
		ColdFusion.Ajax.submitForm('article_search_form', '/_components/products.cfc?method=getArticleSearchResults', echoReturn, ajaxError);
	});

	$('searchFritextBox').addEvent('keyup', function() {
		if($('searchFritextBox').value.length > 0)
		{
			$('advancedSearchSubmit_btn').setStyle('color','#8fd302');
			$('arrow_right_more2').src = '/_images/common/right_arrow_green.gif';
		} else {
			$('advancedSearchSubmit_btn').setStyle('color','#898989');
			$('arrow_right_more2').src = '/_images/common/right_arrow_grey.gif';
		}
	});
	
	$('searchFritextBox').addEvent('keydown', function() {
		if (searchFritextBox_temp != $('searchFritextBox').value) {
			$('searchResults').innerHTML = '';
		}
	});

	$('closeSearch').addEvent('click', function() {
		hideSearch();	
	});
	
	function hideSearch() {
		if (!IE) document.captureEvents(Event.MOUSEMOVE);
			$('mainBody').onmousemove = getMouseXY;
			
		var fx = new Fx.Styles($('advancedSearch'), {
			duration:1000, 
			wait:false, 
			transition:Fx.Transitions.Circ.easeOut,
			onComplete:function() {
				$('advancedSearch').setStyles({'visibility':'hidden','display':'none'});
			}
		});

		fx.start({
			'opacity': 0
		});
	};
	
	function startCheckMousePos() {
		if (zoomFunction == 1) {
			if (!IE) document.captureEvents(Event.MOUSEMOVE);
				$('mainBody').onmousemove = getMouseXY;
		}
	}
	
	function getMouseXY(e) {
		if (IE) {
			mouseX = event.clientX + document.body.scrollLeft
			mouseY = event.clientY + document.body.scrollTop
		} else {
			mouseX = e.pageX
			mouseY = e.pageY
		}

		if (mouseX < 0){mouseX = 0}
		if (mouseY < 0){mouseY = 0} 
					
		// SCALE IMAGES
		var focusImg = $$("#"+focusImage);
		var leftImg = $$("#"+leftImage);
		var rightImg = $$("#"+rightImage);
		var topImg = $$("#"+topImage);
		var bottomImg = $$("#"+bottomImage);
		var topLeftImg = $$("#"+topLeftImage);
		var topRightImg = $$("#"+topRightImage);
		var bottomLeftImg = $$("#"+bottomLeftImage);
		var bottomRightImg = $$("#"+bottomRightImage);
		
		var thumbSizeW = thumbsizeSmall[0];
		var focusSizeW = thumbsizeSmall[0]*sizeRatioFocus;
		var thumbSizeH = thumbsizeSmall[1];
		var focusSizeH = thumbsizeSmall[1]*sizeRatioFocus;
		
		// FOCUS IMAGE
		if (focusImg[0]) {
			var coords = focusImg[0].getFirst().getCoordinates();
			
		  	var focusCenterX = coords.left+coords.width/2;
		  	var focusCenterY = coords.top+coords.height/2;
		  	var distanceX = Math.round(Math.sqrt(Math.pow((mouseX - focusCenterX), 2)));
		  	var distanceY = Math.round(Math.sqrt(Math.pow((mouseY - focusCenterY), 2)));
		  	
		  	var distance = Math.round(Math.sqrt(Math.pow((mouseX - focusCenterX), 2) + Math.pow((mouseY - focusCenterY),2)));

		  	var newWidth = (((thumbSizeW - focusSizeW)/140) * distance) + focusSizeW;
		  	var newHeight = (((thumbSizeH - focusSizeH)/140) * distance) + focusSizeH;
		}
		
		// LEFT IMAGE
		if (leftImg[0]) {
			var coords = leftImg[0].getFirst().getCoordinates();
			
		  	var focusCenterX = coords.left+coords.width/2;
		  	var focusCenterY = coords.top+coords.height/2;
		  	var distanceX = Math.round(Math.sqrt(Math.pow((mouseX - focusCenterX), 2)));
		  	var distanceY = Math.round(Math.sqrt(Math.pow((mouseY - focusCenterY), 2)));
		  	
		  	var distance = Math.round(Math.sqrt(Math.pow((mouseX - focusCenterX), 2) + Math.pow((mouseY - focusCenterY),2)));
		  	
		  	var newWidth2 = (((thumbSizeW - focusSizeW)/focusSizeW) * distance) + focusSizeW;
		  	var newHeight2 = (((thumbSizeH - focusSizeH)/focusSizeW) * distance) + focusSizeH;
		}
		
		// RIGHT IMAGE
		if (rightImg[0]) {
		  	var coords = rightImg[0].getFirst().getCoordinates();
		  
	  		var focusCenterX = coords.left+coords.width/2;
		  	var focusCenterY = coords.top+coords.height/2;
		  	var distanceX = Math.round(Math.sqrt(Math.pow((mouseX - focusCenterX), 2)));
		  	var distanceY = Math.round(Math.sqrt(Math.pow((mouseY - focusCenterY), 2)));
		  	
		  	var distance = Math.round(Math.sqrt(Math.pow((mouseX - focusCenterX), 2) + Math.pow((mouseY - focusCenterY),2)));
		  	
		  	
		  	var newWidth3 = (((thumbSizeW - focusSizeW)/focusSizeW) * distance) + focusSizeW;
		  	var newHeight3 = (((thumbSizeH - focusSizeH)/focusSizeW) * distance) + focusSizeH;
		}
		
		// TOP IMAGE
		if (topImg[0]) {
		  	var coords = topImg[0].getFirst().getCoordinates();
		  
		  	var focusCenterX = coords.left+coords.width/2;
		  	var focusCenterY = coords.top+coords.height/2;
		  	var distanceX = Math.round(Math.sqrt(Math.pow((mouseX - focusCenterX), 2)));
		  	var distanceY = Math.round(Math.sqrt(Math.pow((mouseY - focusCenterY), 2)));
		  	
		  	var distance = Math.round(Math.sqrt(Math.pow((mouseX - focusCenterX), 2) + Math.pow((mouseY - focusCenterY),2)));
		  	
		  	
		  	
		  	var newWidth4 = (((thumbSizeW - focusSizeW)/focusSizeH) * distance) + focusSizeW;
		  	var newHeight4 = (((thumbSizeH - focusSizeH)/focusSizeH) * distance) + focusSizeH;
		}
		// BOTTOM IMAGE
		if (bottomImg[0]) {
		  	var coords = bottomImg[0].getFirst().getCoordinates();
		  
		  	var focusCenterX = coords.left+coords.width/2;
		  	var focusCenterY = coords.top+coords.height/2;
		  	var distanceX = Math.round(Math.sqrt(Math.pow((mouseX - focusCenterX), 2)));
		  	var distanceY = Math.round(Math.sqrt(Math.pow((mouseY - focusCenterY), 2)));
		  	
		  	var distance = Math.round(Math.sqrt(Math.pow((mouseX - focusCenterX), 2) + Math.pow((mouseY - focusCenterY),2)));
		  	
		  	var newWidth5 = (((thumbSizeW - focusSizeW)/focusSizeH) * distance) + focusSizeW;
		  	var newHeight5 = (((thumbSizeH - focusSizeH)/focusSizeH) * distance) + focusSizeH;
		}
		// TOPLEFT IMAGE
		if (topLeftImg[0]) {
			var coords = topLeftImg[0].getFirst().getCoordinates();
		  
		  	var focusCenterX = coords.left+coords.width/2+15;
		  	var focusCenterY = coords.top+coords.height/2;
		  	
		  	var distanceX = Math.round(Math.sqrt(Math.pow((mouseX - focusCenterX), 2)));
		  	var distanceY = Math.round(Math.sqrt(Math.pow((mouseY - focusCenterY), 2)));
		  	
		  	var distance = Math.round(Math.sqrt(Math.pow((mouseX - focusCenterX), 2) + Math.pow((mouseY - focusCenterY),2)));
		  	
		   	var newWidth6 = (((thumbSizeW - focusSizeW)/thumbSizeW) * distance) + focusSizeW;
		  	var newHeight6 = (((thumbSizeH - focusSizeH)/thumbSizeW) * distance) + focusSizeH;
		}
		// TOPRIGHT IMAGE
		if (topRightImg[0]) {
		  	var coords = topRightImg[0].getFirst().getCoordinates();
		  
		  	var focusCenterX = coords.left+coords.width/2-15;
		  	var focusCenterY = coords.top+coords.height/2;
		  	var distanceX = Math.round(Math.sqrt(Math.pow((mouseX - focusCenterX), 2)));
		  	var distanceY = Math.round(Math.sqrt(Math.pow((mouseY - focusCenterY), 2)));
		  	
		  	var distance = Math.round(Math.sqrt(Math.pow((mouseX - focusCenterX), 2) + Math.pow((mouseY - focusCenterY),2)));
		  	
		  	var newWidth7 = (((thumbSizeW - focusSizeW)/thumbSizeW) * distance) + focusSizeW;
		  	var newHeight7 = (((thumbSizeH - focusSizeH)/thumbSizeW) * distance) + focusSizeH;
		}
		// BOTTOMLEFT IMAGE
		if (bottomLeftImg[0]) {
			var coords = bottomLeftImg[0].getFirst().getCoordinates();
		  
		  	var focusCenterX = coords.left+coords.width/2+15;
		  	var focusCenterY = coords.top+coords.height/2;
		  	var distanceX = Math.round(Math.sqrt(Math.pow((mouseX - focusCenterX), 2)));
		  	var distanceY = Math.round(Math.sqrt(Math.pow((mouseY - focusCenterY), 2)));
		  	
		  	var distance = Math.round(Math.sqrt(Math.pow((mouseX - focusCenterX), 2) + Math.pow((mouseY - focusCenterY),2)));
		  	
		 	var newWidth8 = (((thumbSizeW - focusSizeW)/thumbSizeW) * distance) + focusSizeW;
		  	var newHeight8 = (((thumbSizeH - focusSizeH)/thumbSizeW) * distance) + focusSizeH;
		}
		// BOTTOMRIGHT IMAGE
		if (bottomRightImg[0]) {
			 var coords = bottomRightImg[0].getFirst().getCoordinates();
		  
		  	var focusCenterX = coords.left+coords.width/2-15;
		  	var focusCenterY = coords.top+coords.height/2;
		  	var distanceX = Math.round(Math.sqrt(Math.pow((mouseX - focusCenterX), 2)));
		  	var distanceY = Math.round(Math.sqrt(Math.pow((mouseY - focusCenterY), 2)));
		  	
		  	var distance = Math.round(Math.sqrt(Math.pow((mouseX - focusCenterX), 2) + Math.pow((mouseY - focusCenterY),2)));
		  	
		  	var newWidth9 = (((thumbSizeW - focusSizeW)/thumbSizeW) * distance) + focusSizeW;
		  	var newHeight9 = (((thumbSizeH - focusSizeH)/thumbSizeW) * distance) + focusSizeH;
		}
		
		if (newHeight > thumbsizeSmall[1] && newWidth > thumbsizeSmall[0]) {
			focusImg[0].getFirst().setStyles({'border':imageBorder*1.6+'px solid black','width':newWidth+'px','height':newHeight+'px'});
			focusImg[0].setStyles({'z-index':'100','margin-left':-(newWidth - thumbsizeSmall[0]) /2,'margin-top':-(newHeight - thumbsizeSmall[1]) /2});
		}
		
  		if (leftImg[0] && newHeight2 > thumbsizeSmall[1] && newWidth2 > thumbsizeSmall[0]) {
  			if (focusImg[0].getProperty('id') != 0 
		  	&& focusImg[0].getProperty('id') != itemsPerRow
		  	&& focusImg[0].getProperty('id') != itemsPerRow*2
		  	&& focusImg[0].getProperty('id') != itemsPerRow*3
		  	&& focusImg[0].getProperty('id') != itemsPerRow*4
		  	&& focusImg[0].getProperty('id') != itemsPerRow*5
		  	&& focusImg[0].getProperty('id') != itemsPerRow*6
		  	&& focusImg[0].getProperty('id') != itemsPerRow*7
		  	&& focusImg[0].getProperty('id') != itemsPerRow*8
		  	&& focusImg[0].getProperty('id') != itemsPerRow*9
		  	&& focusImg[0].getProperty('id') != itemsPerRow*10
		  	&& focusImg[0].getProperty('id') != itemsPerRow*12
		  	&& focusImg[0].getProperty('id') != itemsPerRow*13
		  	&& focusImg[0].getProperty('id') != itemsPerRow*14
		  	&& focusImg[0].getProperty('id') != itemsPerRow*15
		  	&& focusImg[0].getProperty('id') != itemsPerRow*16
		  	&& focusImg[0].getProperty('id') != itemsPerRow*17
		  	&& focusImg[0].getProperty('id') != itemsPerRow*18
		  	&& focusImg[0].getProperty('id') != itemsPerRow*19
		  	&& focusImg[0].getProperty('id') != itemsPerRow*20
		  	&& focusImg[0].getProperty('id') != itemsPerRow*21
		  	){
		  		leftImg[0].getFirst().setStyles({'border':imageBorder+'px solid black','width':newWidth2+'px','height':newHeight2+'px'});
		  		leftImg[0].setStyles({'z-index':'50','margin-left':-(newWidth2 - thumbsizeSmall[0]) /2,'margin-top':-(newHeight2 - thumbsizeSmall[1]) /2});
			}
		}

  		if (rightImg[0] && newHeight3 > thumbsizeSmall[1] && newWidth3 > thumbsizeSmall[0]) {
  			if ( focusImg[0].getProperty('id') != itemsPerRow-1 
		  	&& focusImg[0].getProperty('id') != itemsPerRow*2-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*3-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*4-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*5-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*6-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*7-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*8-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*9-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*10-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*11-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*12-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*13-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*14-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*15-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*16-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*17-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*18-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*19-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*20-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*21-1
		  	){
  				rightImg[0].getFirst().setStyles({'border':imageBorder+'px solid black', 'width':newWidth3+'px','height':newHeight3+'px'});
  				rightImg[0].setStyles({'z-index':'50','margin-left':-(newWidth3 - thumbsizeSmall[0]) /2,'margin-top':-(newHeight3 - thumbsizeSmall[1]) /2});
	  		}			
		}

		if (topImg[0] && newHeight4 > thumbsizeSmall[1] && newWidth4 > thumbsizeSmall[0]) {
	  		topImg[0].getFirst().setStyles({'border':imageBorder+'px solid black', 'width':newWidth4+'px','height':newHeight4+'px'});
	  		topImg[0].setStyles({'z-index':'50','margin-left':-(newWidth4 - thumbsizeSmall[0]) /2,'margin-top':-(newHeight4 - thumbsizeSmall[1]) /2});
		}

		if (bottomImg[0] && newHeight5 > thumbsizeSmall[1] && newWidth5 > thumbsizeSmall[0]) {
	  		bottomImg[0].getFirst().setStyles({'border':imageBorder+'px solid black', 'width':newWidth5+'px','height':newHeight5+'px'});
	  		bottomImg[0].setStyles({'z-index':'50','margin-left':-(newWidth5 - thumbsizeSmall[0]) /2,'margin-top':-(newHeight5 - thumbsizeSmall[1]) /2});
		}

		if (topLeftImg[0] && newHeight6 > thumbsizeSmall[1] && newWidth6 > thumbsizeSmall[0]) {
	  		if ( focusImg[0].getProperty('id') != 0 
	  		&& focusImg[0].getProperty('id') != itemsPerRow
	  		&& focusImg[0].getProperty('id') != itemsPerRow*2
	  		&& focusImg[0].getProperty('id') != itemsPerRow*3
	  		&& focusImg[0].getProperty('id') != itemsPerRow*4
	  		&& focusImg[0].getProperty('id') != itemsPerRow*5
	  		&& focusImg[0].getProperty('id') != itemsPerRow*6
	  		&& focusImg[0].getProperty('id') != itemsPerRow*7
	  		&& focusImg[0].getProperty('id') != itemsPerRow*8
	  		&& focusImg[0].getProperty('id') != itemsPerRow*9
	  		&& focusImg[0].getProperty('id') != itemsPerRow*10
	  		&& focusImg[0].getProperty('id') != itemsPerRow*11
	  		&& focusImg[0].getProperty('id') != itemsPerRow*12
	  		&& focusImg[0].getProperty('id') != itemsPerRow*13
	  		&& focusImg[0].getProperty('id') != itemsPerRow*14
	  		&& focusImg[0].getProperty('id') != itemsPerRow*15
	  		&& focusImg[0].getProperty('id') != itemsPerRow*16
	  		&& focusImg[0].getProperty('id') != itemsPerRow*17
	  		&& focusImg[0].getProperty('id') != itemsPerRow*18
	  		&& focusImg[0].getProperty('id') != itemsPerRow*19
	  		&& focusImg[0].getProperty('id') != itemsPerRow*20
	  		&& focusImg[0].getProperty('id') != itemsPerRow*21
		  	){
	  			topLeftImg[0].getFirst().setStyles({'width':newWidth6+'px','height':newHeight6+'px'});
	  			topLeftImg[0].setStyles({'z-index':'20','margin-left':-(newWidth6 - thumbsizeSmall[0]) /2,'margin-top':-(newHeight6 - thumbsizeSmall[1]) /2});
			}
		}
		
		if (topRightImg[0] && newHeight7 > thumbsizeSmall[1] && newWidth7 > thumbsizeSmall[0]) {
			if ( focusImg[0].getProperty('id') != itemsPerRow-1 
		  	&& focusImg[0].getProperty('id') != itemsPerRow*2-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*3-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*4-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*5-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*6-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*7-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*8-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*9-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*10-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*11-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*12-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*13-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*14-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*15-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*16-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*17-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*18-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*19-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*20-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*21-1
		  	){
		  		topRightImg[0].getFirst().setStyles({'width':newWidth7+'px','height':newHeight7+'px'});
		  		topRightImg[0].setStyles({'z-index':'20','margin-left':-(newWidth7 - thumbsizeSmall[0]) /2,'margin-top':-(newHeight7 - thumbsizeSmall[1]) /2});
	  		}
		}

		if (bottomLeftImg[0] && newHeight8 > thumbsizeSmall[1] && newWidth8 > thumbsizeSmall[0]) {
			if ( focusImg[0].getProperty('id') != 0 
		  	&& focusImg[0].getProperty('id') != itemsPerRow
		  	&& focusImg[0].getProperty('id') != itemsPerRow*2
		  	&& focusImg[0].getProperty('id') != itemsPerRow*3
		  	&& focusImg[0].getProperty('id') != itemsPerRow*4
		  	&& focusImg[0].getProperty('id') != itemsPerRow*5
		  	&& focusImg[0].getProperty('id') != itemsPerRow*6
		  	&& focusImg[0].getProperty('id') != itemsPerRow*7
		  	&& focusImg[0].getProperty('id') != itemsPerRow*8
		  	&& focusImg[0].getProperty('id') != itemsPerRow*9
		  	&& focusImg[0].getProperty('id') != itemsPerRow*10
		  	&& focusImg[0].getProperty('id') != itemsPerRow*11
		  	&& focusImg[0].getProperty('id') != itemsPerRow*12
		  	&& focusImg[0].getProperty('id') != itemsPerRow*13
		  	&& focusImg[0].getProperty('id') != itemsPerRow*14
		  	&& focusImg[0].getProperty('id') != itemsPerRow*15
		  	&& focusImg[0].getProperty('id') != itemsPerRow*16
		  	&& focusImg[0].getProperty('id') != itemsPerRow*17
		  	&& focusImg[0].getProperty('id') != itemsPerRow*18
		  	&& focusImg[0].getProperty('id') != itemsPerRow*19
		  	&& focusImg[0].getProperty('id') != itemsPerRow*20
		  	&& focusImg[0].getProperty('id') != itemsPerRow*21
		  	){
				bottomLeftImg[0].getFirst().setStyles({'width':newWidth8+'px','height':newHeight8+'px'});
		  		bottomLeftImg[0].setStyles({'z-index':'20','margin-left':-(newWidth8 - thumbsizeSmall[0]) /2,'margin-top':-(newHeight8 - thumbsizeSmall[1]) /2});
			}
		}
		
		if (bottomRightImg[0] && newHeight9 > thumbsizeSmall[1] && newWidth9 > thumbsizeSmall[0]) {
			if ( focusImg[0].getProperty('id') != itemsPerRow-1 
		  	&& focusImg[0].getProperty('id') != itemsPerRow*2-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*3-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*4-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*5-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*6-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*7-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*8-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*9-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*10-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*11-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*12-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*13-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*14-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*15-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*16-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*17-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*18-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*19-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*20-1
		  	&& focusImg[0].getProperty('id') != itemsPerRow*21-1
		  	){
		  		bottomRightImg[0].getFirst().setStyles({'width':newWidth9+'px','height':newHeight9+'px'});
		  		bottomRightImg[0].setStyles({'z-index':'20','margin-left':-(newWidth9 - thumbsizeSmall[0]) /2,'margin-top':-(newHeight9 - thumbsizeSmall[1]) /2});
	  		}
		}
	}
	
	function showSearch() {
		stopCheckMousePos();
		
		var newSearchBoxPos = $('container').getPosition().x + $('container').getCoordinates().width - 362;
		
		stopCheckMousePos();
		$('advancedSearch').setStyles({'visibility':'visible','display':'block','left':newSearchBoxPos+'px','top':'70px'});
		
		var fx = new Fx.Styles($('advancedSearch'), {
			duration:1000, 
			wait:false, 
			transition:Fx.Transitions.Circ.easeOut,
			onComplete:function() {}
		});

		fx.start({
			'opacity': 1
		});
	}
	
	$('mainBody').addEvent('mouseleave', function() {
		new_active.each(function(currNew) {
			if($$('#'+ currNew)) {
				if(typeof($$('#'+ currNew).getFirst()[0]) != 'undefined') {
					$$('#'+ currNew).getFirst()[0].setStyles({'border':imageBorder+'px solid black','width':currentThumbSize[0]+'px','height':currentThumbSize[1]+'px'});
					$$('#'+ currNew)[0].setStyles({
						'z-index':'1',
						'width':currentThumbSize[0],
						'height':currentThumbSize[1],
						'margin-left':0,
						'margin-top':0
					});
				}
			}
		});
	});
});