/*!
 * Vornado CES - JavaScript
 * Copyright 2009. All rights reserved.
 */


/*
 * Mooquee 	  - mootools <marquee> tag replacement
 * Version	  - 1.1
 * Created By - Robert Inglin
 * Homepage   - http://robert.ingl.in/mooquee
 * Thanks to  - *mltsy* of Mooforum.net who wrote rewrote the 
		    transition system to allow in and out style 
		    transitions and included the fade transition
 * License    - MIT License Agreement

Copyright (c) 2008 Robert Inglin

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
 */

Mooquee = new Class({
	Implements: [Options],

	options: {
		element: 'mooquee',
		cssitem: 'mooquee_item',
		firstitem:0,
		trans:{'tin':'up', 'tout':'fade'}, //each transition is up, down, left, right, fade
		pause: 1, //seconds (keep pause equal or higher to duration to allow time for items to reset) -1 = infinite pause/no loop
		duration: 1, //number of seconds to move marquee items
		overflow:'hidden', //if your item flows over how do you want to handle it. Auto(scroll) or Hidden work best...
		startOnLoad:true, // will start marquee when loaded
		pauseOnHover: true, //if true will pause all animations while mouse is hovering
		onTransitionStart: function(){},// Executes on transition start
		onTransitionComplete: function(){} // Executes on transition completion
	},
	initialize: function(options){
		this.setOptions(options);
        	this.itemFXs = [];
       	this.outDelay = 0;
        	this.inDelay = 0;
		this.started = false;
		this.currentitem = this.options.firstitem;
		if(this.options.pause!=-1)
			this.loop = true;
		else{
			this.loop = false;
			this.options.pause =2;	
		}
		this.previousitem=-1;
		if (typeof(this.options.trans) == "string") this.options.trans = {'tin':this.options.trans, 'tout':this.options.trans};
		
		window.addEvent('domready', function() {
			//get all mooqueeItems
			
			this.items = $$('#' + this.options.element + ' .' + this.options.cssitem);
			this.totalitems = this.items.length;
			if($(this.options.element).style.overflow != 'hidden')
				$(this.options.element).style.overflow = 'hidden';
			if($(this.options.element).style.position != 'relative')
				$(this.options.element).style.position = 'relative'; 

			this.setMooqueeFXs();
			this.setTrans(this.options.trans);//has setMooqueeItems in it

			if(this.options.startOnLoad)
				this.loopTimer = this.mooveAll.delay(this.options.pause*1000 ,this);
			if(this.options.pauseOnHover){
				$(this.options.element).addEvent('mouseover',function(){this.pauseMooquee()}.bind(this));
				$(this.options.element).addEvent('mouseout',function(){this.resumeMooquee()}.bind(this));
			}
		}.bind(this));
		
		
	},
	setMooqueeItems: function(){
		this.resetting =true;
		var i=0;
		
		this.items.each(function (element){
			if($(element).style.position != 'absolute')
				$(element).style.position = 'absolute';
			$(element).style.width = $(this.options.element).clientWidth + 'px';
			$(element).style.overflow = this.options.overflow;

			if(i == this.currentitem)
				this.itemFXs[i].set(this.resetStyle).set(this.inStyle);
			else
				this.itemFXs[i].set(this.resetStyle).set(this.startStyle);
           
			i++;
		}.bind(this));

		this.resetting =false;
	},
	setMooqueeFXs: function(){
		var i=0;
		this.items.each(function (element){
			this.itemFXs[i] = new Fx.Morph(element,{duration:(this.options.duration*1000)});
			i++;
		}.bind(this));
	},
	mooveAll: function(){
		if((this.currentitem + 1) == this.totalitems)
			citem = 0;
		else
			citem = this.currentitem + 1;
		this.moove(citem);

	},
	moove: function(itemnumber){
		if(itemnumber < this.totalitems)
		if(!this.mousedOver){
		if(itemnumber != this.currentitem){
			
			$clear(this.loopTimer);
			
			if(this.previousitem != -1){
				this.itemFXs[this.previousitem].cancel().set(this.resetStyle).set(this.startStyle);
				this.itemFXs[this.currentitem].cancel().set(this.resetStyle).set(this.inStyle);
				this.previousitem=-1;
			}

			this.returnpreviousitem = this.previousitem = this.currentitem;
			this.returncurrentitem = this.currentitem = itemnumber;
			this.options.onTransitionStart(this.returncurrentitem,this.returnpreviousitem);

				this.itemFXs[this.previousitem].start(this.outStyle).chain(function(){
					if(!this.resetting){
						this.itemFXs[this.previousitem].set(this.resetStyle).set(this.startStyle);
						this.previousitem=-1;
					}
				}.bind(this));

				(function(){ 
					this.itemFXs[this.currentitem].start(this.inStyle).chain(function(){
						this.options.onTransitionComplete(this.returncurrentitem,this.returnpreviousitem);
						if(this.loop == true)
							this.loopTimer = this.mooveAll.delay(this.options.pause*1000 ,this);
					}.bind(this));
				}).delay(this.inDelay*this.options.pause*1000 ,this);
			
		}
		}else{
			this.moove.delay(50 ,this,itemnumber);	
		}
		
	},
    setTrans: function(newTrans){
        this.startStyle = {}
        this.inStyle = {};
        this.outStyle = {};
        this.resetStyle = {};
        this.inDelay = 0;
        switch(newTrans.tin){
                case 'up':
                    this.startStyle = {'top': $(this.options.element).clientHeight};
                    this.inStyle = {'top': 0};
                break;
                case 'down':
                    this.startStyle = {'top': $(this.options.element).clientHeight * -1};
                    this.inStyle = {'top': 0};
                break;
                case 'left':
                    this.startStyle = {'left': $(this.options.element).clientWidth};
                    this.inStyle = {'left': 0};
                break;
                case 'right':
                    this.startStyle = {'left': $(this.options.element).clientWidth * -1};
                    this.inStyle = {'left': 0};
                break;
                case 'fade':
                    this.startStyle = {'opacity': 0};
                    this.inStyle = {'opacity': 1};
                break;
        }
        switch(newTrans.tout){
                case 'up':
                    this.outStyle = {'top': $(this.options.element).clientHeight * -1};
                    this.resetStyle = {'top': 0};
                break;
                case 'down':
                    this.outStyle = {'top': $(this.options.element).clientHeight};
                    this.resetStyle = {'top': 0};
                break;
                case 'left':
                    this.outStyle = {'left': $(this.options.element).clientWidth * -1};
                    this.resetStyle = {'left': 0};
                break;
                case 'right':
                    this.outStyle = {'left': $(this.options.element).clientWidth};
                    this.resetStyle = {'left': 0};
                break;
                case 'fade':
                    this.outStyle = {'opacity': 0};
                    this.resetStyle = {'opacity': 1};
                    this.inDelay = .5;
                break;
        }
        this.setMooqueeItems();
    },
	pauseMooquee: function(){
		if(this.previousitem != -1){
			this.itemFXs[this.previousitem].pause();
			this.itemFXs[this.currentitem].pause();
		}
		this.mousedOver = true;
	},
	resumeMooquee: function(){
		if(this.previousitem != -1){
			this.itemFXs[this.previousitem].resume();
			this.itemFXs[this.currentitem].resume();
		}
		this.mousedOver = false;
	},
	stopMooqueeLoop: function(){
		this.loop = false;
		this.options.pause = 2;
	}
});

