// <![CDATA[

var domain = 'http://www.europeanflooring.ca/';

Cufon.replace('.replaceme');
			
Prototype.Browser.IE6 =
	Prototype.Browser.IE &&
	parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5)) == 6;
			
Prototype.Browser.IE7 =
	Prototype.Browser.IE &&
	parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5)) == 7;

function domLoaded(pageName) {
	Cufon.now();
	
	var e, t, v;
	var tmp = 1;
	tmp = document.getElementById('wrapper-two');
	$('two').select('.has-hover').each(function (s) {
		e = s.next();
		
		s.observe('mouseover', showHover.bindAsEventListener(s));
		s.observe('mouseout', hideHover.bindAsEventListener(s));

		v = e.select('.has-secondhover');
		if(v.size()){
			v.each(function (z) {
			  x = z.next();
			  
			  z.observe('mouseover',showSecondHover.bindAsEventListener(z));
			  
			  x.observe('mouseover',showSecondHover.bindAsEventListener(z));
			  /*x.observe('mouseout',hideSecondHover.bindAsEventListener(z));*/
			  
			  x.setStyle({ top: (z.ancestors().first().cumulativeOffset().top) + 'px',
		                   left: (z.cumulativeOffset().left + 130) + 'px'
						 });
			});
		}
		else{
			e.observe('mouseover', showHover.bindAsEventListener(s));
		    e.observe('mouseout', hideHover.bindAsEventListener(s));
		}
        
		/*
		t = $('wrapper-two').cumulativeOffset().top + $('wrapper-two').getHeight();
		t = 127;		
		e.setStyle({
			top: t + 'px',
			left: (s.cumulativeOffset().left) + 'px'			
		});
		*/
	});
	
	document.observe('mousedown', function (evnt) {
		if (evnt.button == 2) {			
			evnt.stop();
			if (Prototype.Browser.IE)
				alert('Right click is disabled');			
			return false;
		}
	});
	
	document.observe('click', function (evnt) {
		if (evnt.button == 2) {			
			evnt.stop();					
			return false;
		}
	});
	
	
	document.oncotextmenu = function() { return false; };	
	
	var hSlider;
	
	$('logo').observe('mouseover',function(evnt){ Tip("Home"); });
	$('logo').observe('mouseout',function(evnt) { UnTip(); });
	
	if(pageName == "portfolio"){		
	}
	else if(pageName == "ads"){
		autoScroll('flow-container', 'flow-container')
	}else if(pageName == "articles"){
		if(typeof headerType != 'undefined' && headerType == 'slide')
		{
			$('heading-wrapper').setStyle('height:'+$('heading-wrapper').down().height+'px;');
			hSlider = new headerSlide(slideImgs,duration);
		}
	}
	
	if(typeof headerType != 'undefined' && headerType == 'slide')
	{
		$('heading-wrapper').setStyle('height:'+$('heading-wrapper').down().height+'px;');
		hSlider = new headerSlide(slideImgs,duration);
	}
	
	var items = $$('.item');
	var hoverItems = $$('.hover-item');
	items.each(function(s){
		$link = s.readAttribute('rel');
		if($link){
			s.observe('mouseover',function(evt){
				document.body.style.cursor = 'pointer';
			});
			s.observe('mouseout',function(evt){
				document.body.style.cursor = 'default';
			});
			s.observe('click',function(evt){
				document.location = domain + this.readAttribute('rel');
			});
		}
	});
	hoverItems.each(function(s){
		s.childElements('.link').each(function(l){
			$link = l.readAttribute('rel');
			if($link){
				l.observe('mouseover',function(evt){
					document.body.style.cursor = 'pointer';
				});
				l.observe('mouseout',function(evt){
					document.body.style.cursor = 'default';
				});
				l.observe('click',function(evt){
					document.location = domain + this.readAttribute('rel');
				});
			}
		});
	});
}

