var services = "<a href='http://www.appgeo.com/Services/tabid/94/Default.aspx'><div style='height: 260px; width: 618px;cursor: hand;'></div></a>";
var solutions = "<a href='http://www.appgeo.com/CustomSolutions/tabid/85/Default.aspx'><div style='height: 260px; width: 618px;cursor: hand;'></div></a>";
var sector = "<a href='http://www.appgeo.com/SectorsWeServe/tabid/58/Default.aspx'><div style='height: 260px; width: 618px;cursor: hand;'></div></a>";
var portfolio = "<a href='http://www.appgeo.com/Portfolio/tabid/78/Default.aspx'><div style='height: 260px; width: 618px;cursor: hand;'></div></a>";
var welcome = "<a href='http://www.appgeo.com/AboutAppGeo/tabid/53/Default.aspx'><div style='height: 260px; width: 618px;cursor: hand;'></div></a>";

var buttonClass = "";

 function openHidden(url){
        open("http://dev.appgeo.com/LinkTracker/FileViewer.aspx?id=" + url,"FileViewer","location=0,directories=0,title=0,top=0,left=0,width=900,height=650,status=no,resizable=yes,scrollbars=yes");
    }

function ChangeContent(section){
	var htmlString;

	switch(section){
		case "services":
			htmlString = services;
			break;
		case "solutions":
			htmlString = solutions;
			break;
		case "sector":
			htmlString = sector;
			break;
		case "portfolio":
			htmlString = portfolio;
			break;
		default:
			htmlString = welcome;
	}

	var dynamicCell = document.getElementById("dynamicContent");
	if (dynamicCell != null)
	{
		dynamicCell.className = section;
		dynamicCell.innerHTML = htmlString;
	}
}

function RedirectClient(key){
	switch(key){
		case "Vermont33":
			window.location = "http://host.appgeo.com/VTEconDevWiki/"
		break;
		default:
			document.getElementById('error').value = "Invalid key."
		break;
	}
}

//for homepage project highlight descriptions
function move_box(an, box) {
  var cleft = 5;
  var ctop = -1;
  var obj = an;
  while (obj.offsetParent) {
    cleft += obj.offsetLeft;
    ctop += obj.offsetTop;
    obj = obj.offsetParent;
  }
  box.style.left = cleft + 'px';
  ctop += an.offsetHeight + 0;
  if (document.body.currentStyle &&
    document.body.currentStyle['marginTop']) {
    ctop += parseInt(
      document.body.currentStyle['marginTop']);
  }
  box.style.top = ctop + 'px';
}

function show_hide_box(an, picName, text) {
  var href = an.href;
  var boxdiv = document.getElementById(href);

  if (boxdiv != null) {
    if (boxdiv.style.display=='none') {
      move_box(an, boxdiv);
      boxdiv.style.display='block';
    } else
      boxdiv.style.display='none';
	  document.body.removeChild(boxdiv);
    return false;
  }

  boxdiv = document.createElement('div');
  boxdiv.setAttribute('id', href);
  boxdiv.style.display = 'block';
  boxdiv.style.textAlign = 'center';
  boxdiv.style.padding = '5 0 0 0';
  boxdiv.style.position = 'absolute';
  boxdiv.style.width = '150px';
  boxdiv.style.height = '150px';
  boxdiv.style.border = '1px solid #085D7B';
  boxdiv.style.backgroundColor = '#fff';

/*  var title = document.createElement('span');
  title.innerHTML = 'GPV';
  title.style.fontFamily = 'verdana, arial';
  title.style.color = '#085D7B';
  title.style.fontSize = '17px';
  title.style.letterSpacing = '2px';

  var br = document.createElement('br');

  var contents = document.createElement('img');
  contents.style.border = 'solid 0px white';
  contents.style.margin = '5 0 0 0';
  contents.src = 'FeaturedProjectImages/' + picName + '_Thumb.jpg';

  boxdiv.appendChild(title);
  boxdiv.appendChild(br);
  boxdiv.appendChild(contents);*/

  var innerContent = "<span style='font-family: Verdana, Arial; color: #085D7B; font-size: 12px; letter-spacing: 2px;'>" + text + "</span><br/>" + 
  "<img src='http://www.appgeo.com/Portals/_default/Skins/AppGeoSkin/Featured/" + picName + "_Thumb.jpg' style='border: solid 0px white; margin: 5 0 0 0;'/>";

  boxdiv.innerHTML = innerContent;
  document.body.appendChild(boxdiv);
  move_box(an, boxdiv);

  return false;
}