function ClearForm()
{
	var FieldType;
	for (var i = 0; i < document.EditForm.length; i++) {
		FieldType = document.EditForm.elements[i].type
		if (FieldType == "text" || FieldType == "textarea") {
			document.EditForm.elements[i].value = ""
		}
		if (FieldType == "select-one") {
			document.EditForm.elements[i].options.selectedIndex = 0
		}
	}
}

function OpenNewWindow(url, width, height)
{
	var randomnumber=Math.floor(Math.random()*5001)
	window.open(url, randomnumber, "top=10,left=10,menubar=0,resizable=1,scrollbars=1,width=" + width + ",height=" + height)
}

function OpenWindowNoScroll(url, width, height) { 
	window.open(url, 'popup_noscroll',
	  "top=10,left=10,menubar=0,resizable=0,scrollbars=0,width=" + width + ",height=" + height)
}

function protect_images2(e) {
var msg = "Sorry, our images are copyrighted.";
if (navigator.appName == 'Netscape' && e.which == 3) {
	alert(msg);
	return false;
}
if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
	alert(msg);
	return false;
}
else return true;
}

function protect_images1() {
	if(document.images) {
	    for(i=0;i<document.images.length;i++) {
			document.images[i].onmousedown = protect_images2;
			document.images[i].onmouseup = protect_images2;
		}
	}
}

function OpenSideWindow(url){
	rightwidth=300;
	if (document.all) {
		windowheight = screen.availHeight;		
		leftwidth=screen.availWidth-rightwidth-11;
		SideWindow=window.open(url,'SideWindow','width='+rightwidth+',height='+(windowheight-60)+',screenX='+leftwidth+',screenY=0,top=0,left=' +leftwidth+',toolbar=0,location=0,status=1,menubar=0,resizable=1');
		SideWindow.focus();
	} else {
		SideWindow=window.open(url,'','width=280,height=480,toolbar=0,location=0,status=1,menubar=0,resizable=1');
	}
}

function PageName() {
	var pageName = window.location.href.toLowerCase();
	if (pageName.indexOf('_p/') != -1) {
		pageName = 'productdetails.asp';
	}
	else if (pageName.indexOf('_s/') != -1) {
		pageName = 'searchresults.asp';
	}
	else {
		pageName = pageName.substr(pageName.lastIndexOf("/") + 1).replace(/\?[\s\S]*/, "");
	}
	return pageName;
}

function PagePath() {
	return window.location.href.toLowerCase().replace(/http[s]?:\/\/[^\/]*\/?/, "").replace(/\?[\s\S]*/, "");
}

function QueryString(name) {
	var qsRE = new RegExp("[?&]" + name + "=([^&]*)", "i");
	var value = qsRE.exec(location.href);
	return (value) ? decode(value[1]) : "";
}

function GetCookieArray() {
	if (document.cookie.length > 0) {
		var cookieRE = new RegExp("(?:^|;)[\\s]*([^=]*)=([^;]*)", "gi");
		var cookie, cookieArray = new Array();
		cookie = cookieRE.exec(unescape(document.cookie.toString()))
		while (cookie) {
			cookieArray[cookie[1]] = cookie[2];
			cookie = cookieRE.exec(unescape(document.cookie.toString()))
		}
		return cookieArray;
	}
	return "";
}

function GetCookie(name, key, encoded) {
	var value = '', cookies = ';' + document.cookie;
	if (cookies.length > 1) {
		if (key) {
			var cookieRE = new RegExp(';[\\s]*' + name + '=[^;]*' + key + '=([^&;]*)[^;]*', 'i')
		}
		else {
			var cookieRE = new RegExp(';[\\s]*' + name + '=([^;]*)', 'i');
		}
		value = cookieRE.exec(cookies);
		value = (value) ? value[1] : '';
		if (!encoded) {
			value = decode(value);
		}
	}
	return value;
}