/*
Author:
	luistar15, <leo020588 [at] gmail.com>
License:
	MIT License
 
Class
	noobSlide (rev.19-06-08)

Arguments:
	Parameters - see Parameters below

Parameters:
	box: dom element | required
	items: dom collection | required
	size: int | item size (px) | default: 240
	mode: string | 'horizontal', 'vertical' | default: 'horizontal'
	addButtons:{
		previous: single dom element OR dom collection| default: null
		next:  single dom element OR dom collection | default: null
		play:  single dom element OR dom collection | default: null
		playback:  single dom element OR dom collection | default: null
		stop:  single dom element OR dom collection | default: null
	}
	button_event: string | event type | default: 'click'
	handles: dom collection | default: null
	handle_event: string | event type| default: 'click'
	fxOptions: object | Fx.Tween options | default: {duration:500,wait:false}
	interval: int | for periodical | default: 5000
	autoPlay: boolean | default: false
	onWalk: event | pass arguments: currentItem, currentHandle | default: null
	startItem: int | default: 0

Properties:
	box: dom element
	items: dom collection
	size: int
	mode: string
	buttons: object
	button_event: string
	handles: dom collection
	handle_event: string
	previousIndex: int
	nextIndex: int
	fx: Fx.Tween instance
	interval: int
	autoPlay: boolean
	onWalk: function
	
Methods:
	previous(manual): walk to previous item
		manual: bolean | default:false
	next(manual): walk to next item
		manual: bolean | default:false
	play (interval,direction,wait): auto walk items
		interval: int | required
		direction: string | "previous" or "next" | required
		wait: boolean | required
	stop(): stop auto walk
	walk(item,manual,noFx): walk to item
		item: int | required
		manual: bolean | default:false
		noFx: boolean | default:false
	addHandleButtons(handles):
		handles: dom collection | required
	addActionButtons(action,buttons):
		action: string | "previous", "next", "play", "playback", "stop" | required
		buttons: dom collection | required

Requires:
	mootools 1.2 core
*/
var noobSlide = new Class({

	initialize: function(params){
		this.items = params.items;
		this.mode = params.mode || 'horizontal';
		this.modes = {horizontal:['left','width'], vertical:['top','height']};
		this.size = params.size || 240;
		this.box = params.box.setStyle(this.modes[this.mode][1],(this.size*this.items.length)+'px');
		this.button_event = params.button_event || 'click';
		this.handle_event = params.handle_event || 'click';
		this.onWalk = params.onWalk || null;
		this.currentIndex = null;
		this.previousIndex = null;
		this.nextIndex = null;
		this.interval = params.interval || 5000;
		this.autoPlay = params.autoPlay || false;
		this._play = null;
		this.handles = params.handles || null;
		if(this.handles){
			this.addHandleButtons(this.handles);
		}
		this.buttons = {
			previous: [],
			next: [],
			play: [],
			playback: [],
			stop: []
		};
		if(params.addButtons){
			for(var action in params.addButtons){
				this.addActionButtons(action, $type(params.addButtons[action])=='array' ? params.addButtons[action] : [params.addButtons[action]]);
			}
		}
		this.fx = new Fx.Tween(this.box,$extend((params.fxOptions||{duration:500,wait:false}),{property:this.modes[this.mode][0]}));
		this.walk((params.startItem||0),true,true);
	},

	addHandleButtons: function(handles){
		for(var i=0;i<handles.length;i++){
			handles[i].addEvent(this.handle_event,this.walk.bind(this,[i,true]));
		}
	},

	addActionButtons: function(action,buttons){
		for(var i=0; i<buttons.length; i++){
			switch(action){
				case 'previous': buttons[i].addEvent(this.button_event,this.previous.bind(this,[true])); break;
				case 'next': buttons[i].addEvent(this.button_event,this.next.bind(this,[true])); break;
				case 'play': buttons[i].addEvent(this.button_event,this.play.bind(this,[this.interval,'next',false])); break;
				case 'playback': buttons[i].addEvent(this.button_event,this.play.bind(this,[this.interval,'previous',false])); break;
				case 'stop': buttons[i].addEvent(this.button_event,this.stop.bind(this)); break;
			}
			this.buttons[action].push(buttons[i]);
		}
	},

	previous: function(manual){
		this.walk((this.currentIndex>0 ? this.currentIndex-1 : this.items.length-1),manual);
	},

	next: function(manual){
		this.walk((this.currentIndex<this.items.length-1 ? this.currentIndex+1 : 0),manual);
	},

	play: function(interval,direction,wait){
		this.stop();
		if(!wait){
			this[direction](false);
		}
		this._play = this[direction].periodical(interval,this,[false]);
	},

	stop: function(){
		$clear(this._play);
	},

	walk: function(item,manual,noFx){
		if(item!=this.currentIndex){
			this.currentIndex=item;
			this.previousIndex = this.currentIndex + (this.currentIndex>0 ? -1 : this.items.length-1);
			this.nextIndex = this.currentIndex + (this.currentIndex<this.items.length-1 ? 1 : 1-this.items.length);
			if(manual){
				this.stop();
			}
			if(noFx){
				this.fx.cancel().set((this.size*-this.currentIndex)+'px');
			}else{
				this.fx.start(this.size*-this.currentIndex);
			}
			if(manual && this.autoPlay){
				this.play(this.interval,'next',true);
			}
			if(this.onWalk){
				this.onWalk((this.items[this.currentIndex] || null), (this.handles && this.handles[this.currentIndex] ? this.handles[this.currentIndex] : null));
			}
		}
	}
	
});/*
 * VNO CES - JavaScript
 * Copyright 2009. All rights reserved.
 *
 * function: Availabilities Dropdown Updater
 * Description:  
 */

// Availabilities Drop down Options
			
Fla = new Class
({
  Implements: Options,
	options: {
	width: '411',
	height: '316',
	container: 'fla',
		params: {
				wmode: 'opaque',
				bgcolor: '#ffffff'	
		}
	},
  initialize: function(options)
  {
   // var bdy = $(document.body);
    //this.id = id = bdy.get('id');
		
		this.setOptions(options);
		
    this.flashHeaders();
		
    return this;
  },
	flashHeaders: function()
	{
	var url;	
	// Flash Headers Injecting
		if ( $(document.body).hasClass('ndv') && $(document.body).hasClass('fla')) {
				var resDom = $('res_dmn').get('text');
				var swfDir = $('res_swf_dir').get('text');
				url = resDom+'newdevelopments/'+swfDir+'/slideshow.swf'
			//url = resDom+'images/nd/'+swfDir+'/slideshow.swf'
			//alert(url);
					
			} else {
				
				url = "";//resDom+'/images/'+swfDir+'/slideshow.swf'
			}
			var obj = new Swiff(url, this.options);
	}
	
});

/*
 * VNO CES - JavaScript
 * Copyright 2009. All rights reserved.
 *
 * function: Sliseshow Class
 * Description:  Implements the NoobSlide.js plugin
*/

	
var Slide = new Class
({
  Implements: Options,
  initialize: function(element, options)
  {
    //element = $(element);
		this.setOptions(options);
		
    if (bdy.hasClass('sl'))
    {
			var mySlideShow = new noobSlide({
				box: $('box1'),
				items: [1,2,3],
				size: 411,
				autoPlay: true
			});
		}
    return this;
  }
});

/*
 * Mooquee 	  - mootools <marquee> tag replacement
 * Version	  - 1.1
 * Created By - Robert Inglin
 * Homepage   - http://robert.ingl.in/mooquee
 * Thanks to  - *mltsy* of Mooforum.net who wrote rewrote the 
		    transition system to allow in and out style 
		    transitions and included the fade transition
 * License    - MIT License Agreement

Copyright (c) 2008 Robert Inglin

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
 */

