
	function Zoom(xlink,x,y){
		x1=x+20;
		y1=y+40;
		window.open(xlink,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,height='+y1+',width='+x1);
	}
	
	function checkVisibility(id, imgid, imgover, imgout) {
		var block = document.getElementById(id);
		var treeimg = document.images(imgid);
		if (block) {
			if (block.style.display == 'none') {
				block.style.display = 'block';
				treeimg.src = imgout;
			} else {
				block.style.display = 'none';
				treeimg.src = imgover;
			}
		}
	}
	
	function Check(element, quantity) {

		if (element.value<0) element.value=element.value*-1;
		if (isNaN(element.value) || (element.value=='-') || (element.value>quantity)) {
			element.value = element.getAttribute('last-acceptable-value');
		} else if (element.value=='') {
			element.value = '0';
		} else {
			element.setAttribute('last-acceptable-value', element.value);
		}
		
		return true;
		
	}
	
	function imgPreload(imgOverSrc, imgOutSrc) {
		imgOver = new Image();
		imgOver.src = imgOverSrc;
		imgOut = new Image();
		imgOut.src = imgOutSrc;	
	}
	
	function imgover(imgname) {
		imgname.src = imgOver.src;
	}
	
	function imgout(imgname) {
		imgname.src = imgOut.src;
	} 

	function getRefToDivMod( divID, oDoc ) {
		if( !oDoc ) { oDoc = document; }
		if( document.layers ) {
			if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
				for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
					y = getRefToDivNest(divID,oDoc.layers[x].document); }
				return y; } }
		if( document.getElementById ) { return oDoc.getElementById(divID); }
		if( document.all ) { return oDoc.all[divID]; }
		return document[divID];
	}
	
	function resizeWinTo( idOfDiv ) {
		var oH = getRefToDivMod( idOfDiv ); if( !oH ) { return false; }
		var oW = oH.clip ? oH.clip.width : oH.offsetWidth;
		var oH = oH.clip ? oH.clip.height : oH.offsetHeight; if( !oH ) { return false; }
		var x = window; x.resizeTo( oW + 200, oH + 200 );
		var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;
		if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }
		else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }
		else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }
		if( window.opera && !document.childNodes ) { myW += 16; }
		x.resizeTo( oW + ( ( oW + 200 ) - myW ), oH + ( (oH + 200 ) - myH ) );
		focus();
	}

	
	// image banners script block for general catalogue mc3 -->
	// uID - unique ID
	// fID - first ID of item loaded in template
	bannerImgs = new Array();

	function _update(uID, fID, ID, path, paramID, isLink) {
		
		imgObj = document.getElementById('imgBanner_' + uID + '_' + fID);
		imgObj.src = bannerImgs[uID][fID][ID].src;
		
		if (isLink) {
			linkObj = document.getElementById('linkBanner_' + uID + '_' + fID);
			linkObj.href = path + '/~params=' + paramID + ":" + ID;
		}
		
	}
	
	function repl(uID, fID, timeout, path, paramID, isLink) {
		
		var i = 0;
		
		for (ID in bannerImgs[uID][fID]) {
			//alert('uID=' + uID + '\nfID=' + fID + '\nID=' + ID + '\npath=' + path + '\nparamID=' + paramID + '\nisLink=' + isLink);
			setTimeout("_update(" + uID + ", " + fID + ", " + ID + ", '" + path + "', " + paramID + "," + isLink + ")", timeout*i);
			i++;
		}
		
	}
	
	function changeImgSrc(imgTimeout, uID, fID, path, paramID, isLink) {
		
		var num = 0;
//		var imgTimeout = 2000;
		
		for (ID in bannerImgs[uID][fID]) {
			num++;
		}
		
		repl(uID, fID, imgTimeout, path, paramID, isLink);
		setTimeout("changeImgSrc(" + imgTimeout + ", " + uID + ", " + fID + ", '" + path + "', " + paramID + "," + isLink + ")", num*imgTimeout);
		
	}
    
	// <-- image banners script block for general catalogue mc3
	
function ch_over(id) {
	var a = document.getElementById('a_' + id);
	a.style.color = '#0E994A';
	var td = document.getElementById('td_' + id);
	td.style.backgroundColor = "#B2D8C3";
}
function ch_out(id) {
	var a = document.getElementById('a_' + id);
	a.style.color = '#FFFFFF';
	var td = document.getElementById('td_' + id);
	td.style.backgroundColor = "#51B591";
}