var c_minutes = 1, c_hours = 60, c_days = 1440, c_years = 525600;
function SetCookie(name, value, duration, key) {
	var cookie = '';
	if (key) {
		cookie = GetCookie(name, '', true);
		if (cookie != '') {
			cookie = '&' + cookie;
			var keyRE = new RegExp('([\\s\\S]*?)(&' + key + '=)[^&]*([\\s\\S]*)', 'i');
			if (keyRE.test(cookie)) {
				if (value == '') {
					cookie = cookie.replace(keyRE, '$1$3');
				}
				else {
					cookie = cookie.replace(keyRE, '$1$2' + encode(value) + '$3');
				}
			}
			else if (value != '') {
				cookie += '&' + key + '=' + encode(value);
			}
			cookie = cookie.substr(1);
		}
		else if (value == '') {
				cookie = '';
		}
		else {
			cookie = key + '=' + encode(value);
		}
	}
	else if (value != '') {
		cookie = encode(value);
	}
	if (cookie == '') {
		duration = -1000;
	}
	cookie = name + '=' + cookie + ';path=/';

	if (duration) {
		var expireDate = new Date();
		expireDate.setMinutes(expireDate.getMinutes() + parseInt(duration));
		cookie = cookie + ';expires=' + expireDate.toGMTString();
	}
	document.cookie = cookie;
	return value;
}

function encode(value) {
	value = escape(value);
	value = value.replace(/@/gi, "%40");
	value = value.replace(/\*/gi, "%2A");
	value = value.replace(/_/gi, "%5F");
	value = value.replace(/-/gi, "%2D");
	value = value.replace(/\+/gi, "%2B");
	value = value.replace(/\./gi, "%2E");
	value = value.replace(/\//gi, "%2F");
	value = value.replace(/%20/gi, "+");
	return value;
}

function decode(value) {
	value = value.replace(/\+/g, " ");
	value = unescape(value);
	return value;
}

function v$(id) {
	if (typeof(id) == 'string') {
		return document.getElementById(id);
	}
	else {
		return id;
	}
}

function FixEvent(event) {
	if (window.event) {
		var event = window.event;
		event.target = event.srcElement;
	}
	else {
		var event = event;
	}
	return event;
}

function AttachEvent(element, event, func) {
	if (element.addEventListener) {
		element.addEventListener(event.toLowerCase(), func, false);
	}
	else {
		element.attachEvent('on' + event.toLowerCase(), func);
	}
}

function DetachEvent(element, event, func) {
	if (element.removeEventListener) {
		element.removeEventListener(event.toLowerCase(), func, false);
	}
	else {
		element.detachEvent('on' + event.toLowerCase(), func);
	}
}

function ShowHide(Element_ID, Show) {
	var Element = v$(Element_ID);
	if (Element) {
		Show = eval(Show)
		if (typeof(Show) == 'undefined' && Element.style['display'] != 'none' || Show == false) {
			Element.style['display'] = 'none';
			return false;
		}
		else {
			Element.style['display'] = '';
			return true;
		}
	}
}


function vPlacement(element) {
	var isSafari = false;
	
	if (navigator.vendor) {
		if (navigator.vendor.toLowerCase().indexOf('apple') != -1) {
			isSafari = true;
			var getComputedStyle = document.defaultView.getComputedStyle;
		}
	}
	
	var left = element.offsetLeft;
	var top = element.offsetTop;
	var parent = element.offsetParent;
	while (parent) {
		left += parent.offsetLeft;
		top += parent.offsetTop;
		if (document.all) {
			left += parseFloat(parent.currentStyle.borderLeftWidth) || 0;
			top += parseFloat(parent.currentStyle.borderTopWidth) || 0;
		}
		else if (isSafari) {
			if (parent.nodeName.toUpperCase() == 'TD' || parent.nodeName.toUpperCase() == 'TABLE') {
				left += parseFloat(getComputedStyle(parent, null).getPropertyValue('border-left-width')) || 0;
				top += parseFloat(getComputedStyle(parent, null).getPropertyValue('border-top-width')) || 0;
			}
		}
		parent = parent.offsetParent;
	}
	delete(parent);
	return {'left':left, 'top':top, 'width':element.offsetWidth, 'height':element.offsetHeight}
}

function vTrim(arg_value) {
	return arg_value.toString().replace(/^[\s]+|[\s]+$/g, '');
}


var agt = '';
if (navigator.userAgent) { agt=navigator.userAgent.toLowerCase(); }
// *** BROWSER VERSION *** 
// note: on IE5, these return 4, so use is_ie5up to detect IE5. 
var is_major = parseInt(navigator.appVersion); 
var is_minor = parseFloat(navigator.appVersion); 
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) 
			&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) 
			&& (agt.indexOf('webtv')==-1)); 
var is_nav4 = (is_nav && (is_major == 4)); 
var is_nav4up = (is_nav && (is_major >= 4)); 
var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) || 
					  (agt.indexOf("; nav") != -1)) ); 
