function viewSlideShow(imgs) {
    $("#GallerySlideShowOverlay").remove();
	$("body").append('<div id="GallerySlideShowOverlay" onclick="closeSlideShow()" style="position: fixed; width: 100%; height: 100%; background: url(/backstageAssets/components/GallerySlideShow/images/lightboxOverlay.png); left: 0px; top: 0px; z-index: 999;"></div>');
	//$("#GallerySlideShowOverlay").css("opacity", "0");
	//$("#GallerySlideShowOverlay").animate({opacity: 1}, 'slow');
	$("#GallerySlideShowOverlay").append('<div id="GallerySlideShowContainer" style="width: 720px; height: 480px; background: #AAA; position: absolute; top: 50%; left: 50%; margin: -240px 0 0 -360px;"></div>');
	$("#GallerySlideShowContainer").append('<img style="position: absolute; right: -10px; top: -10px; cursor: pointer;" onclick="closeSlideShow();" src="/backstageAssets/icons/closeBtn.png" alt="closeGallery" />');
	//$("#GallerySlideShowContainer").append('<iframe src="/backstageAssets/components/GallerySlideShow/default.aspx?Images=' + imgs + '" style="width: 716px; height: 476px; margin: 2px 0 0 2px;"></iframe>');
	$("#GallerySlideShowContainer").append('<iframe src="/backstageAssets/components/AINO-Galleria/default.aspx?Images=' + imgs + '" scrolling="no" style="width: 716px; height: 476px; margin: 2px 0 0 2px; background: #000;"></iframe>');
}
function closeSlideShow()
{
    $("#GallerySlideShowOverlay").remove();
}


function getSuiteInfo(url){
	if(url == ''){
		window.location = "/pages/availableSuites.aspx";
	}else{
		window.location= url;
	}
}

function goHome(){
	window.location = "/";
}


function showGalleryPic(strImg, strCaption) {
	openWindow("ViewImage.aspx?img=" + strImg + "&caption=" + strCaption, 650, 650);
}

// JavaScript Document
//function viewSlideShow(fsId) {
//	openWindow("ImageScroller.aspx?fsId=" + fsId, 900, 700);
//}

function viewImage(strImage) {
	openWindow(strImage, 600, 600);
}

function openWindow(url, w, h) {
  defaultWidth = 400;
  defaultHeight = 400;
  winWidth  = (w == null) ? defaultWidth  : w;
  winHeight = (h == null) ? defaultHeight : h;   
  winLeft = ((screen.availWidth  / 2) - 30) - (winWidth / 2);
  winTop  = ((screen.availHeight / 2) - 30) - (winHeight / 2);
  window.open(url, "", "width=" + winWidth + ", height=" + winHeight + ", left=" + winLeft + ", top=" + winTop + ", resizable=no, scrollbars=no");
} 

var popUpWin=0;
function popUpWindow(URLStr, width, height) {
	if(popUpWin) {
		if (!popUpWin.closed) popUpWin.close();
	}
	
	popUpWin = open(URLStr, 'popup', 'width=' + width + ',height=' + height + ',scrollbars=yes,status=yes,resizable=yes');
}
function Point(x, y) {
	this.x = x;
	this.y = y;
}

function getElementLocation(elementObj) {
	var cumulativeLeft = 0;
	var cumulativeTop  = 0;
	var elementToLocate = elementObj;
	cumulativeLeft = elementToLocate.offsetLeft;
	cumulativeTop  = elementToLocate.offsetTop;
	objParent = elementToLocate.offsetParent;

	while(objParent != null && objParent.tagName.toLowerCase() != "body"){
		cumulativeLeft  += objParent.offsetLeft;
		cumulativeTop   += objParent.offsetTop;
		objParent = objParent.offsetParent;
	}

	return new Point(cumulativeLeft, cumulativeTop);
}


function setMenuLocation() {
  var menu = document.getElementById("menu");
  var parentTag = document.getElementById("menuLocation");
  var mloc = getElementLocation(parentTag);
  menu.style.left = mloc.x;
  menu.style.top = mloc.y + 30;
}


var menuStatus = "closed";

function doMenu(img) {
  var menu = document.getElementById("menu");
  // open menu
  if (menuStatus == "closed") {
    menu.style.visibility = 'visible';
    menuStatus = "open"
    swapImage(img, "images/menuProductsH.gif");
  // close menu
  } else {
    menu.style.visibility = "hidden";
    menuStatus = "closed"
    swapImage(img, "images/menuProducts.gif");
  }
}

function hideMenu() {
	var menu = document.getElementById("menu");
    menu.style.visibility = "hidden";
    menuStatus = "closed"
    swapImage(document.getElementById('menuLocation'), "images/menuProducts.gif");
}

function highlight(row) {
  row.className = "highlight";
}

function unhighlight(row) {
  row.className = "";
}

// shows info message and fowards to a url
function go(url, message, style){
  var defualtStyle = "header";
  var defualtMessage ="loading...";
  if(style == null || style == ""){ style = defualtStyle; }
  if(message == null || message == ""){ message = defualtMessage; }  
  if(url != null && url != ""){
    showInfoMessage(message, style);
  }
  window.location = url;
}

// swaps an image src with a specified image at the provided path
function swapImage(img, path){
  if(img != null){
    img.src = path;
  } else {
    alert("could not swap image");
  }
}

