var types = ['US Rep.', 'US Senator'];
var parties = ['Republican', 'Democratic'];
var classes = ['rep', 'dem'];

var link = '/elected-official-details/?legMemId=';
var img  = 'http://dev-ws.illumen.org/stream/PublicOfficialImageServlet?id=';
var pos = 0, cPos = 0;


goSpot = function(whichWay){
	var $overall = $('#theSpotlight');
	//$overall.fadeOut(150);
	cPos = getPos(whichWay);

	var $spotlinkTop = $('#spotLinkTop');
	var $spotlinkBot = $('#spotLinkBot');
	var $spotImg = $('#spotImg');
	var $info = $('#spotInfo');



	$spotlinkTop.attr("href", link + ids[cPos]);
	$spotlinkBot.attr("href", link + ids[cPos]);
	// $spotlinkBot.html("Learn More About " + names[cPos]);
	// $spotlinkBot.html("Learn More...");


	$spotImg.attr("src", img + photos[cPos]);

	var tempString = types[type[cPos]] + "<br />" +
			 names[cPos] + "<br />" +
			 "<span class=\"" + classes[party[cPos]] + "\">" + parties[party[cPos]] + "</span><br />" +
			 district[cPos];

	$info.html(tempString);
	//$overall.fadeIn(250);

	$overall.focus();
}


getPos = function (whichWay) {
	pos = pos + whichWay;
	if((pos<=0) || (pos==ids.length) ){
		pos = 0;
	}
	return pos;
}


goToState = function(theDrop){
	var oDrop = document.getElementById(theDrop);
	if(oDrop){
		location.href = 'http://www.meetthe112th.com/elected-officials/?state=' + oDrop.value;
	}
}