var is_nav5 = (is_nav && (is_major == 5)); 
var is_nav5up = (is_nav && (is_major >= 5)); 
var is_ie   = (agt.indexOf("msie") != -1); 
var is_ie3  = (is_ie && (is_major < 4)); 
var is_ie4  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) ); 
var is_ie4up  = (is_ie  && (is_major >= 4)); 
var is_ie5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) ); 
var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4); 

var imageZoom = {
	images : new Object(),
	zoomArea : null,
	mouse : {'left':0, 'top':0},
	displayImage : null,
	magnifyingGlass : null,
	magnifyingGlassImage : null,
	transparentOverlay : null,
	loadingArea : null,
	loadingAreaImage : null,
	iframe : null,
	fader : null,
	identity : -1,
	dontHide : true,
	activeProperties : {'image':null, 'zoomImage':null, 'imagePlacement':null, 'scaleX':0, 'scaleY':0, 'magnifyingGlassBorderWidth':0},
	matchImage : true,
	fadeSpeed : 15,
	fadeStrength : 5,
	offsetX : 0,
	offsetY : 0,

	init : function() {
		if (imageZoom.magnifyingGlass) {
			return;
		}
		imageZoom.magnifyingGlass =  document.createElement('div');
		imageZoom.magnifyingGlass.id = 'imageZoomMagnifier';
		imageZoom.magnifyingGlass.style.position = 'absolute';
		
		imageZoom.magnifyingGlassImage = document.createElement('img');
		imageZoom.magnifyingGlassImage.alt = '';
		imageZoom.magnifyingGlassImage.id = 'imageZoomMagnifierImage';
		imageZoom.magnifyingGlassImage.style.position = 'absolute';
		imageZoom.magnifyingGlassImage.onmousedown = protect_images2;
		imageZoom.magnifyingGlassImage.onmouseup = protect_images2;
		imageZoom.magnifyingGlass.appendChild(imageZoom.magnifyingGlassImage);
		
		imageZoom.zoomArea =  document.createElement('div');
		imageZoom.zoomArea.id = 'imageZoomArea';
		imageZoom.zoomArea.style.display = 'none';
		imageZoom.zoomArea.style.position = 'absolute';
		imageZoom.zoomArea.style.overflow = 'hidden';
		imageZoom.zoomArea.style.zIndex = 5;
		
		imageZoom.displayImage = document.createElement('img');
		imageZoom.displayImage.alt = '';
		imageZoom.displayImage.style.position = 'absolute';
		imageZoom.zoomArea.appendChild(imageZoom.displayImage);
		
		imageZoom.transparentOverlay = document.createElement('div');
		imageZoom.transparentOverlay.id = 'imageZoomTransparentOverlay';
		imageZoom.transparentOverlay.style.display = 'none';
		imageZoom.transparentOverlay.style.position = 'absolute';
		
		imageZoom.loadingArea = document.createElement('div');
		imageZoom.loadingArea.id = 'imageZoomLoadingArea';
		imageZoom.loadingArea.style.display = 'none';
		imageZoom.loadingArea.style.position = 'absolute';
		imageZoom.loadingArea.style.zIndex = '1';
		imageZoom.loadingArea.appendChild(imageZoom.loadingAreaImage);

		imageZoom.iframe = document.createElement('iframe');
		imageZoom.iframe.frameBorder = 0;
		imageZoom.iframe.style.display = 'none';
		imageZoom.iframe.style.position = 'absolute';
		imageZoom.iframe.style.zIndex = 4;

		document.body.appendChild(imageZoom.transparentOverlay);
		document.body.appendChild(imageZoom.magnifyingGlass);
		document.body.appendChild(imageZoom.zoomArea);
		document.body.appendChild(imageZoom.loadingArea);
		document.body.appendChild(imageZoom.iframe);
	},

	findZoomImage : function(src) {
		src = src.toLowerCase();
		src = src.replace('t.jpg', '.jpg');
		src = src.replace('-.jpg', '.jpg');
		src = src.replace('t.gif', '.gif');
		src = src.replace('-.gif', '.gif');
		return src;
	},

	filter : function(path) {
		return path.toLowerCase();
		return path.toLowerCase().replace(/[\.\-\:\/]/g, '');
	},

	add : function(element, largerImageURL) {
		element = v$(element);
		element.onmouseover = imageZoom.onmouseover;
		if (!imageZoom.loadingAreaImage) {
			imageZoom.loadingAreaImage = document.createElement('img');
			imageZoom.loadingAreaImage.src = 'http://www.fullpartner2.com/dbcAdmin/images/imageZoom.gif';
		}
		if (largerImageURL != null) {
			imageZoom.preloadImage(element.src, largerImageURL);
		}
		else {
			imageZoom.preloadImage(element.src, imageZoom.findZoomImage(element.src));
		}
		element.onload = null;
	},

	preloadImage : function(smallerImageURL, largerImageURL) {
		if (smallerImageURL && largerImageURL) {
			var smallImg = new Image();
			var largeImg = new Image();
			
			largeImg.onerror = function(event) {
				largeImg.onerror = null;
				largeImg.onload = null;
				largeImg = null;
			};
			largeImg.onload = function(event) {
				largeImg.onload = null;
				largeImg.loaded = true;
				if (imageZoom.activeProperties.zoomImage == largeImg) {
					imageZoom.loadingArea.style.display = 'none';
					imageZoom.activeProperties.image.onmouseover(event);
				}
			};
	
			smallImg.src = smallerImageURL;
			largeImg.src = largerImageURL;
	
			var imageIndex = imageZoom.filter(smallImg.src);
			if (!imageZoom.images[imageIndex]) {
				imageZoom.images[imageIndex] = largeImg;
			}
		}
	},

	fadeIn : function(opacity) {
		if (imageZoom.fader) {
			window.clearTimeout(imageZoom.fader);
			imageZoom.fader = null;
		}
		imageZoom.zoomArea.style.opacity = opacity / 100;
		imageZoom.zoomArea.style.filter = 'alpha(opacity=' + opacity + ')';
		imageZoom.iframe.style.opacity = opacity / 100;
		imageZoom.iframe.style.filter = 'alpha(opacity=' + opacity + ')';
		if (opacity < 100) {
			imageZoom.fader = window.setTimeout('imageZoom.fadeIn(' + (opacity + imageZoom.fadeStrength) + ');', imageZoom.fadeSpeed);
		}
	},
	
	onmouseover : function(event) {
		imageZoom.init();

		var imageIndex = imageZoom.filter(this.src);
		var zoomImage = imageZoom.images[imageIndex];

		if (zoomImage == null) {
			return;
		}

		var imagePlacement = vPlacement(this);

		AttachEvent(document, 'mousemove', imageZoom.onmousemove);

		imageZoom.activeProperties.image = this;
		imageZoom.activeProperties.zoomImage = zoomImage;
		imageZoom.activeProperties.imagePlacement = imagePlacement;

		if (zoomImage.loaded != true) {
			imageZoom.loadingArea.style.display = '';

			imageZoom.loadingArea.style.left = imagePlacement.left + imagePlacement.width / 2 - imageZoom.loadingAreaImage.offsetWidth / 2  + 'px';
			imageZoom.loadingArea.style.top = imagePlacement.top + imagePlacement.height / 2 - imageZoom.loadingAreaImage.offsetHeight / 2 + 'px';
			return;
		}
		else {
			imageZoom.loadingArea.style.display = 'none';
			if (imageZoom.displayImage.src != zoomImage.src) {
				imageZoom.displayImage.src = zoomImage.src;
			}
		}
		if (imageZoom.magnifyingGlassImage.src != this.src) {
			imageZoom.magnifyingGlassImage.src = this.src;
		}

		imageZoom.magnifyingGlass.style.display = '';
		imageZoom.zoomArea.style.display = '';
		imageZoom.transparentOverlay.style.display = '';

		var docWidth = document.documentElement.clientWidth || document.body.clientWidth;
		var docHeight = document.documentElement.clientHeight || document.body.clientHeight;

		if (imageZoom.matchImage) {
			imageZoom.zoomArea.style.width = imagePlacement.width + 'px';
			imageZoom.zoomArea.style.height = imagePlacement.height + 'px';
			var zoomImagePlacement = {'width':imageZoom.zoomArea.offsetWidth, 'height':imageZoom.zoomArea.offsetHeight};
			if (zoomImagePlacement.width > imagePlacement.width) {
				imageZoom.zoomArea.style.width = parseFloat(imageZoom.zoomArea.style.width) - (zoomImagePlacement.width - imagePlacement.width) + 'px';
			}
			if (zoomImagePlacement.height > imagePlacement.height) {
				imageZoom.zoomArea.style.height = parseFloat(imageZoom.zoomArea.style.height) - (zoomImagePlacement.height - imagePlacement.height) + 'px';
			}
		}

		var zoomImagePlacement = {'width':imageZoom.zoomArea.offsetWidth, 'height':imageZoom.zoomArea.offsetHeight};

		//try putting it to the right
		var x = imagePlacement.left + imagePlacement.width + imageZoom.offsetX;
		var y = imagePlacement.top + imageZoom.offsetY;
		if (x + zoomImagePlacement.width > docWidth) {
			//try putting it to the left
			x = imagePlacement.left - zoomImagePlacement.width - imageZoom.offsetX;
			y = imagePlacement.top - imageZoom.offsetY;
			if (x < 0) {
				//try putting it on bottom
				x = imagePlacement.left + imageZoom.offsetX;
				y = imagePlacement.top + imagePlacement.height + imageZoom.offsetY;
				if (y + zoomImagePlacement.height > docHeight) {
					//try putting it on top
					x = imagePlacement.left - imageZoom.offsetX;
					y = imagePlacement.top - zoomImagePlacement.height - imageZoom.offsetY;
					if (y < 0) {
						//if it fits no where, put it on the right
						x = imagePlacement.left + imagePlacement.width + imageZoom.offsetX;
						y = imagePlacement.top + imageZoom.offsetY;
					}
				}
			}
		}

		imageZoom.zoomArea.style.left = x + 'px';
		imageZoom.zoomArea.style.top = y + 'px';

		var scaleX = (imageZoom.displayImage.offsetWidth / imagePlacement.width);
		var scaleY = (imageZoom.displayImage.offsetHeight / imagePlacement.height);

		if (scaleY <= 1.2 || scaleX <= 1.2) {
			imageZoom.hide(null, true);
			return;
		}

		imageZoom.magnifyingGlassImage.onclick = function(event) {
			var event = window.event || event;
			if (imageZoom.activeProperties.image.onclick) {
				imageZoom.activeProperties.image.onclick(event);
			}
			else if (imageZoom.activeProperties.image.parentNode.nodeName.toUpperCase() == 'A') {
				var anchorTag = imageZoom.activeProperties.image.parentNode;
				if (anchorTag.href) {
					window.location.href = anchorTag.href;
				}
				if (anchorTag.onclick) {
					anchorTag.onclick(event);
				}
			}
		}

		if (imageZoom.magnifyingGlass.currentStyle) {
			imageZoom.activeProperties.magnifyingGlassBorderWidth = parseFloat(imageZoom.magnifyingGlass.currentStyle.borderTopWidth) || 0;
		}
		else if (document.defaultView && document.defaultView.getComputedStyle) {
			imageZoom.activeProperties.magnifyingGlassBorderWidth = parseFloat(document.defaultView.getComputedStyle(imageZoom.magnifyingGlass, null).getPropertyValue('border-top-width')) || 0;
		}
		else {
			imageZoom.activeProperties.magnifyingGlassBorderWidth = 0;
		}

		imageZoom.magnifyingGlass.style.width = (imageZoom.zoomArea.offsetWidth / scaleX) + imageZoom.activeProperties.magnifyingGlassBorderWidth + 'px';
		imageZoom.magnifyingGlass.style.height = (imageZoom.zoomArea.offsetHeight / scaleY) + imageZoom.activeProperties.magnifyingGlassBorderWidth + 'px';

		imageZoom.activeProperties.scaleX = scaleX;
		imageZoom.activeProperties.scaleY = scaleY;

		imageZoom.transparentOverlay.style.left = imagePlacement.left + 'px';
		imageZoom.transparentOverlay.style.top = imagePlacement.top + 'px';
		
		imageZoom.transparentOverlay.style.width = imagePlacement.width + 'px';
		imageZoom.transparentOverlay.style.height = imagePlacement.height + 'px';

		imageZoom.iframe.style.left = imageZoom.zoomArea.style.left;
		imageZoom.iframe.style.top = imageZoom.zoomArea.style.top;
		imageZoom.iframe.style.width = imageZoom.zoomArea.offsetWidth;
		imageZoom.iframe.style.height = imageZoom.zoomArea.offsetHeight;
		imageZoom.iframe.style.display = 'block';

		imageZoom.onmousemove(event);
		if (zoomImage.loaded) {
			imageZoom.fadeIn(1);
		}
	},
	
	hide : function(event, force) {
		var target;
		if (event && !force) {
			target = event.srcElement ? event.srcElement : event.target;
		}
		if (force || (target != imageZoom.loadingAreaImage && target != null && target != document && target != imageZoom.magnifyingGlass && target != imageZoom.activeProperties.image && target != imageZoom.magnifyingGlassImage && target != imageZoom.transparentOverlay)) {
			if (imageZoom.dontHide && target == imageZoom.images[imageZoom.filter(imageZoom.activeProperties.image.src)]) {
				imageZoom.dontHide = false;
			}
			else {
				imageZoom.dontHide = false;
				DetachEvent(document, 'mousemove', imageZoom.onmousemove);
				imageZoom.magnifyingGlass.style.display = 'none';
				imageZoom.zoomArea.style.display = 'none';
				imageZoom.transparentOverlay.style.display = 'none';
				imageZoom.loadingArea.style.display = 'none';
				imageZoom.iframe.style.display = 'none';
				imageZoom.mouse.left = 0;
				imageZoom.mouse.top = 0;
				imageZoom.activeProperties = {'image':null, 'zoomImage':null, 'imagePlacement':null, 'scaleX':0, 'scaleY':0, 'magnifyingGlassBorderWidth':0};
				return true;
			}
		}
		return false;
	},
	
	onmousemove : function(event) {
		var event = window.event || event;

		if (imageZoom.hide(event)) {
			return;
		}

		if (event.clientX) {
			var x = document.documentElement.scrollLeft || document.body.scrollLeft;
			var y = document.documentElement.scrollTop || document.body.scrollTop;
			x += event.clientX;
			y += event.clientY;
		}
		else {
			var x = imageZoom.mouse.left;
			var y = imageZoom.mouse.top;
		}

		imageZoom.mouse.left = x;
		imageZoom.mouse.top = y; 

		var imageIndex = imageZoom.filter(imageZoom.activeProperties.image.src);
		if (imageZoom.images[imageIndex].loaded != true) {
			return;
		}

		var magnifyingGlass = imageZoom.magnifyingGlass;

		var magnifyingGlassPlacement = {'width':magnifyingGlass.offsetWidth, 'height':magnifyingGlass.offsetHeight};
		var imagePlacement = imageZoom.activeProperties.imagePlacement;
		
		x -= magnifyingGlassPlacement.width / 2;
		y -= magnifyingGlassPlacement.height / 2;

		if (x < imagePlacement.left) {
			x = imagePlacement.left;
		}
		else if (x + magnifyingGlassPlacement.width > imagePlacement.left + imagePlacement.width) {
			x = imagePlacement.left + imagePlacement.width - magnifyingGlassPlacement.width;
		}
		else {
		}
		if (y < imagePlacement.top) {
			y = imagePlacement.top;
		}
		else if (y + magnifyingGlassPlacement.height > imagePlacement.top + imagePlacement.height) {
			y = imagePlacement.top + imagePlacement.height - magnifyingGlassPlacement.height;
		}
		magnifyingGlass.style.left = x + 'px';
		magnifyingGlass.style.top = y + 'px';

		x -= imagePlacement.left;
		y -= imagePlacement.top;

		if (x < 0) {
			x = 0;
		}
		if (y < 0) {
			y = 0;
		}

		x += imageZoom.activeProperties.magnifyingGlassBorderWidth;
		y += imageZoom.activeProperties.magnifyingGlassBorderWidth;

		var scaleX = imageZoom.activeProperties.scaleX;
		var scaleY = imageZoom.activeProperties.scaleY;

		imageZoom.displayImage.style.left = -x * scaleX + 'px';
		imageZoom.displayImage.style.top = -y * scaleY + 'px';
		
		imageZoom.magnifyingGlassImage.style.left = parseFloat(imagePlacement.left) - parseFloat(imageZoom.magnifyingGlass.style.left) - imageZoom.activeProperties.magnifyingGlassBorderWidth + 'px';
		imageZoom.magnifyingGlassImage.style.top = parseFloat(imagePlacement.top) - parseFloat(imageZoom.magnifyingGlass.style.top) - imageZoom.activeProperties.magnifyingGlassBorderWidth + 'px';
	}
}

function sprops(element) {
	var p;
	var txt = '';
	for (p in element) {
		txt += '<br />' + p + ':';
		try {txt += element[p]} catch(e) {}
	}
	var div = document.createElement('div');
	div.innerHTML = txt;
	document.body.appendChild(div);
}