function portfolioInit() {
	$('three-point-one').select('.nav li').each(function (s) {
		  s.observe('click', changeTabs.bind(s)).setStyle({ cursor: 'pointer' });
		});
						
		// Make content auto-scrollable
		autoScroll('itembar-1', ['left-1', 'right-1'], 350);
		autoScroll('next-images', 'next-images', 300);
						
		var pos = $('itembar-1-bg').cumulativeOffset();
		var dim = $('itembar-1-bg').getDimensions();
						
		// Move the arrows into place
		$('left-1').setStyle({
			top: (pos.top + dim.height / 2 - 30) + 'px',
			left: (pos.left) + 'px',
			zIndex: 5
		});
					
		$('right-1').setStyle({
			top: (pos.top + dim.height / 2 - 30) + 'px',
			left: (pos.left + dim.width - 30) + 'px',
			zIndex: 5
		});
						
		// Rounded corners
		$('left-corner').setStyle({
			top: (pos.top + dim.height - 17) + 'px',
			left: (pos.left) + 'px',
			zIndex: 5
		});
						
		$('right-corner').setStyle({
			top: (pos.top + dim.height - 12) + 'px',
			left: (pos.left + dim.width - 17) + 'px',
			zIndex: 5
		});
						
		var extra = 0;
		if (Prototype.Browser.IE6)
			extra = 3; // IE6 3 pixel bug
						
		// Dynamically adjust the autoscroll on the number of items
		$('scroll-1').setStyle({
			width: ($('scroll-1').childElements().length * 160 + extra) + 'px'
		});		
}

/*
var allLoaded = function() {
	// reposition the shadow,
	// just in case someone decides
	// to move the top nav around
//	$('shadow').setStyle({
//		top: ($('wrapper-two').cumulativeOffset().top + $('wrapper-two').getHeight()) + 'px'
//	});
	
	$('preload').hide();
};
*/

var hoverHandle;

var showSecondHover = function (evnt){
	var s = this, c = s.next(), p = s.ancestors().first();
	
	if (typeof(hoverHandle) != 'undefined')
		window.clearTimeout(hoverHandle);
	
	$('two').select('.hover-item').invoke('hide');
	
	p.show();
	c.show();
};

var hideSecondHover = function(evnt) {
	var s = this, e = s.next(), p = s.ancestors().first();
	
	window.setTimeout(
		"$('" + e.identify() + "').hide();",
		1000
	);
};

var showHover = function (evnt) {
	var s = this, e = s.next();
	
	if (typeof(hoverHandle) != 'undefined')
		window.clearTimeout(hoverHandle);
	
	$('two').select('.hover-item').invoke('hide');
	
	e.show();
};

var hideHover = function (evnt) {
	var s = this, e = s.next();
	
	hoverHandle = window.setTimeout(
		"$('" + e.identify() + "').hide();",
		1000
	);
};

//---------------advertisement page flow width -----------------------//
function setFlowWidth(num){
	$('flow').setStyle('width:'+num*350+'px;');
}

// _______________ horizontal scroller _______________ //

function mouseX(evt) {
	if (evt.pageX)
		return evt.pageX;
	else if (evt.clientX)
		return evt.clientX + (document.documentElement.scrollLeft ?
			document.documentElement.scrollLeft :
			document.body.scrollLeft);
	else return 0;
};

function mouseY(evt) {
	if (evt.pageY)
		return evt.pageY;
	else if (evt.clientY)
		return evt.clientY + (document.documentElement.scrollTop ?
			document.documentElement.scrollTop :
			document.body.scrollTop);
	else return 0;
};

var sinh = function (x) {
	return (Math.exp(x) - Math.exp(-x)) / 2;
};


