//-------------------------------Sliding images--------------------------------------->
<!--
var move = 0;
var ulWidth;
var totalSlide = 456;
var imageWidth = 228;
var imageMargin = 0;
var rows = 2;
var animateTime = 25;
var position = 0;
var speed = 19;
var endRight = false;
var endLeft = false;
var animate = new Array();
var imageArray = new Array();
var imageUl;
var imageSlider;
var ulWidth;

function makeWidth(){
	if(!document.getElementById('photoGallery')) return false;
	imageUl = document.getElementById('photoGallery');
	imageArray = imageUl.getElementsByTagName('li');
	imageSlider = document.getElementById('photoSlider');
	ulWidth = (((imageArray.length)*imageWidth)+((imageArray.length)*imageMargin))/rows;
	imageSlider.style.width = ulWidth+'px';
	imageUl.style.width = ulWidth+'px';
}
function addArrowEvent(){
	if(!document.getElementById('arrowLeft')) return false;
	var arrowLeft = document.getElementById('arrowLeft');
	var arrowRight = document.getElementById('arrowRight');
	arrowLeft.onClick=function(){
		imageSlide('left');
		return false;
	}	
	arrowRight.onClick=function(){
		imageSlide('right');
		return false;
	}
}
function addImageClass(){
	if(!document.getElementById('photoGallery')) return false;
	imageUl = document.getElementById('photoGallery');
	imageArray = imageUl.getElementsByTagName('li');
	if(imageArray.length%2 != 0) {
		imageLi = document.createElement('li');
		imageUl.appendChild(imageLi);
	}
	var counter = 1;
	for(i=0;i<(imageArray.length/2);i++){
		if (counter%2 == 0){
			imageArray[i].className='two';
		}else{
			imageArray[i].className='one';
		}
		counter++;
	}
	counter = 1;
	for(j=imageArray.length/2;j<imageArray.length;j++){
		if (counter%2 == 0){
			imageArray[j].className='four';
		}else{
			imageArray[j].className='three';
		}
		counter++;
	}
}
function imageSlide(direction){
	if (direction == 'right'){
		if(-(position-totalSlide) >= (ulWidth)){
			document.getElementById('arrowRight').className='disable';
			endRight=true;
		}else{
			document.getElementById('arrowLeft').className='enable';
			endRight=false;
			moveRight();
		}
	}else{
		if(position >= 0){
			document.getElementById('arrowLeft').className='disable';
			endLeft=true;
		}else{
			document.getElementById('arrowRight').className='enable';
			endLeft=false;
			moveLeft();	
		}
	}
	return false;
}	
function moveRight(){
	if (animate[0]!=true){
		if ((move-speed) >= -totalSlide && endRight != true && position != ulWidth){
			move=move-speed;
			imageSlider.style.left = position+move+'px';
			timerId=setTimeout(moveRight, animateTime);
			animate[1]=true;
		}
		else{
			position=position+move;
			move=0;
			animate[1]=false;
			if(-(position-totalSlide) >= ulWidth){
				document.getElementById('arrowRight').className='disable';
				endRight=true;
			}
		}
	}
}
function moveLeft(){
	if (animate[1]!=true){
		if ((move+speed) <= totalSlide && endLeft != true && position != 0){
			move=move+speed;
			imageSlider.style.left = position+move+'px';
			timerId=setTimeout(moveLeft, animateTime);
			animate[0]=true;
		}
		else{
			position=position+move;
			move=0;
			animate[0]=false;
			if(position >= 0){
				document.getElementById('arrowLeft').className='disable';
				endLeft=true;
			}
		}
	}
}

//-------------------------------Hover Links-------------------------------------------> 
function hoverLinks(){
	/*if(!document.getElementById('photoGallery')) return false;
	var imageUl = document.getElementById('photoGallery');
	var imageArray = imageUl.getElementsByTagName('li');
	var linkArray = imageUl.getElementsByTagName('a');
	
	for(i=0;i<imageArray.length;i++){
		links = imageArray[i].getElementsByTagName('span');
		imageArray[i].onmouseover=function(){
			var container = this.getElementsByTagName('span');
			container[0].style.display = 'block'
		}
		imageArray[i].onmouseout=function(){
			var container = this.getElementsByTagName('span');
			container[0].style.display = 'none'
		}
	}
	for(j=0;j<linkArray.length;j++) {
		if(linkArray[j].className.match('email')) {
			linkArray[j].onclick = function() {
				var pictureLink = this.href;
				this.href = 'mailto:enter@email.com?subject=I want to share a picture from Miller Lite ATL Lounge with you&body=Click this link '+pictureLink+' to view the image';
			}
		}
	}*/	
}
//-------------------------------Reset Fields------------------------------------------->
function resetFields(){
	if(!document.getElementsByTagName('form')) return false;
	var prepareForm = document.getElementsByTagName('form');
	for(i=0; i<prepareForm.length; i++){
		var inputArray = prepareForm[i].getElementsByTagName('input');
		for(j=0;j<inputArray.length;j++){
			if(inputArray[j].type == 'submit') continue;
			if(!inputArray[j].defaultValue) continue;
			inputArray[j].onfocus = function(){
				if (this.value == this.defaultValue){
				this.value = '';
				}
			}
			inputArray[j].onblur = function(){
				if(this.value == ''){
					this.value = this.defaultValue;
				}
			}
		}
	}
}


//-------------------------------Add Load Event--------------------------------------->
function addLoadEvent(func){
	var oldonload=window.onload;
	if(typeof window.onload != 'function'){
		window.onload = func;
	}else{
		window.onload = function(){
		oldonload();
		func();
		}
	}
}

addLoadEvent(makeWidth);
addLoadEvent(addImageClass);
addLoadEvent(addArrowEvent);
addLoadEvent(hoverLinks);
addLoadEvent(resetFields);
-->