Mooquee = new Class({
	Implements: [Options],

	options: {
		element: 'mooquee',
		cssitem: 'mooquee_item',
		firstitem:0,
		trans:{'tin':'up', 'tout':'fade'}, //each transition is up, down, left, right, fade
		pause: 1, //seconds (keep pause equal or higher to duration to allow time for items to reset) -1 = infinite pause/no loop
		duration: 1, //number of seconds to move marquee items
		overflow:'hidden', //if your item flows over how do you want to handle it. Auto(scroll) or Hidden work best...
		startOnLoad:true, // will start marquee when loaded
		pauseOnHover: true, //if true will pause all animations while mouse is hovering
		onTransitionStart: function(){},// Executes on transition start
		onTransitionComplete: function(){} // Executes on transition completion
	},
	initialize: function(options){
		this.setOptions(options);
        	this.itemFXs = [];
       	this.outDelay = 0;
        	this.inDelay = 0;
		this.started = false;
		this.currentitem = this.options.firstitem;
		if(this.options.pause!=-1)
			this.loop = true;
		else{
			this.loop = false;
			this.options.pause =2;	
		}
		this.previousitem=-1;
		if (typeof(this.options.trans) == "string") this.options.trans = {'tin':this.options.trans, 'tout':this.options.trans};
		
		window.addEvent('domready', function() {
			//get all mooqueeItems
			
			this.items = $$('#' + this.options.element + ' .' + this.options.cssitem);
			this.totalitems = this.items.length;
			if($(this.options.element).style.overflow != 'hidden')
				$(this.options.element).style.overflow = 'hidden';
			if($(this.options.element).style.position != 'relative')
				$(this.options.element).style.position = 'relative'; 

			this.setMooqueeFXs();
			this.setTrans(this.options.trans);//has setMooqueeItems in it

			if(this.options.startOnLoad)
				this.loopTimer = this.mooveAll.delay(this.options.pause*1000 ,this);
			if(this.options.pauseOnHover){
				$(this.options.element).addEvent('mouseover',function(){this.pauseMooquee()}.bind(this));
				$(this.options.element).addEvent('mouseout',function(){this.resumeMooquee()}.bind(this));
			}
		}.bind(this));
		
		
	},
	setMooqueeItems: function(){
		this.resetting =true;
		var i=0;
		
		this.items.each(function (element){
			if($(element).style.position != 'absolute')
				$(element).style.position = 'absolute';
			$(element).style.width = $(this.options.element).clientWidth + 'px';
			$(element).style.overflow = this.options.overflow;

			if(i == this.currentitem)
				this.itemFXs[i].set(this.resetStyle).set(this.inStyle);
			else
				this.itemFXs[i].set(this.resetStyle).set(this.startStyle);
           
			i++;
		}.bind(this));

		this.resetting =false;
	},
	setMooqueeFXs: function(){
		var i=0;
		this.items.each(function (element){
			this.itemFXs[i] = new Fx.Morph(element,{duration:(this.options.duration*1000)});
			i++;
		}.bind(this));
	},
	mooveAll: function(){
		if((this.currentitem + 1) == this.totalitems)
			citem = 0;
		else
			citem = this.currentitem + 1;
		this.moove(citem);

	},
	moove: function(itemnumber){
		if(itemnumber < this.totalitems)
		if(!this.mousedOver){
		if(itemnumber != this.currentitem){
			
			$clear(this.loopTimer);
			
			if(this.previousitem != -1){
				this.itemFXs[this.previousitem].cancel().set(this.resetStyle).set(this.startStyle);
				this.itemFXs[this.currentitem].cancel().set(this.resetStyle).set(this.inStyle);
				this.previousitem=-1;
			}

			this.returnpreviousitem = this.previousitem = this.currentitem;
			this.returncurrentitem = this.currentitem = itemnumber;
			this.options.onTransitionStart(this.returncurrentitem,this.returnpreviousitem);

				this.itemFXs[this.previousitem].start(this.outStyle).chain(function(){
					if(!this.resetting){
						this.itemFXs[this.previousitem].set(this.resetStyle).set(this.startStyle);
						this.previousitem=-1;
					}
				}.bind(this));

				(function(){ 
					this.itemFXs[this.currentitem].start(this.inStyle).chain(function(){
						this.options.onTransitionComplete(this.returncurrentitem,this.returnpreviousitem);
						if(this.loop == true)
							this.loopTimer = this.mooveAll.delay(this.options.pause*1000 ,this);
					}.bind(this));
				}).delay(this.inDelay*this.options.pause*1000 ,this);
			
		}
		}else{
			this.moove.delay(50 ,this,itemnumber);	
		}
		
	},
    setTrans: function(newTrans){
        this.startStyle = {}
        this.inStyle = {};
        this.outStyle = {};
        this.resetStyle = {};
        this.inDelay = 0;
        switch(newTrans.tin){
                case 'up':
                    this.startStyle = {'top': $(this.options.element).clientHeight};
                    this.inStyle = {'top': 0};
                break;
                case 'down':
                    this.startStyle = {'top': $(this.options.element).clientHeight * -1};
                    this.inStyle = {'top': 0};
                break;
                case 'left':
                    this.startStyle = {'left': $(this.options.element).clientWidth};
                    this.inStyle = {'left': 0};
                break;
                case 'right':
                    this.startStyle = {'left': $(this.options.element).clientWidth * -1};
                    this.inStyle = {'left': 0};
                break;
                case 'fade':
                    this.startStyle = {'opacity': 0};
                    this.inStyle = {'opacity': 1};
                break;
        }
        switch(newTrans.tout){
                case 'up':
                    this.outStyle = {'top': $(this.options.element).clientHeight * -1};
                    this.resetStyle = {'top': 0};
                break;
                case 'down':
                    this.outStyle = {'top': $(this.options.element).clientHeight};
                    this.resetStyle = {'top': 0};
                break;
                case 'left':
                    this.outStyle = {'left': $(this.options.element).clientWidth * -1};
                    this.resetStyle = {'left': 0};
                break;
                case 'right':
                    this.outStyle = {'left': $(this.options.element).clientWidth};
                    this.resetStyle = {'left': 0};
                break;
                case 'fade':
                    this.outStyle = {'opacity': 0};
                    this.resetStyle = {'opacity': 1};
                    this.inDelay = .5;
                break;
        }
        this.setMooqueeItems();
    },
	pauseMooquee: function(){
		if(this.previousitem != -1){
			this.itemFXs[this.previousitem].pause();
			this.itemFXs[this.currentitem].pause();
		}
		this.mousedOver = true;
	},
	resumeMooquee: function(){
		if(this.previousitem != -1){
			this.itemFXs[this.previousitem].resume();
			this.itemFXs[this.currentitem].resume();
		}
		this.mousedOver = false;
	},
	stopMooqueeLoop: function(){
		this.loop = false;
		this.options.pause = 2;
	}
});

