sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function selectField(param) {
	elem = document.getElementById(param);
	elem.value="";
	setTimeout("elem.select()",0);
}

function changeClass(id, newClass) {
   identity=document.getElementById(id);
   identity.className=newClass;
}
function miniProfileOn(evt,id) {
	eIE=window.event;
	if(eIE){
		x=eIE.offsetX;
		y=eIE.offsetY;
	} else{
		x=evt.layerX;
		y=evt.layerY;
	}
	a1=document.getElementById(id).style;
	if((x<=150)&&(x>3)&&(y<80)&&(y>3)){
		a1.display="block";
		a1.marginLeft=3+x+"px";
		a1.marginTop=3+y+"px";
	} else {
		a1.display="none";
	}
	var img_el = document.getElementById(id+'-img');
	img_el.src = img_el.getAttribute('rel');
}
function miniProfileOff(id){
	a1=document.getElementById(id).style;
	a1.display="none";
}
function showTab(show_id)
{
  var hide_id = (show_id == 'registry') ? 'honeymoon' : 'registry';
  var hide_el = document.getElementById(hide_id);
  hide_el.style.display = 'none';
  var show_el = document.getElementById(show_id);
  show_el.style.display = 'block';
  return false;
}

function commentReply( commentId, username) {
	var inReplyFor = '@<a href="#comment-'+ commentId +'">'+ username +'</a>: ';
	document.getElementById( 'comment' ).value = document.getElementById( 'comment' ).value + inReplyFor;
	return false;
}
if (typeof ord=='undefined') {ord=Math.random()*10000000000000000;}

function calcHeight(elem) {
	var the_height=500; var padding=0;
	try {
		if( elem.contentWindow && elem.contentWindow.document) { the_height=elem.contentWindow.document.body.scrollHeight; }
	} catch(e){}
	elem.height = the_height + padding;
}