var autoScroll = function (scrollElem, hotSpot) {
	// Horizontal scroller
	//
	// Requires prototype.js
	//
	// Designed by Alexander Huynh
	// 2009-08-19
	//
	// Description:
	// Scrolls exponentially quicker to the left or to the right relative to the cursor
	// position from the center of the outer div, when the cursor is placed over certain
	// hotspots
	//
	// Syntax:
	// autoScroll( outerDiv , hotSpot [, limiter ] )
	//
	// outerDiv is a div with scrollable content in the x direction
	//
	// hotSpot is the id, object, array of ids, or hash of objects who's dimensions
	// will be a hotspot to cause outerDiv to scoll. The direction and intensity of the
	// scroll is proportional to the distance from outerDiv's center (i.e. placing
	// a hotspot to the far left of outerDiv's center will cause outerDiv to scroll left
	// very quickly). hotSpot can even be scrollElem.
	//
	// limiter is an optional integer which will be used to slow down the scrolling speed.
	// The higher 'limiter' is, the slower it will scroll
	//
	// Basic usage:
	// 1. Create two divs, one contained within the other (ex: #div-outer and #div-inner)
	//
	// 2a. Make #div-inner wider than #div-outer, using CSS or whatnot
	//     Set the overflow of #div-outer to auto or hidden, to create scrollable content
	//
	// OR
	//
	// 2b. Use CSS's "white-space: nowrap;" on the outer div ot prevent white-space wrapping
	//
	// 3. Create more elements to be used as hotspots (ex: #arrow-left and #arrow-right)
	//
	// 3. Call autoScroll when the DOM is ready. Ex:
	//     	document.observe(
	//     		'dom:loaded',
	//      	function () {
	//     			autoScroll('div-outer', [ 'arrow-left', 'arrow-right' ])
	//      	}
	//    	);
	
	var scrollHandle;
	var lastFired = (new Date()).getTime();
	var hotSpots = (typeof(hotSpot) == 'string') ? [ hotSpot ] : hotSpot;
	
	var limiter = 200;
	if (arguments[2] && typeof(arguments[2]) == 'number')
		limiter = arguments[2];
	
	var track = function (evnt) {
		if ($('overlay') && $('overlay').style.display != 'none')
			// Freeze on lightbox
			return;
		
		var elem = this;
		
		var x = mouseX(evnt);
		var y = mouseY(evnt);
		var scrollOffset;
		var scrollInterval = 5; // in milliseconds
		
		var pos, dim, inAHotSpot = false;
		
		hotSpots.each(function (s) {
			s = $(s);
			
			if(s) {
				pos = s.cumulativeOffset();
				dim = s.getDimensions();
				if (
					/* Check to see that we're inside the boundaries*/
					x >= pos.left &&
					x <= pos.left + dim.width &&
					y >= pos.top &&
					y <= pos.top + dim.height
				) {
					inAHotSpot = true;
					throw $break;
				}				
			}
		});
		
		if (inAHotSpot) {
			
			// exponential scroll distance
			scrollOffset = sinh(
				(x - elem.cumulativeOffset().left - elem.getWidth() / 2)
			//  ^-- center                  
				/ parseFloat(limiter)) + 0.5;
			//    ^-- speed limiter      ^-- center fix
			
			if (typeof(scrollHandle) != 'undefined')
				window.clearInterval(scrollHandle);
				
			if ((new Date()).getTime() - lastFired > scrollInterval) {
				lastFired = (new Date()).getTime();
				
				elem.scrollLeft += scrollOffset;
			}
			
			scrollHandle = window.setInterval(
				"$('" + elem.identify() + "').scrollLeft += " + scrollOffset + ";",
				scrollInterval
			);
		}
		else if (typeof(scrollHandle) != 'undefined')
			window.clearInterval(scrollHandle);
	};
	
	var hold = function (evnt) {
		if (typeof(scrollHandle) != 'undefined')
			window.clearInterval(scrollHandle);
	};
	
	// init
	element = $(scrollElem);
	
	document.observe(
		'mousemove',
		track.bind(element)
	);
	
	element.observe(
		'mousedown',
		hold.bind(element)
	);
	
	hotSpots.each(function (s) {
		s = $(s);
		
		s.observe(
			'mousedown',
			hold.bind(element)
		);
	});
};

// _______________ END horizontal scroller _______________ //

// _______________ header slide show ____________________//
var headerSlide = Class.create({
	initialize: function(imgs,duration){
		this.duration = duration + 3.0;
		this.imgs = Element.extend(imgs);
		this.slide = new Array();
		this.currentIdx = 0;		
		new PeriodicalExecuter(this.cycle.bind(this), this.duration);
	},
	
	cycle: function (pe) {
		var nxt;
		this.currentImg = this.imgs[this.currentIdx];
		if(this.currentIdx == this.imgs.length - 1)
		  nxt = this.imgs[0];
		else
		  nxt = this.imgs[this.currentIdx + 1];
		
		pos = $('heading-wrapper').cumulativeOffset();
		
		$('heading-wrapper').insert(
		     new Element(
			     'img', {
					 'src' : "assets/u/" + nxt,
					 'style':'position:absolute;top:'+pos.top+'px;left:'+pos.left+'px;'
				 }
			 ).hide()
		);		
		
		var appearTime = 1.5;
		Effect.Fade($('heading-wrapper').down(), {duration:appearTime, afterFinish: this.killold.bind(this)});		
		/*
		Effect.Appear($('heading-wrapper').down().next(), {
			duration: appearTime,
			afterFinish: this.killold.bind(this)
		});
		*/
	},

	killold: function () {		
	    Effect.Appear($('heading-wrapper').down().next(), {duration:1.5});
		$('heading-wrapper').removeChild($('heading-wrapper').down());
		if(this.currentIdx == this.imgs.length - 1)
		  this.currentIdx = 0;
		else
		  this.currentIdx += 1;
	}
});