/*
Author:
	luistar15, <leo020588 [at] gmail.com>
License:
	MIT License
 
Class
	noobSlide (rev.19-06-08)

Arguments:
	Parameters - see Parameters below

Parameters:
	box: dom element | required
	items: dom collection | required
	size: int | item size (px) | default: 240
	mode: string | 'horizontal', 'vertical' | default: 'horizontal'
	addButtons:{
		previous: single dom element OR dom collection| default: null
		next:  single dom element OR dom collection | default: null
		play:  single dom element OR dom collection | default: null
		playback:  single dom element OR dom collection | default: null
		stop:  single dom element OR dom collection | default: null
	}
	button_event: string | event type | default: 'click'
	handles: dom collection | default: null
	handle_event: string | event type| default: 'click'
	fxOptions: object | Fx.Tween options | default: {duration:500,wait:false}
	interval: int | for periodical | default: 5000
	autoPlay: boolean | default: false
	onWalk: event | pass arguments: currentItem, currentHandle | default: null
	startItem: int | default: 0

Properties:
	box: dom element
	items: dom collection
	size: int
	mode: string
	buttons: object
	button_event: string
	handles: dom collection
	handle_event: string
	previousIndex: int
	nextIndex: int
	fx: Fx.Tween instance
	interval: int
	autoPlay: boolean
	onWalk: function
	
Methods:
	previous(manual): walk to previous item
		manual: bolean | default:false
	next(manual): walk to next item
		manual: bolean | default:false
	play (interval,direction,wait): auto walk items
		interval: int | required
		direction: string | "previous" or "next" | required
		wait: boolean | required
	stop(): stop auto walk
	walk(item,manual,noFx): walk to item
		item: int | required
		manual: bolean | default:false
		noFx: boolean | default:false
	addHandleButtons(handles):
		handles: dom collection | required
	addActionButtons(action,buttons):
		action: string | "previous", "next", "play", "playback", "stop" | required
		buttons: dom collection | required

Requires:
	mootools 1.2 core
*/
var noobSlide = new Class({

	initialize: function(params){
		this.items = params.items;
		this.mode = params.mode || 'horizontal';
		this.modes = {horizontal:['left','width'], vertical:['top','height']};
		this.size = params.size || 240;
		this.box = params.box.setStyle(this.modes[this.mode][1],(this.size*this.items.length)+'px');
		this.button_event = params.button_event || 'click';
		this.handle_event = params.handle_event || 'click';
		this.onWalk = params.onWalk || null;
		this.currentIndex = null;
		this.previousIndex = null;
		this.nextIndex = null;
		this.interval = params.interval || 5000;
		this.autoPlay = params.autoPlay || false;
		this._play = null;
		this.handles = params.handles || null;
		if(this.handles){
			this.addHandleButtons(this.handles);
		}
		this.buttons = {
			previous: [],
			next: [],
			play: [],
			playback: [],
			stop: []
		};
		if(params.addButtons){
			for(var action in params.addButtons){
				this.addActionButtons(action, $type(params.addButtons[action])=='array' ? params.addButtons[action] : [params.addButtons[action]]);
			}
		}
		this.fx = new Fx.Tween(this.box,$extend((params.fxOptions||{duration:500,wait:false}),{property:this.modes[this.mode][0]}));
		this.walk((params.startItem||0),true,true);
	},

	addHandleButtons: function(handles){
		for(var i=0;i<handles.length;i++){
			handles[i].addEvent(this.handle_event,this.walk.bind(this,[i,true]));
		}
	},

	addActionButtons: function(action,buttons){
		for(var i=0; i<buttons.length; i++){
			switch(action){
				case 'previous': buttons[i].addEvent(this.button_event,this.previous.bind(this,[true])); break;
				case 'next': buttons[i].addEvent(this.button_event,this.next.bind(this,[true])); break;
				case 'play': buttons[i].addEvent(this.button_event,this.play.bind(this,[this.interval,'next',false])); break;
				case 'playback': buttons[i].addEvent(this.button_event,this.play.bind(this,[this.interval,'previous',false])); break;
				case 'stop': buttons[i].addEvent(this.button_event,this.stop.bind(this)); break;
			}
			this.buttons[action].push(buttons[i]);
		}
	},

	previous: function(manual){
		this.walk((this.currentIndex>0 ? this.currentIndex-1 : this.items.length-1),manual);
	},

	next: function(manual){
		this.walk((this.currentIndex<this.items.length-1 ? this.currentIndex+1 : 0),manual);
	},

	play: function(interval,direction,wait){
		this.stop();
		if(!wait){
			this[direction](false);
		}
		this._play = this[direction].periodical(interval,this,[false]);
	},

	stop: function(){
		$clear(this._play);
	},

	walk: function(item,manual,noFx){
		if(item!=this.currentIndex){
			this.currentIndex=item;
			this.previousIndex = this.currentIndex + (this.currentIndex>0 ? -1 : this.items.length-1);
			this.nextIndex = this.currentIndex + (this.currentIndex<this.items.length-1 ? 1 : 1-this.items.length);
			if(manual){
				this.stop();
			}
			if(noFx){
				this.fx.cancel().set((this.size*-this.currentIndex)+'px');
			}else{
				this.fx.start(this.size*-this.currentIndex);
			}
			if(manual && this.autoPlay){
				this.play(this.interval,'next',true);
			}
			if(this.onWalk){
				this.onWalk((this.items[this.currentIndex] || null), (this.handles && this.handles[this.currentIndex] ? this.handles[this.currentIndex] : null));
			}
		}
	}
	
});/*
 * VNO CES - JavaScript
 * Copyright 2009. All rights reserved.
 *
 * function: Availabilities Dropdown Updater
 * Description:  
 */

// Availabilities Drop down Options
			
Fla = new Class
({
  Implements: Options,
	options: {
	width: '411',
	height: '316',
	container: 'fla',
		params: {
				wmode: 'opaque',
				bgcolor: '#ffffff'	
		}
	},
  initialize: function(options)
  {
   // var bdy = $(document.body);
    //this.id = id = bdy.get('id');
		
		this.setOptions(options);
		
    this.flashHeaders();
		
    return this;
  },
	flashHeaders: function()
	{
	var url;	
	// Flash Headers Injecting
		if ( $(document.body).hasClass('ndv') && $(document.body).hasClass('fla')) {
				var resDom = $('res_dmn').get('text');
				var swfDir = $('res_swf_dir').get('text');
				url = resDom+'newdevelopments/'+swfDir+'/slideshow.swf'
			//url = resDom+'images/nd/'+swfDir+'/slideshow.swf'
			//alert(url);
					
			} else {
				
				url = "";//resDom+'/images/'+swfDir+'/slideshow.swf'
			}
			var obj = new Swiff(url, this.options);
	}
	
});

/*
 * VNO CES - JavaScript
 * Copyright 2009. All rights reserved.
 *
 * function: Sliseshow Class
 * Description:  Implements the NoobSlide.js plugin
*/

	
var Slide = new Class
({
  Implements: Options,
  initialize: function(element, options)
  {
    //element = $(element);
		this.setOptions(options);
		
    if (bdy.hasClass('sl'))
    {
			var mySlideShow = new noobSlide({
				box: $('box1'),
				items: [1,2,3],
				size: 411,
				autoPlay: true
			});
		}
    return this;
  }
});

/*
 * Mooquee 	  - mootools <marquee> tag replacement
 * Version	  - 1.1
 * Created By - Robert Inglin
 * Homepage   - http://robert.ingl.in/mooquee
 * Thanks to  - *mltsy* of Mooforum.net who wrote rewrote the 
		    transition system to allow in and out style 
		    transitions and included the fade transition
 * License    - MIT License Agreement

Copyright (c) 2008 Robert Inglin

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
 */

