﻿/****************************************************************************
	Generics
****************************************************************************/

function GetAbsLeft(element) {
	var xPos = element.offsetLeft;
	var tempEl = element.offsetParent;
  	while (tempEl != null) {
  		xPos += tempEl.offsetLeft;
  		tempEl = tempEl.offsetParent;
  	}
	return xPos;	
}

function GetAbsTop(element) {
	var yPos = element.offsetTop;
	var tempEl = element.offsetParent;
  	while (tempEl != null) {
  		yPos += tempEl.offsetTop;
  		tempEl = tempEl.offsetParent;
  	}
	return yPos;
}


function unscramble(str) {
	location.href = "mailto:"+str.replace(/\-/i, "@");
}


/****************************************************************************
	Case related
****************************************************************************/
function changeCaseMainImage(imagePath)
{
    $("MainImage").src=imagePath;
}