var t;

function descriptions(dname)
{
	var descstring;
	if(dname=='signatureprint')
		descstring='<b><em class="red">NEW in 2009</em> <i>Signature Print</i></b>\
			<hr>An extra special momento of your wedding day you can \
			show off. Let your guests sign the mounting matt of your engagement \
			photo, which is then professionally framed after the wedding. \
			<p>See our blog post <a href="http://rhotography.co.uk/blog/2009/05/signature-print/">What is our Signature Print</a> for an example.';
	else if(dname=='digitalairbrush')
		descstring='<b>Digital air brushing</b><hr>\
				Using techniques from fashion magazines to \
				give their models the perfect skin and figure. You \
				too can feel and look like a celebrity, be the envy \
				of all your friends and family.';
	else if(dname=='cherishyourdress')
		descstring='<b><em class=red>NEW in 2009</em> <i>Cherish Your Dress</i></b><hr >\
					Similar to a "trash the dress" shoot except you don\'t have to ruin the \
					dress if you don\'t want to. Essentially a fashion photoshoot after \
					your wedding away from the pressures of the \
					big day. Be a model for a day and show off \
					your expensive dress once more.';

	return descstring;
}


function getY( oElement )
{
	var iReturnValue = 0;
	while( oElement != null ) {
		iReturnValue += oElement.offsetTop;
		oElement = oElement.offsetParent;
	}
	return iReturnValue;
}

function getX( oElement )
{
	var iReturnValue = 0;
	while( oElement != null ) {
		iReturnValue += oElement.offsetLeft;
		oElement = oElement.offsetParent;
	}
	return iReturnValue;
}


function overlaybox(action,obj,dname)
{
    if(action==1){
        clearTimeout(t);
        document.getElementById('overlaybox').style.left = getX(obj) + obj.offsetWidth-10;
        document.getElementById('overlaybox').style.top = getY(obj )+10 ;
        if(dname!='') document.getElementById('overlaybox').innerHTML =descriptions(dname);
        document.getElementById('overlaybox').style.visibility = 'visible';
        document.getElementById('overlaybox').onmouseover=function() {clearTimeout(t); };
        document.getElementById('overlaybox').onmouseout= function() { overlaybox(0,this,'') };
    }else{
        t=setTimeout("document.getElementById('overlaybox').style.visibility = 'hidden';document.getElementById('overlaybox').innerHTML ='';",200);
    }
}