Mooquee = new Class({
	Implements: [Options],

	options: {
		element: 'mooquee',
		cssitem: 'mooquee_item',
		firstitem:0,
		trans:{'tin':'up', 'tout':'fade'}, //each transition is up, down, left, right, fade
		pause: 1, //seconds (keep pause equal or higher to duration to allow time for items to reset) -1 = infinite pause/no loop
		duration: 1, //number of seconds to move marquee items
		overflow:'hidden', //if your item flows over how do you want to handle it. Auto(scroll) or Hidden work best...
		startOnLoad:true, // will start marquee when loaded
		pauseOnHover: true, //if true will pause all animations while mouse is hovering
		onTransitionStart: function(){},// Executes on transition start
		onTransitionComplete: function(){} // Executes on transition completion
	},
	initialize: function(options){
		this.setOptions(options);
        	this.itemFXs = [];
       	this.outDelay = 0;
        	this.inDelay = 0;
		this.started = false;
		this.currentitem = this.options.firstitem;
		if(this.options.pause!=-1)
			this.loop = true;
		else{
			this.loop = false;
			this.options.pause =2;	
		}
		this.previousitem=-1;
		if (typeof(this.options.trans) == "string") this.options.trans = {'tin':this.options.trans, 'tout':this.options.trans};
		
		window.addEvent('domready', function() {
			//get all mooqueeItems
			
			this.items = $$('#' + this.options.element + ' .' + this.options.cssitem);
			this.totalitems = this.items.length;
			if($(this.options.element).style.overflow != 'hidden')
				$(this.options.element).style.overflow = 'hidden';
			if($(this.options.element).style.position != 'relative')
				$(this.options.element).style.position = 'relative'; 

			this.setMooqueeFXs();
			this.setTrans(this.options.trans);//has setMooqueeItems in it

			if(this.options.startOnLoad)
				this.loopTimer = this.mooveAll.delay(this.options.pause*1000 ,this);
			if(this.options.pauseOnHover){
				$(this.options.element).addEvent('mouseover',function(){this.pauseMooquee()}.bind(this));
				$(this.options.element).addEvent('mouseout',function(){this.resumeMooquee()}.bind(this));
			}
		}.bind(this));
		
		
	},
	setMooqueeItems: function(){
		this.resetting =true;
		var i=0;
		
		this.items.each(function (element){
			if($(element).style.position != 'absolute')
				$(element).style.position = 'absolute';
			$(element).style.width = $(this.options.element).clientWidth + 'px';
			$(element).style.overflow = this.options.overflow;

			if(i == this.currentitem)
				this.itemFXs[i].set(this.resetStyle).set(this.inStyle);
			else
				this.itemFXs[i].set(this.resetStyle).set(this.startStyle);
           
			i++;
		}.bind(this));

		this.resetting =false;
	},
	setMooqueeFXs: function(){
		var i=0;
		this.items.each(function (element){
			this.itemFXs[i] = new Fx.Morph(element,{duration:(this.options.duration*1000)});
			i++;
		}.bind(this));
	},
	mooveAll: function(){
		if((this.currentitem + 1) == this.totalitems)
			citem = 0;
		else
			citem = this.currentitem + 1;
		this.moove(citem);

	},
	moove: function(itemnumber){
		if(itemnumber < this.totalitems)
		if(!this.mousedOver){
		if(itemnumber != this.currentitem){
			
			$clear(this.loopTimer);
			
			if(this.previousitem != -1){
				this.itemFXs[this.previousitem].cancel().set(this.resetStyle).set(this.startStyle);
				this.itemFXs[this.currentitem].cancel().set(this.resetStyle).set(this.inStyle);
				this.previousitem=-1;
			}

			this.returnpreviousitem = this.previousitem = this.currentitem;
			this.returncurrentitem = this.currentitem = itemnumber;
			this.options.onTransitionStart(this.returncurrentitem,this.returnpreviousitem);

				this.itemFXs[this.previousitem].start(this.outStyle).chain(function(){
					if(!this.resetting){
						this.itemFXs[this.previousitem].set(this.resetStyle).set(this.startStyle);
						this.previousitem=-1;
					}
				}.bind(this));

				(function(){ 
					this.itemFXs[this.currentitem].start(this.inStyle).chain(function(){
						this.options.onTransitionComplete(this.returncurrentitem,this.returnpreviousitem);
						if(this.loop == true)
							this.loopTimer = this.mooveAll.delay(this.options.pause*1000 ,this);
					}.bind(this));
				}).delay(this.inDelay*this.options.pause*1000 ,this);
			
		}
		}else{
			this.moove.delay(50 ,this,itemnumber);	
		}
		
	},
    setTrans: function(newTrans){
        this.startStyle = {}
        this.inStyle = {};
        this.outStyle = {};
        this.resetStyle = {};
        this.inDelay = 0;
        switch(newTrans.tin){
                case 'up':
                    this.startStyle = {'top': $(this.options.element).clientHeight};
                    this.inStyle = {'top': 0};
                break;
                case 'down':
                    this.startStyle = {'top': $(this.options.element).clientHeight * -1};
                    this.inStyle = {'top': 0};
                break;
                case 'left':
                    this.startStyle = {'left': $(this.options.element).clientWidth};
                    this.inStyle = {'left': 0};
                break;
                case 'right':
                    this.startStyle = {'left': $(this.options.element).clientWidth * -1};
                    this.inStyle = {'left': 0};
                break;
                case 'fade':
                    this.startStyle = {'opacity': 0};
                    this.inStyle = {'opacity': 1};
                break;
        }
        switch(newTrans.tout){
                case 'up':
                    this.outStyle = {'top': $(this.options.element).clientHeight * -1};
                    this.resetStyle = {'top': 0};
                break;
                case 'down':
                    this.outStyle = {'top': $(this.options.element).clientHeight};
                    this.resetStyle = {'top': 0};
                break;
                case 'left':
                    this.outStyle = {'left': $(this.options.element).clientWidth * -1};
                    this.resetStyle = {'left': 0};
                break;
                case 'right':
                    this.outStyle = {'left': $(this.options.element).clientWidth};
                    this.resetStyle = {'left': 0};
                break;
                case 'fade':
                    this.outStyle = {'opacity': 0};
                    this.resetStyle = {'opacity': 1};
                    this.inDelay = .5;
                break;
        }
        this.setMooqueeItems();
    },
	pauseMooquee: function(){
		if(this.previousitem != -1){
			this.itemFXs[this.previousitem].pause();
			this.itemFXs[this.currentitem].pause();
		}
		this.mousedOver = true;
	},
	resumeMooquee: function(){
		if(this.previousitem != -1){
			this.itemFXs[this.previousitem].resume();
			this.itemFXs[this.currentitem].resume();
		}
		this.mousedOver = false;
	},
	stopMooqueeLoop: function(){
		this.loop = false;
		this.options.pause = 2;
	}
});

