//
// slide-down code and functions © Andrew Green 2004
//

var ie=document.all;
var dom=document.getElementById;
var ns4=document.layers;
var ns6=document.getElementById&&!document.all;
var calunits=document.layers? "" : "px";
var direction="up";
var lpos;
var htmlsource;
var SiteColour;
var DontDeleteThis;
var DontChangeThis1;
var DontChangeThis2;
var DontChangeThis3;
var SlideDownOK = 'no';

// Begin function for getting correct object prefix, according to how browser treats document elements

function GetObject(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);	
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

// End -->

// Begin function for changing anchor tag style on mouseover 

function ChangeStyle(ElementId,overandout)
{
  var ElementObjectName = new GetObject(ElementId);
  if (overandout == 'over')
  {
	ElementObjectName.style.textDecoration = 'underline overline';
	ElementObjectName.style.color = 'green';
  }
  else
  {
	ElementObjectName.style.textDecoration = 'underline';
	ElementObjectName.style.color = 'blue';
  }  
}

// End -->

function InitialiseBox()
{if (!dom&&!ie&&!ns4) return;
crossobject = new GetObject('SlidedownDiv');
crossobj = crossobject.style;
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset;
crossobj.top=scroll_top-250+calunits;
crossobj.visibility=(dom||ie)? "visible" : "show";
dropstart=setInterval("slidein()",10)}

function slidein()
{if (parseInt(crossobj.top)<(scroll_top+lpos)) crossobj.top=parseInt(crossobj.top)+10+calunits;else clearInterval(dropstart)}

function HideBox(){crossobj.visibility=(dom||ie)? "hidden" : "hide"}

function truebody(){return (document.compatMode!="BackCompat")? document.documentElement : document.body}

function SlideDown(main_bgcolor,main_texttype,main_textsize,main_textcolor,textbar,height,width,top,left,bordercolor,borderstyle,borderwidth,sec)
{
	if (SlideDownOK == 'no') return;
	lpos = top
	ans="no"
	var DivisionName = new GetObject("SlidedownDiv");
	DivisionName.style.border = bordercolor+' '+borderwidth+'px '+borderstyle
	DivisionName.style.height=height +'px'
	DivisionName.style.width =width +'px'
	DivisionName.style.left =left +'px'
	DivisionName.style.top =top +'px'
	DivisionName.style.backgroundColor=main_bgcolor
	DivisionName.style.color = main_textcolor
	DivisionName.style.fontFamily = main_texttype
	DivisionName.style.fontSize = main_textsize+'pt'
	DivisionName.obj.innerHTML=textbar
	setTimeout("InitialiseBox()",(sec*1000));	
}


//window.onload=InitialiseBox

function LFMslide (SiteId,Colour)
	{
	var LinkDivision = new GetObject("DontDeleteThis");
	SlideDownOK = 'yes';	
	LinkDivision.style.display = 'none';
	var atsign = '@';
	SiteUrl = 'www.LovefromMe.co.uk';
	SiteEmail = 'email.list' + atsign + 'lovefromme.co.uk';
	SiteColour = Colour	
	htmlsource = '<center>'
	+ '<img src="layout_images/top_border_for_slidedown.jpg" width="350" height="85" border=0 alt="romantic gifts for men and women @ www.LovefromMe.co.uk" title="romantic gifts for men and women @ www.LovefromMe.co.uk">'
	+ '<br>'
	+ '<span style="font-size:13pt;font-weight:normal;">' 
	+  SiteUrl
	+ '</span>'
	+ '<span style="color:red; font-size:11pt;font-weight:normal;">'
	+ '<br><br>'
	+ '<b>Did you like what you saw?</b><br><br>'
	+ 'We are continually sourcing new suppliers and products for you, so keep coming back for new surprises for the special man or woman in your life ...'
	+ 'or, better still, become one of the first people to hear about all our new gift ideas - just '
	+ '<a id="SiteEmailLink1" style="color:blue;text-decoration:underline;font-size:11pt;" href="mailto:' + SiteEmail + '?subject=Please add my email address to your Mailing List&body=My name is: " title="click here to be put on our mailing list"  onmouseover="ChangeStyle(\'SiteEmailLink1\',\'over\');" onmouseout="ChangeStyle(\'SiteEmailLink1\',\'out\');">'
	+ 'click here</a> '
	+ 'to be put on our email list and receive all the latest news.</b>'
	+ '</span>'	
	+ '<br><br>'
	+ '<span style="color:red;font-size:7pt;font-weight:normal;">'
	+ '* Please note that your name &amp; email details will <u>never</u> be passed to anyone else *'
	+ '<br>'
	+ 'We respect your privacy and security'
	+ '</span>'
	+ '<br><br>'
	+ '<span style="color:black;font-size:7pt;font-weight:normal;">'
	+ 'this slide down window is &copy; '
	+ '<a id="AndrewLink" style="color:blue;text-decoration:underline;font-size:7pt;" href="http://www.andrewgreen.biz" target="_blank" title="visit AndrewGreen.biz for website design &amp; advice" onmouseover="ChangeStyle(\'AndrewLink\',\'over\');" onmouseout="ChangeStyle(\'AndrewLink\',\'out\');">'
	+ 'Andrew Green</a>'
	+ '<br>'
	+ 'in association with '
	+ '<a id="1art1Link" style="color:blue;text-decoration:underline;font-size:7pt;" href="http://www.lovefromme.co.uk" target="_blank" title="visit Love from Me for the best romantic gifts" onmouseover="ChangeStyle(\'1art1Link\',\'over\');" onmouseout="ChangeStyle(\'1art1Link\',\'out\');">'
	+ 'www.LovefromMe.co.uk</a>'
	+ '<br><br>'
	+ '<a id="CloseLink" style="color:blue;text-decoration:underline;font-size:8pt;" href="#" onclick="{HideBox();return false;}" style="color:blue;font-family:\'Verdana\',\'Arial\',\'Helvetica\',sans-serif;" onmouseover="ChangeStyle(\'CloseLink\',\'over\');" onmouseout="ChangeStyle(\'CloseLink\',\'out\');">'
	+ '<u>|close window|</u></a>'
	+ '</span>'

	document.write ('<div id="SlidedownDiv" style="position: absolute; height: 435px; width: 390px; left: 215px; top: 25px; visibility: hidden; border: 2px solid red; padding:10px; background-color: white; color: black; font-family: \'Arial\',\'Helvetica\',sans-serif; font-size: 10pt;font-weight:normal;z-index:20 ">'); 
	document.write (htmlsource);
	document.write ('</div>');

	} 