// _______________ END slideshow _______________ //



// _______________ slideshow _______________ //

var slideShow = Class.create({
	// Effect.Appear slideshow
	//
	// Needs script.aculo.us and consequently, prototype.js
	//
	// Designed by Alexander Huynh
	// 2009-08-20
	//
	// Description:
	// Uses Effect.Appear to load images randomly or in sequence, using
	// either a fixed time interval or a random value within a time range.
	//
	// Note 1:
	// The contents of the container will be wiped prior to the slideshow
	//
	// Note 2:
	// Because there'll be nothing in the container, its dimensions will be minimal, so
	// be sure to assign at least a height to the container
	//
	// Note 4:
	// This script will assign the container with "position: relative;"
	//
	// Syntax:
	// slideShow( container , type , time, images )
	//
	// container is a string of the id of the container div,
	// or the div object itself
	//
	// type is a string with either 'ordered' or 'random', which will make the slideshow
	// progress either sequentially or randomly
	//
	// time is either a number (which results in a fixed delay between fadeins), or an
	// array containing two numbers (which results in a variable delay with a range between
	// the two aforementioned numbers)
	//
	// images is an array of strings containing the paths of the images to be included in the
	// slideshow. The paths are relative to the calling function.
	//
	// Basic usage:
	// 1. Create a div with a unique id (ex: use-me)
	//
	// 3. Call slideShow. Ex:
	//      slideShow(
	//      	'use-me',
	//      	'random',
	//      	1.5,
	//      	[ 'img/0.png', 'img/1.png', 'img/5.png' ]
	//      );
	/*
	initialize: function (elm, ord, tme, img, start) {
		if (!$(elm))
			throw "Could not find the slideshow container.";
		
		else if (ord.toLowerCase() != 'ordered' && ord.toLowerCase() != 'random')
			throw "Invalid slideshow order. Please use 'ordered' or 'random'.";
		
		else if (typeof(tme) != 'number' && typeof(tme) != 'object')
			throw "Unsupported time format.";
		
		else if (typeof(tme) == 'object' && (typeof(tme[0]) != 'number' || typeof(tme[1]) != 'number'))
			throw "Unsupported time range.";
		
		else if (typeof(img) != 'object')
			throw "Please supply an array of stings, which contain the urls to the images.";
		
		this.elm = $(elm).setStyle({ position: 'relative' }).update();
		this.ord = ord.toLowerCase();
		this.tme = tme;
		this.img = Element.extend(img);
		this.cur = (this.ord == 'ordered') ? this.img[0] : this.img[Math.floor(Math.random() * this.img.length)];
		this.lst = new Array();
		
		this.elm.insert(
			new Element(
				'img', {
					'src': this.cur,
					'style': 'position: absolute; top: 0; left: 0;'
				}
			)
		);
		
		if (typeof(this.tme) == 'number') {
			new PeriodicalExecuter(this.cycle.bind(this), this.tme);
		}
		else
			new PeriodicalExecuter(this.cycle.bind(this), Math.random() * (this.tme[1] - this.tme[0]) + this.tme[0]);
	},
	*/
	initialize: function(ord,tme,img){
		this.tme = tme;
		this.img = Element.extend(img);
		this.slide = new Array();
		this.currentImg = new Array();
		for(i = 0; i < 3; i++)
		{
			this.slide[i] = $('slide-'+i).setStyle({ position:'relative'}).update();
			this.currentImg[i] = i;
			this.slide[i].insert(
			  new Element(
			    'img', {
					'src': this.img[i],
					'style':'position: absolute; top:0; left:0;'
				}
		      )
		    );
		}
		this.cur = 0;
		new PeriodicalExecuter(this.cycle.bind(this), this.tme);
	},
	/*
	cycle: function (pe) {
		var nxt;
		if (this.ord == 'ordered')
			nxt = this.img[(this.img.indexOf(this.cur) + 1) % this.img.length];
		else {
			if (this.lst.length == 0) {
				// the randomly ordered queue is empty, regenerate
				var tmp = this.img.clone();
				
				while (tmp.length > 0)
					this.lst.push(tmp.splice(Math.floor(Math.random() * tmp.length), 1));
			}
			
			nxt = this.lst.splice(Math.floor(Math.random() * this.lst.length), 1);
		}
		
		this.elm.insert(
			new Element(
				'img', {
					'src': nxt,
					'style': 'position: absolute; top: 0; left: 0;'
				}
			).hide()
		);
		
		this.cur = nxt;
		
		var appearTime = (this.tme < 2) ? this.tme / 2 : 1.0;
		
		Effect.Appear(this.elm.down().next(), {
			duration: appearTime,
			afterFinish: this.killold.bind(this)
		});
		
		if (typeof(this.tme) == 'object') {
			pe.stop();
			new PeriodicalExecuter(this.cycle.bind(this), Math.random() * (this.tme[1] - this.tme[0]) + this.tme[0]);
		}
	},
	*/
	cycle: function (pe) {
		var nxt;
		this.currentImg[this.cur] = (this.currentImg[this.cur] + 3) % 6;
		nxt = this.img[this.currentImg[this.cur]];
		
		this.slide[this.cur].insert(
		     new Element(
			     'img', {
					 'src' : nxt,
					 'style':'position:absolute;top:0;left:0;'
				 }
			 ).hide()
		);		
		
		//var tmp = this.slide[this.cur].down();
		var tmp = this.slide[this.cur].down().next();
		
		var appearTime = 3.0;
		Effect.Appear(this.slide[this.cur].down().next(), {
			duration: appearTime,
			afterFinish: this.killold.bind(this)
		});
	},
	/*
	killold: function () {
		this.elm.removeChild(this.elm.down());		
	}
	*/
	killold: function () {		
		this.slide[this.cur].removeChild(this.slide[this.cur].down());
		if(this.cur < 2)
		  this.cur += 1;
		else
		  this.cur = 0;
	}
});