/*
Author:
	luistar15, <leo020588 [at] gmail.com>
License:
	MIT License
 
Class
	noobSlide (rev.19-06-08)

Arguments:
	Parameters - see Parameters below

Parameters:
	box: dom element | required
	items: dom collection | required
	size: int | item size (px) | default: 240
	mode: string | 'horizontal', 'vertical' | default: 'horizontal'
	addButtons:{
		previous: single dom element OR dom collection| default: null
		next:  single dom element OR dom collection | default: null
		play:  single dom element OR dom collection | default: null
		playback:  single dom element OR dom collection | default: null
		stop:  single dom element OR dom collection | default: null
	}
	button_event: string | event type | default: 'click'
	handles: dom collection | default: null
	handle_event: string | event type| default: 'click'
	fxOptions: object | Fx.Tween options | default: {duration:500,wait:false}
	interval: int | for periodical | default: 5000
	autoPlay: boolean | default: false
	onWalk: event | pass arguments: currentItem, currentHandle | default: null
	startItem: int | default: 0

Properties:
	box: dom element
	items: dom collection
	size: int
	mode: string
	buttons: object
	button_event: string
	handles: dom collection
	handle_event: string
	previousIndex: int
	nextIndex: int
	fx: Fx.Tween instance
	interval: int
	autoPlay: boolean
	onWalk: function
	
Methods:
	previous(manual): walk to previous item
		manual: bolean | default:false
	next(manual): walk to next item
		manual: bolean | default:false
	play (interval,direction,wait): auto walk items
		interval: int | required
		direction: string | "previous" or "next" | required
		wait: boolean | required
	stop(): stop auto walk
	walk(item,manual,noFx): walk to item
		item: int | required
		manual: bolean | default:false
		noFx: boolean | default:false
	addHandleButtons(handles):
		handles: dom collection | required
	addActionButtons(action,buttons):
		action: string | "previous", "next", "play", "playback", "stop" | required
		buttons: dom collection | required

Requires:
	mootools 1.2 core
*/
var noobSlide = new Class({

	initialize: function(params){
		this.items = params.items;
		this.mode = params.mode || 'horizontal';
		this.modes = {horizontal:['left','width'], vertical:['top','height']};
		this.size = params.size || 240;
		this.box = params.box.setStyle(this.modes[this.mode][1],(this.size*this.items.length)+'px');
		this.button_event = params.button_event || 'click';
		this.handle_event = params.handle_event || 'click';
		this.onWalk = params.onWalk || null;
		this.currentIndex = null;
		this.previousIndex = null;
		this.nextIndex = null;
		this.interval = params.interval || 5000;
		this.autoPlay = params.autoPlay || false;
		this._play = null;
		this.handles = params.handles || null;
		if(this.handles){
			this.addHandleButtons(this.handles);
		}
		this.buttons = {
			previous: [],
			next: [],
			play: [],
			playback: [],
			stop: []
		};
		if(params.addButtons){
			for(var action in params.addButtons){
				this.addActionButtons(action, $type(params.addButtons[action])=='array' ? params.addButtons[action] : [params.addButtons[action]]);
			}
		}
		this.fx = new Fx.Tween(this.box,$extend((params.fxOptions||{duration:500,wait:false}),{property:this.modes[this.mode][0]}));
		this.walk((params.startItem||0),true,true);
	},

	addHandleButtons: function(handles){
		for(var i=0;i<handles.length;i++){
			handles[i].addEvent(this.handle_event,this.walk.bind(this,[i,true]));
		}
	},

	addActionButtons: function(action,buttons){
		for(var i=0; i<buttons.length; i++){
			switch(action){
				case 'previous': buttons[i].addEvent(this.button_event,this.previous.bind(this,[true])); break;
				case 'next': buttons[i].addEvent(this.button_event,this.next.bind(this,[true])); break;
				case 'play': buttons[i].addEvent(this.button_event,this.play.bind(this,[this.interval,'next',false])); break;
				case 'playback': buttons[i].addEvent(this.button_event,this.play.bind(this,[this.interval,'previous',false])); break;
				case 'stop': buttons[i].addEvent(this.button_event,this.stop.bind(this)); break;
			}
			this.buttons[action].push(buttons[i]);
		}
	},

	previous: function(manual){
		this.walk((this.currentIndex>0 ? this.currentIndex-1 : this.items.length-1),manual);
	},

	next: function(manual){
		this.walk((this.currentIndex<this.items.length-1 ? this.currentIndex+1 : 0),manual);
	},

	play: function(interval,direction,wait){
		this.stop();
		if(!wait){
			this[direction](false);
		}
		this._play = this[direction].periodical(interval,this,[false]);
	},

	stop: function(){
		$clear(this._play);
	},

	walk: function(item,manual,noFx){
		if(item!=this.currentIndex){
			this.currentIndex=item;
			this.previousIndex = this.currentIndex + (this.currentIndex>0 ? -1 : this.items.length-1);
			this.nextIndex = this.currentIndex + (this.currentIndex<this.items.length-1 ? 1 : 1-this.items.length);
			if(manual){
				this.stop();
			}
			if(noFx){
				this.fx.cancel().set((this.size*-this.currentIndex)+'px');
			}else{
				this.fx.start(this.size*-this.currentIndex);
			}
			if(manual && this.autoPlay){
				this.play(this.interval,'next',true);
			}
			if(this.onWalk){
				this.onWalk((this.items[this.currentIndex] || null), (this.handles && this.handles[this.currentIndex] ? this.handles[this.currentIndex] : null));
			}
		}
	}
	
});/*
 * VNO CES - JavaScript
 * Copyright 2009. All rights reserved.
 *
 * function: Availabilities Dropdown Updater
 * Description:  
 */

// Availabilities Drop down Options
			
Fla = new Class
({
  Implements: Options,
	options: {
	width: '411',
	height: '316',
	container: 'fla',
		params: {
				wmode: 'opaque',
				bgcolor: '#ffffff'	
		}
	},
  initialize: function(options)
  {
   // var bdy = $(document.body);
    //this.id = id = bdy.get('id');
		
		this.setOptions(options);
		
    this.flashHeaders();
		
    return this;
  },
	flashHeaders: function()
	{
	var url;	
	// Flash Headers Injecting
		if ( $(document.body).hasClass('ndv') && $(document.body).hasClass('fla')) {
				var resDom = $('res_dmn').get('text');
				var swfDir = $('res_swf_dir').get('text');
				url = resDom+'newdevelopments/'+swfDir+'/slideshow.swf'
			//url = resDom+'images/nd/'+swfDir+'/slideshow.swf'
			//alert(url);
					
			} else {
				
				url = "";//resDom+'/images/'+swfDir+'/slideshow.swf'
			}
			var obj = new Swiff(url, this.options);
	}
	
});

/*
 * VNO CES - JavaScript
 * Copyright 2009. All rights reserved.
 *
 * function: Sliseshow Class
 * Description:  Implements the NoobSlide.js plugin
*/

	
var Slide = new Class
({
  Implements: Options,
  initialize: function(element, options)
  {
    //element = $(element);
		this.setOptions(options);
		
    if (bdy.hasClass('sl'))
    {
			var mySlideShow = new noobSlide({
				box: $('box1'),
				items: [1,2,3],
				size: 411,
				autoPlay: true
			});
		}
    return this;
  }
});

/*
 * Mooquee 	  - mootools <marquee> tag replacement
 * Version	  - 1.1
 * Created By - Robert Inglin
 * Homepage   - http://robert.ingl.in/mooquee
 * Thanks to  - *mltsy* of Mooforum.net who wrote rewrote the 
		    transition system to allow in and out style 
		    transitions and included the fade transition
 * License    - MIT License Agreement

Copyright (c) 2008 Robert Inglin

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
 */

