function go2News(newsKey)
{
	document.location = $(".linkReadMore")[0].href + '#newsKey' + newsKey;
}

function doLogin()
{
	UserLogin(document.getElementById("txtUser").value, document.getElementById("txtPass").value, UserLogin_CallBack)
}

function doLogout()
{
	UserLogout(UserLogout_CallBack)
}

function UserLogin_CallBack(data)
{
	if (data == trueStr.toLowerCase())
	{
		document.location = dealerUrl;
	}
	else
	{
		$('.invalidPassword')[0].style.display = "block";
	}
}

function showSubMenu()
{
	document.getElementById("divSubMenuInner").style.display = "block";
}

function hideSubMenu()
{
	document.getElementById("divSubMenuInner").style.display = "";
}

function UserLogout_CallBack(data)
{
	window.location.reload();
}

var MAX_PER_PAGE = 3;
var imageList, pageCount;
var currentPage = 0;
function go2Pg(pageIndex)
{
	if (pageIndex < 0)
	{
		pageIndex = 0;
	}
	else if (pageIndex >= pageCount)
	{
		pageIndex = pageCount - 1;
	}
	currentPage = pageIndex;
	for (var i = 0; i < imageList.length; i++)
	{
		var displayStr = "none";
		if ((i >= (pageIndex * MAX_PER_PAGE)) && (i < ((pageIndex + 1) * MAX_PER_PAGE)))
		{
			displayStr = "block";
		}
		imageList[i].style.display = displayStr;
	}

	var firstPicIndex = pageIndex * MAX_PER_PAGE;
	if (firstPicIndex < 10)
	{
		firstPicIndex = "0" + firstPicIndex.toString();
	}
	var firstPic = document.getElementById("ctl00_MainPlaceHolder_lstmccutcheon_portfolio_ctl" + firstPicIndex + "_ctlpicture")
	switchPhoto(firstPic);
}

function switchPhoto(sender)
{
	$("#ctlphotoLarge").fadeTo("slow", 0.33, function () {
		document.getElementById("ctlphotoLarge").src = sender.src.replace("width=150", "width=500");
		$("#ctlphotoLarge").fadeTo("slow", 1);
	});
	document.getElementById("divDescription").innerHTML = document.getElementById(sender.id.replace("ctlpicture", "ctldescription")).innerHTML;
}