// _______________ END slideshow _______________ //

var frm = '';
function get_products() {
	var fe = $('ps_form').elements;
	frm = $('product_selector').innerHTML;
	new Ajax.Request('templates/helpers/product_selector.php', {
		method: 'post',
		parameters: {
			color: fe.namedItem('color').value,
			width: fe.namedItem('width').value,
			type: fe.namedItem('type').value,
			features: fe.namedItem('features').value
		},
		onSuccess: function(transport) {
			$('product_selector').innerHTML = transport.responseText;
		},
		onLoading: function(transport) {
			$('product_selector').innerHTML = '<center><strong>Searching...</strong></center>';
		}
	});
};

function getProducts() {
	var form = $('searchOptions').elements;
	new Ajax.Request('templates/helpers/get_products.php', {
					 method: 'post',
					 parameters: {
						 color: form.namedItem('color').value,
						 width: form.namedItem('width').value,
						 price: form.namedItem('price').value
					 },
					 onSuccess: function(transport) {
						 $('resultsPanel').innerHTML = transport.responseText;
						 var num = $('resultsPanel').select('#productInfo');
						 var txt = $('resultTxt').down('p')
						 txt.update(num.length + " Floor products matched your criteria :");
					 },
					 onLoading: function(transport) {
						 $('resultsPanel').innerHTML = '<center><strong>Searching...</strong></center>';
					 }
				});	
}

function setHeight(num){
	var lines = (num%3)?(num/3)+1:(num/3);
	var height = lines*100 + 310;
	var offsetHeight = $('descContainer').offsetHeight;
	
	if(height > offsetHeight){
		$('descContainer').setStyle('height:'+height+'px;');
	}
}

function loadTabBox(which) {
					new Ajax.Request('templates/helpers/functions_portfolio.php', {
						method: 'post',
						parameters: {
							type_id:which
						},
						onSuccess: function(transport) {
							$('scroll-1').update(transport.responseText);							
						},
						onLoading: function(transport) {
							$('scroll-1').innerHTML = '<div align="center"><strong>Loading...</strong></div>';
						},
						onComplete: function(transport){
							var extra = 0;
                            if (Prototype.Browser.IE6)
                    			extra = 3; // IE6 3 pixel bug
							$('scroll-1').setStyle({
			                     width: ($('scroll-1').childElements().length * 190 + extra) + 'px'
		                    });
			                jaxProj($('defaultID').value);							
						}
					});					
				}
				
