// JavaScript Document

var scrollThrottle = Number(100);
var leftEnd = Number(0);
var rightEnd = Number(-400);
var currentPosition = Number(0);
var newPotision = Number(0);


function scrollFeaturedLeft() {	
	//Check for end of track
	if(currentPosition != leftEnd){
		newPotision = currentPosition + scrollThrottle;
	}else{
		newPotision = rightEnd;
	}
	
	setPosition();
}

function scrollFeaturedRight() {	
	//Check for end of track
	if(currentPosition != rightEnd){
		newPotision = currentPosition - scrollThrottle;
	}else{
		newPotision = leftEnd;
	}
	
	setPosition();
}

function setPosition() {
	if(document.getElementById("featured_scroll_track")){
		document.getElementById("featured_scroll_track").style.marginLeft = newPotision+"px";;
	}else{
		document.all.featured_scroll_track.style.marginLeft = newPotision+"px";
	}
	
	currentPosition = newPotision;
}

function openWindow(url, wname, width, height) {
	window.open(url, wname, "height=" + height + ",width=" + width + "location = 0, status = 0, resizable = 0, scrollbars=0, toolbar = 0");
	return true;
}

function submitTellUsForm() {
	openWindow('http://www.pink-blue.com/tellUsForm.php', 'popupWin', 265, 200);
}
