// Object Position
function showPosition(obj){
	alert(findPosX(obj));
	alert(findPosY(obj));
}


function showProfileSummaryBox(obj, loadObjId){
	
	
	var x = (findPosX(obj)) + obj.width + 3;
	var y = (findPosY(obj)) - 3;
	
	if (document.all) {// MSIE
		x = x + 10;
		y = y + 18;
	}
	var loadObj = document.getElementById(loadObjId);
	
	loadObj.style.visibility='visible';
	loadObj.style.display= '';
	loadObj.style.position = 'absolute';
	loadObj.style.left = x + 'px';
	loadObj.style.top  = y + 'px';
	
}

function hideProfileSummaryBox(loadObjId){
	var loadObj = document.getElementById(loadObjId);
	loadObj.style.visibility='hidden';
	loadObj.style.display= 'none';
}

function findPosX(obj)
{
 var curleft = 0;
 if (document.getElementById || document.all)
 {
  while (obj.offsetParent)
  {
   curleft += obj.offsetLeft
   obj = obj.offsetParent;
  }
 }
 else if (document.layers)
  curleft += obj.x;
 return curleft;
}

function findPosY(obj)
{
 var curtop = 0;
 if (document.getElementById || document.all)
 {
  while (obj.offsetParent)
  {
   curtop += obj.offsetTop
   obj = obj.offsetParent;
  }
 }
 else if (document.layers)
  curtop += obj.y;
 return curtop;
}


// Class Change


function setObjectClass(obj, className){
	obj.className= className;
}

function sendToAFriend()
 {
    var url = window.location.href;
 	var title = window.document.title;
	var redirectTo = 'formEmail.php?url=' + url + '&title=' + title;

	popUpWindow(redirectTo,'Send To A Friend', '350','450');

 }


function popUpWindow(sURL, title,w,h) {
     var winl = (screen.width - w) / 2;
     var wint = (screen.height - h) / 2;
     winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+'resizable=0'
    window.open(sURL, "", winprops)
 } 
 

function addFavorites()
 {
   if (document.all) // MSIE
      {
	      window.external.AddFavorite (window.location.href,window.document.title);
      }
	else if (window.sidebar){ //FIREFOX
	  window.sidebar.addPanel(window.document.title,window.location.href,"");
	}
	else
	{
		alert("Sorry, your browser doesn't support this");
	}
 }
   
   
   
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
//alert('Query Variable ' + variable + ' not found');
}