Mooquee = new Class({
	Implements: [Options],

	options: {
		element: 'mooquee',
		cssitem: 'mooquee_item',
		firstitem:0,
		trans:{'tin':'up', 'tout':'fade'}, //each transition is up, down, left, right, fade
		pause: 1, //seconds (keep pause equal or higher to duration to allow time for items to reset) -1 = infinite pause/no loop
		duration: 1, //number of seconds to move marquee items
		overflow:'hidden', //if your item flows over how do you want to handle it. Auto(scroll) or Hidden work best...
		startOnLoad:true, // will start marquee when loaded
		pauseOnHover: true, //if true will pause all animations while mouse is hovering
		onTransitionStart: function(){},// Executes on transition start
		onTransitionComplete: function(){} // Executes on transition completion
	},
	initialize: function(options){
		this.setOptions(options);
        	this.itemFXs = [];
       	this.outDelay = 0;
        	this.inDelay = 0;
		this.started = false;
		this.currentitem = this.options.firstitem;
		if(this.options.pause!=-1)
			this.loop = true;
		else{
			this.loop = false;
			this.options.pause =2;	
		}
		this.previousitem=-1;
		if (typeof(this.options.trans) == "string") this.options.trans = {'tin':this.options.trans, 'tout':this.options.trans};
		
		window.addEvent('domready', function() {
			//get all mooqueeItems
			
			this.items = $$('#' + this.options.element + ' .' + this.options.cssitem);
			this.totalitems = this.items.length;
			if($(this.options.element).style.overflow != 'hidden')
				$(this.options.element).style.overflow = 'hidden';
			if($(this.options.element).style.position != 'relative')
				$(this.options.element).style.position = 'relative'; 

			this.setMooqueeFXs();
			this.setTrans(this.options.trans);//has setMooqueeItems in it

			if(this.options.startOnLoad)
				this.loopTimer = this.mooveAll.delay(this.options.pause*1000 ,this);
			if(this.options.pauseOnHover){
				$(this.options.element).addEvent('mouseover',function(){this.pauseMooquee()}.bind(this));
				$(this.options.element).addEvent('mouseout',function(){this.resumeMooquee()}.bind(this));
			}
		}.bind(this));
		
		
	},
	setMooqueeItems: function(){
		this.resetting =true;
		var i=0;
		
		this.items.each(function (element){
			if($(element).style.position != 'absolute')
				$(element).style.position = 'absolute';
			$(element).style.width = $(this.options.element).clientWidth + 'px';
			$(element).style.overflow = this.options.overflow;

			if(i == this.currentitem)
				this.itemFXs[i].set(this.resetStyle).set(this.inStyle);
			else
				this.itemFXs[i].set(this.resetStyle).set(this.startStyle);
           
			i++;
		}.bind(this));

		this.resetting =false;
	},
	setMooqueeFXs: function(){
		var i=0;
		this.items.each(function (element){
			this.itemFXs[i] = new Fx.Morph(element,{duration:(this.options.duration*1000)});
			i++;
		}.bind(this));
	},
	mooveAll: function(){
		if((this.currentitem + 1) == this.totalitems)
			citem = 0;
		else
			citem = this.currentitem + 1;
		this.moove(citem);

	},
	moove: function(itemnumber){
		if(itemnumber < this.totalitems)
		if(!this.mousedOver){
		if(itemnumber != this.currentitem){
			
			$clear(this.loopTimer);
			
			if(this.previousitem != -1){
				this.itemFXs[this.previousitem].cancel().set(this.resetStyle).set(this.startStyle);
				this.itemFXs[this.currentitem].cancel().set(this.resetStyle).set(this.inStyle);
				this.previousitem=-1;
			}

			this.returnpreviousitem = this.previousitem = this.currentitem;
			this.returncurrentitem = this.currentitem = itemnumber;
			this.options.onTransitionStart(this.returncurrentitem,this.returnpreviousitem);

				this.itemFXs[this.previousitem].start(this.outStyle).chain(function(){
					if(!this.resetting){
						this.itemFXs[this.previousitem].set(this.resetStyle).set(this.startStyle);
						this.previousitem=-1;
					}
				}.bind(this));

				(function(){ 
					this.itemFXs[this.currentitem].start(this.inStyle).chain(function(){
						this.options.onTransitionComplete(this.returncurrentitem,this.returnpreviousitem);
						if(this.loop == true)
							this.loopTimer = this.mooveAll.delay(this.options.pause*1000 ,this);
					}.bind(this));
				}).delay(this.inDelay*this.options.pause*1000 ,this);
			
		}
		}else{
			this.moove.delay(50 ,this,itemnumber);	
		}
		
	},
    setTrans: function(newTrans){
        this.startStyle = {}
        this.inStyle = {};
        this.outStyle = {};
        this.resetStyle = {};
        this.inDelay = 0;
        switch(newTrans.tin){
                case 'up':
                    this.startStyle = {'top': $(this.options.element).clientHeight};
                    this.inStyle = {'top': 0};
                break;
                case 'down':
                    this.startStyle = {'top': $(this.options.element).clientHeight * -1};
                    this.inStyle = {'top': 0};
                break;
                case 'left':
                    this.startStyle = {'left': $(this.options.element).clientWidth};
                    this.inStyle = {'left': 0};
                break;
                case 'right':
                    this.startStyle = {'left': $(this.options.element).clientWidth * -1};
                    this.inStyle = {'left': 0};
                break;
                case 'fade':
                    this.startStyle = {'opacity': 0};
                    this.inStyle = {'opacity': 1};
                break;
        }
        switch(newTrans.tout){
                case 'up':
                    this.outStyle = {'top': $(this.options.element).clientHeight * -1};
                    this.resetStyle = {'top': 0};
                break;
                case 'down':
                    this.outStyle = {'top': $(this.options.element).clientHeight};
                    this.resetStyle = {'top': 0};
                break;
                case 'left':
                    this.outStyle = {'left': $(this.options.element).clientWidth * -1};
                    this.resetStyle = {'left': 0};
                break;
                case 'right':
                    this.outStyle = {'left': $(this.options.element).clientWidth};
                    this.resetStyle = {'left': 0};
                break;
                case 'fade':
                    this.outStyle = {'opacity': 0};
                    this.resetStyle = {'opacity': 1};
                    this.inDelay = .5;
                break;
        }
        this.setMooqueeItems();
    },
	pauseMooquee: function(){
		if(this.previousitem != -1){
			this.itemFXs[this.previousitem].pause();
			this.itemFXs[this.currentitem].pause();
		}
		this.mousedOver = true;
	},
	resumeMooquee: function(){
		if(this.previousitem != -1){
			this.itemFXs[this.previousitem].resume();
			this.itemFXs[this.currentitem].resume();
		}
		this.mousedOver = false;
	},
	stopMooqueeLoop: function(){
		this.loop = false;
		this.options.pause = 2;
	}
});