var lastTab = 3;
				
				var changeTabs = function (evnt) {
					var colours = [ '666465', '524e51', '434142' ];
					var which = parseInt(this.id.substring(this.id.length - 1));
					
					if ((which + 1) != lastTab)
						$('three-point-one').down('.nav').setStyle({
							backgroundImage: 'url("assets/images/portfolio/navbar-short-light-' + lastTab + '-' + (which + 1) + '.png")'
						});
					
					lastTab = which + 1;
					
					$('itembar-1-bg').setStyle({
						backgroundColor: '#' + colours[which]
					});
					
					$('itembar-1').select('.item').invoke('stopObserving');
					
					$('scroll-1').update();

					loadTabBox(which+1);					



/*
					// AJAX call should go here
					for (var i = 0; i < 12; i++) {
						$('scroll-1').insert(
							new Element('div', {
								'class': 'item',
								'onmouseover': 'this.addClassName(\'hilight\')',
								'onmouseout': 'this.removeClassName(\'hilight\')',
							}).insert(
								new Element('div', { 'class': 'bordered' }).insert(
									new Element('a', {
										'href': 'javascript:void(0);',
										'onclick': 'jaxProj(this.down().readAttribute(\'alt\'));'
									}).insert(
										new Element('img', {
											'src': 'assets/images/portfolio/items/' + Math.floor(Math.random() * 6) + '.png', // TEMP
											'alt': Math.floor(Math.random() * 6) // TEMP
										})
									)
								).setStyle({ borderColor: '#' + colours[which] })
							).insert(
								new Element('span').update('Text text') // TEMP
							)
						);
					}
*/					
				};
				
var preload;
				
				for (var i = 1; i <= 3; i++) {
					for (var j = 1; j <= 3; j++) {
						if (i == j)
							continue;
						
						preload = new Image();
						preload.src = 'assets/images/portfolio/navbar-short-light-' + i + '-' + j + '.png';
					}
				}
				
				jaxProj = function (id) {
					var bottom = $('bottom');
					new Ajax.Updater($('bottom'),'templates/helpers/load_project.php', {
					//new Ajax.Request('templates/helpers/load_project.php', {
						method: 'post',
						parameters: {
							proj_id:id
						},
						onSuccess: function(transport) {
							$('bottom').innerHTML = transport.responseText;
						},
						onLoading: function(transport) {
							$('bottom').innerHTML = '<div align="center"><strong>Loading...</strong></div>';
						},
						evalScripts:true
					});
				};
				
				makeBig = function (elm,llm,id_img) {
					/*
					$('cur-image').down('img').src = elm.src;
					$('cur-image').down('a').href = elm.src;
					*/
					var anchorTag = $('cur-image').down('a');
					var anchorImg = $('cur-image').down('img');
					if(anchorImg != null){
						anchorImg.remove();						
					}
					if(anchorTag != null){
						anchorTag.remove();
					}
					//$('cur-image').down('img').src = "http://draft.livecms.biz/europeanflooring/assets/u/" + elm;					
					var lSrc = "assets/u/" + llm;
	 			    var sSrc = "assets/u/" + elm;
					if(llm != ""){					  					  
					  //anchorTag = new Element('a', {href : lSrc, rel : 'lightbox[largeImg]', id : 'lightboxLink'});
					  anchorImg = new Element('img', {src : sSrc, id : 'productSmallImg', onclick : 'triggerLB(' + id_img + ');return false;', style : 'cursor:pointer;' });
					  //anchorTag.insert({top : anchorImg});
					  $('cur-image').insert({top : anchorImg});					  
					}else
					{
                      anchorImg = new Element('img', {src : sSrc, id : 'productSmallImg' });
					  $('cur-image').insert({top : anchorImg});					  
					}
					/*
					$$('#lg-image-links a').each(function(el,idx) {
						el.rel = (id_img != idx) ? 'lightbox[largeImg]' : '';
					});
					*/
				};
				
function triggerLB(id_image)
{
	$('lightbox_trigger' + id_image).simulate('click');
}

function loadDefaultImage(id)
{
	if($('bottom') != null)
	{
		jaxProj(id);
	}
}
// ]]>