/*
Author:
	luistar15, <leo020588 [at] gmail.com>
License:
	MIT License
 
Class
	noobSlide (rev.19-06-08)

Arguments:
	Parameters - see Parameters below

Parameters:
	box: dom element | required
	items: dom collection | required
	size: int | item size (px) | default: 240
	mode: string | 'horizontal', 'vertical' | default: 'horizontal'
	addButtons:{
		previous: single dom element OR dom collection| default: null
		next:  single dom element OR dom collection | default: null
		play:  single dom element OR dom collection | default: null
		playback:  single dom element OR dom collection | default: null
		stop:  single dom element OR dom collection | default: null
	}
	button_event: string | event type | default: 'click'
	handles: dom collection | default: null
	handle_event: string | event type| default: 'click'
	fxOptions: object | Fx.Tween options | default: {duration:500,wait:false}
	interval: int | for periodical | default: 5000
	autoPlay: boolean | default: false
	onWalk: event | pass arguments: currentItem, currentHandle | default: null
	startItem: int | default: 0

Properties:
	box: dom element
	items: dom collection
	size: int
	mode: string
	buttons: object
	button_event: string
	handles: dom collection
	handle_event: string
	previousIndex: int
	nextIndex: int
	fx: Fx.Tween instance
	interval: int
	autoPlay: boolean
	onWalk: function
	
Methods:
	previous(manual): walk to previous item
		manual: bolean | default:false
	next(manual): walk to next item
		manual: bolean | default:false
	play (interval,direction,wait): auto walk items
		interval: int | required
		direction: string | "previous" or "next" | required
		wait: boolean | required
	stop(): stop auto walk
	walk(item,manual,noFx): walk to item
		item: int | required
		manual: bolean | default:false
		noFx: boolean | default:false
	addHandleButtons(handles):
		handles: dom collection | required
	addActionButtons(action,buttons):
		action: string | "previous", "next", "play", "playback", "stop" | required
		buttons: dom collection | required

Requires:
	mootools 1.2 core
*/
var noobSlide = new Class({

	initialize: function(params){
		this.items = params.items;
		this.mode = params.mode || 'horizontal';
		this.modes = {horizontal:['left','width'], vertical:['top','height']};
		this.size = params.size || 240;
		this.box = params.box.setStyle(this.modes[this.mode][1],(this.size*this.items.length)+'px');
		this.button_event = params.button_event || 'click';
		this.handle_event = params.handle_event || 'click';
		this.onWalk = params.onWalk || null;
		this.currentIndex = null;
		this.previousIndex = null;
		this.nextIndex = null;
		this.interval = params.interval || 5000;
		this.autoPlay = params.autoPlay || false;
		this._play = null;
		this.handles = params.handles || null;
		if(this.handles){
			this.addHandleButtons(this.handles);
		}
		this.buttons = {
			previous: [],
			next: [],
			play: [],
			playback: [],
			stop: []
		};
		if(params.addButtons){
			for(var action in params.addButtons){
				this.addActionButtons(action, $type(params.addButtons[action])=='array' ? params.addButtons[action] : [params.addButtons[action]]);
			}
		}
		this.fx = new Fx.Tween(this.box,$extend((params.fxOptions||{duration:500,wait:false}),{property:this.modes[this.mode][0]}));
		this.walk((params.startItem||0),true,true);
	},

	addHandleButtons: function(handles){
		for(var i=0;i<handles.length;i++){
			handles[i].addEvent(this.handle_event,this.walk.bind(this,[i,true]));
		}
	},

	addActionButtons: function(action,buttons){
		for(var i=0; i<buttons.length; i++){
			switch(action){
				case 'previous': buttons[i].addEvent(this.button_event,this.previous.bind(this,[true])); break;
				case 'next': buttons[i].addEvent(this.button_event,this.next.bind(this,[true])); break;
				case 'play': buttons[i].addEvent(this.button_event,this.play.bind(this,[this.interval,'next',false])); break;
				case 'playback': buttons[i].addEvent(this.button_event,this.play.bind(this,[this.interval,'previous',false])); break;
				case 'stop': buttons[i].addEvent(this.button_event,this.stop.bind(this)); break;
			}
			this.buttons[action].push(buttons[i]);
		}
	},

	previous: function(manual){
		this.walk((this.currentIndex>0 ? this.currentIndex-1 : this.items.length-1),manual);
	},

	next: function(manual){
		this.walk((this.currentIndex<this.items.length-1 ? this.currentIndex+1 : 0),manual);
	},

	play: function(interval,direction,wait){
		this.stop();
		if(!wait){
			this[direction](false);
		}
		this._play = this[direction].periodical(interval,this,[false]);
	},

	stop: function(){
		$clear(this._play);
	},

	walk: function(item,manual,noFx){
		if(item!=this.currentIndex){
			this.currentIndex=item;
			this.previousIndex = this.currentIndex + (this.currentIndex>0 ? -1 : this.items.length-1);
			this.nextIndex = this.currentIndex + (this.currentIndex<this.items.length-1 ? 1 : 1-this.items.length);
			if(manual){
				this.stop();
			}
			if(noFx){
				this.fx.cancel().set((this.size*-this.currentIndex)+'px');
			}else{
				this.fx.start(this.size*-this.currentIndex);
			}
			if(manual && this.autoPlay){
				this.play(this.interval,'next',true);
			}
			if(this.onWalk){
				this.onWalk((this.items[this.currentIndex] || null), (this.handles && this.handles[this.currentIndex] ? this.handles[this.currentIndex] : null));
			}
		}
	}
	
});/*
 * VNO CES - JavaScript
 * Copyright 2009. All rights reserved.
 *
 * function: Availabilities Dropdown Updater
 * Description:  
 */

// Availabilities Drop down Options
			
Fla = new Class
({
  Implements: Options,
	options: {
	width: '411',
	height: '316',
	container: 'fla',
		params: {
				wmode: 'opaque',
				bgcolor: '#ffffff'	
		}
	},
  initialize: function(options)
  {
   // var bdy = $(document.body);
    //this.id = id = bdy.get('id');
		
		this.setOptions(options);
		
    this.flashHeaders();
		
    return this;
  },
	flashHeaders: function()
	{
	var url;	
	// Flash Headers Injecting
		var resDom = $('res_dmn').get('text');
		if ( $(document.body).hasClass('ndv') && $(document.body).hasClass('fla1')) {
				var swfDir = $('res_swf_dir').get('text');
				url = resDom+swfDir+'/slideshow.swf';
				//alert(url);
					
			} else if ( $(document.body).hasClass('ndv') && $(document.body).hasClass('fla2')) {
				
				var swfDir = $('res_swf_dir').get('text');
				url = resDom+swfDir+'/retail.swf';
				
			} else {
				
				url = "";
			}
			var obj = new Swiff(url, this.options);
	}
	
});

/*
 * VNO CES - JavaScript
 * Copyright 2009. All rights reserved.
 *
 * function: Sliseshow Class
 * Description:  Implements the NoobSlide.js plugin
*/

	
var Slide = new Class
({
  Implements: Options,
  initialize: function(element, options)
  {
    //element = $(element);
		this.setOptions(options);
		
    if ($(document.body).hasClass('sl'))
    {
				var mySlideShow = new noobSlide({
				box: $('box1'),
				items: [0,1,2],
				size: 411,
				autoPlay: true
			});
		}
    return this;
  }
});

/*
 * VNO CES - JavaScript
 * Copyright 2009 IBS All rights reserved.
 *
 * Class: Page
 * Description: Parent holder of per page scripts.
 *              This class is here only to ensure item returned if of Page parent.
 */
var Page = new Class
({
  Implements: Options,
  initialize: function(options) {}
});

/*
 * VNO CES - JavaScript
 * Copyright 2009 IBS All rights reserved.
 *
 * Class: Site
 * Description: Provides a clean init sequence.
 */
var Site = new Class
({
  Implements: Options,
  initialize: function(options)
  {
    var bdy = $(document.body), page;
    this.id = id = bdy.get('id');
		
		this.fla = new Fla();
		this.slide = new Slide();
		
		if (bdy.hasClass('js'))
    {
      try
      {
        eval('page = new Page.'+id.capitalize()+'()');
        if (!(page instanceof Page))
        {
          throw ("Invalid page object: "+id);
        }
      }
      catch(e)
      {
        alert(e.fileName+'\n'+e.name+': '+e.lineNumber+'\n'+e.message);
      }
    }
  }
});

/*
 * VNO CES - JavaScript
 * Copyright 2009. All rights reserved.
 *
 * function: Availabilities Dropdown Updater
 * Description:  
 */

// Availabilities Drop down Options
			
Page.Ho = new Class
({
  Implements: Options,
  Extends: Page,
	options: {
	width: '411',
	height: '211',
	container: 'c_fla',
		params: {
				wmode: 'opaque',
				bgcolor: '#ffffff'	
		}
	},
  initialize: function(options)
  {
     this.setOptions(options);
		
    this.hoFla();
		
		this.hoMarquee();
		
    return this;
  },
	hoFla: function()
	{
	var resDom = $('res_dmn').get('text');
	var url;	
		url = resDom+'images/flash/rpt_intro_4_30_09.swf';
		var obj = new Swiff(url, this.options);
	},
	
	hoMarquee: function()
	{
		mookieCarouselExample = new Mooquee({
			 element:'marquee',
			 cssitem: 'marquee_item',
			 firstitem:0,
			 firstitem:0,    
			 trans:{'tin':'left', 'tout':'left'},
   			duration:2,
   			pause:5
		});
	}
	
});

/*
 * VNO CES - JavaScript
 * Copyright 2009. All rights reserved.
 *
 * function: Availabilities Dropdown Updater
 * Description:  
 */

// Availabilities Drop down Options
			
Page.Map = new Class
({
  Implements: Options,
  Extends: Page,
	
  initialize: function(options)
  {
     this.setOptions(options);
		
     this.getMap();
		
    return this;
  },
	getMap: function()
	{	
		var map;
		map = new VEMap('myMap');
		map.LoadMap(new VELatLong(47.6, -122.33), 10 ,'h' ,false);
	}
	
});

/*
 * VNO CES - JavaScript
 * Copyright 2009 IBS All rights reserved.
 *
 * Main Entry Point
 */
window.addEvent('domready', function()
{
  try
  {
    site = new Site();
  }
  catch(e)
  {
    //alert(e.fileName+'\n'+e.name+': '+e.lineNumber+'\n'+e.message);
  }
});


