var strFront, strEnd, divHeight, scrh, count;
var intervalDROP, div_ID, dropPREV;
var divH1, divH2, divH3, divH4, divH5, divH6, divH7;
var loaded = 0;
var homeview=0;

function setup()
{
 var w, hole;
 scrh = document.getElementById("MAINTABLE").offsetHeight;

 whichVersion();
 if(b=="IE")
  {
   strFront = "document.all.";
   strEnd =".style";
  }
 else
  {
   strFront = "document.";
   strEnd = "";
  }
}

function whichVersion()
{
 var myBrowser = navigator.userAgent;
 if((myBrowser.lastIndexOf("MSIE")!=-1) && (myBrowser.lastIndexOf("5.")!=-1))b = "IE";
 if((myBrowser.lastIndexOf("MSIE")!=-1) && (myBrowser.lastIndexOf("4.")!=-1))b = "IE";
 if((myBrowser.lastIndexOf("MSIE")!=-1) && (myBrowser.lastIndexOf("3.")!=-1))b = "IE";
 if((myBrowser.lastIndexOf("MSIE")==-1) && (myBrowser.lastIndexOf("2.")!=-1))b = "NS";
 if((myBrowser.lastIndexOf("MSIE")==-1) && (myBrowser.lastIndexOf("3.")!=-1))b = "NS";
 if((myBrowser.lastIndexOf("MSIE")==-1) && (myBrowser.lastIndexOf("4.")!=-1))b = "NS";
 document.getElementById("LOGO_SPACE").width = document.getElementById("topbarVIOLET").offsetWidth-84;
}

function CheckForm(inForm) 
{  
	var sre, srn, srs, sra, lsAT, lsDOT;

	sre   = (inForm.EMAIL.value);
	srn   = (inForm.NAME.value);
	sra   = (inForm.ADDRESS.value);
	srs   = (inForm.TELNUM.value);
	lsAT  = (inForm.EMAIL.value.indexOf("@"));
	lsDOT = (inForm.EMAIL.value.indexOf("."));
	
	if(sre == "" || srn == "" || sra == "" || srs == ""  ) 
	 {
		alert("Please complete all areas of the form");
		return false;	
	 }

	if (lsAT == -1 || lsDOT == -1 ) 
	 {
	  alert("Please enter a Valid Email Address");
	  inForm.EMAIL.select();
	  return false;
   }		
 return CheckTags();
}

function CheckTags()
{
  var i, j, IsTagOp, IsTagCl, GotTag; 
  GotTag = 0;
  for(j = 0; j < document.forms.length; j++)
   {
    for(i = 0; i < document.forms[j].elements.length; i++)
       {
         lsTagOp  = (document.forms[j].elements[i].value.indexOf("<"));
         lsTagCl   = (document.forms[j].elements[i].value.indexOf(">"));
   	   if (lsTagOp > -1)GotTag++;
	   if (lsTagCl  > -1)GotTag++;
         if(GotTag)
	    {
	     alert("Please remove the characters < or > from your entry as they are not allowed");
	     document.forms[j].elements[i].select();
	     return false;
	    }
       }
   }
}

function ShowMenu()
{
 var strText;
 strText = "<table width='100%' border='0' cellspacing='0' cellpadding='5'>";
 strText = strText + "<tr><td><a ID='RAINBOW' class='opening' href='javascript:ShowPicture();'>rainbow</a></td></tr>";
 strText = strText + "<tr><td><a class='mainmenu' href='people.asp'>people</a></td></tr>";
 strText = strText + "<tr><td><a class='mainmenu' href='portfolio.asp'>portfolio</a></td></tr>";
// strText = strText + "<tr><td><a class='mainmenu' href='parkour.asp'>parkour</a></td></tr>";
// strText = strText + "<tr><td><a class='mainmenu' href='news.asp'>news</a></td></tr>";
// strText = strText + "<tr><td><a class='mainmenu' href='vocabulary.asp'>vocabulary</a></td></tr>";
// strText = strText + "<tr><td><a class='mainmenu' href='links.asp'>links</a></td></tr>";
 strText = strText + "<tr><td><a class='mainmenu' href='contact.asp'>contact / map</a></td></tr></table>";
 document.getElementById("MENUBAR").innerHTML = strText;
}


function ShowPicture()
{
 var strText;
 strText = "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
 strText = strText + " <tr><td height='150'>&nbsp; </td></tr>";
 strText = strText + "<tr align='center'><td><img src='images/rainbow.jpg' width='220' height='300'> </td></tr>";
 strText = strText + "</table>";
 document.getElementById("MAINPIC").innerHTML = strText;
 ShowText();
}

function ShowText()
{
 var strText;
 strText = "<p class='blurb_title'>bringing colour to business</p>";
 strText = strText + "<p class='blurb'>Rainbow is a creative design and marketing<br>resource with a firm focus on business strategy.</p>";
 strText = strText + "<p class='blurb'>We have local, regional, national and global experience<br>of design, marketing initiatives, communications projects<br>and their implementation.</p>";
 strText = strText + "<p class='blurb'>Our people are able to offer a unique blend of skills<br>that can be tailored to match your requirement and objectives.</p>";
 strText = strText + "<p class='blurb_title'>in beautiful Suffolk where rainbows are plentiful</p>";
 document.getElementById("MAINTEXT").innerHTML = strText;  
 document.getElementById("RAINBOW").className = "current";              
}

function ShowLink(set, linktype, setlink)
{
 var linkText;
 document.getElementById("MEDIA").style.visibility = "hidden";
 if(set)
  {
   switch(linktype)
	  {
		 case 0: break;
		 case 1: break;
		 case 2: linkText = "<embed src='" + setlink + "' /></embed>";break;
//     case 2: linkText = "<object data='" + setlink + "' type='video/avi' />";break;
// 		 case 2: linkText = "<a href='" + setlink + "' target='_blank'/>CLICK HERE TO PLAY</a>";break;
		}
   document.getElementById("MEDIA_TARGET").innerHTML = linkText;
   document.getElementById("MEDIA").style.visibility = "visible";
  }               
}

function LogicInfo(lSet, lID, evt)
{
var blurb;
if(lSet==0)document.getElementById("LogicBlurb").style.visibility = "hidden";
else
{
 switch(lID)
 {
  case 1: blurb="<b>County Estate Management</b><br />A leading source of specialist<br />services in the residential<br />property management sector.";break;
  case 2: blurb="<b>Five Gold</b><br />Performance leisurewear collection<br />inspired by five-times Olympic Gold<br />medalist, Sir Steve Redgrave.";break;
  case 3: blurb="<b>Light Years Ahead</b><br />Manufacturer of dedicated lighting<br />systems for hospitals, prisons<br />and police establishments.";break;
  case 4: blurb="<b>Oaksmere Refrigeration</b><br />An all-encompassing service<br />for the design and installation<br />of refrigeration systems.";break;
  case 5: blurb="<b>Rooftop Mortgages</b><br />Established nationwide mortgage<br />lender offering a comprehensive<br />range of products.";break;
  case 6: blurb="<b>Salthouse Harbour Hotel</b><br />Handsome and striking four star<br />hotel beside the Neptune Marina<br />waterfront at Ipswich.";break;
  case 7: blurb="<b>The Land Group</b><br />Specialist in project finance<br />and development within public<br />and private sectors in the UK.";break;
  case 8: blurb="<b>Teacher Stern Selby</b><br />Commercial law firm committed<br />to delivering legal services<br />of the highest quality.";break;
 }
 
  var xpo, ypo;
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
evt = (evt) ? evt : ((event) ? event : null);
xpo = evt.clientX;
ypo = evt.clientY;
document.getElementById("LogicBlurb").style.top = ypo + "px";
           document.getElementById("LogicBlurb").style.left = xpo + "px";
           document.getElementById("LogicBlurb").style.visibility = "visible";

 document.getElementById("LogicBlurb").innerHTML = blurb;
 document.getElementById("LogicBlurb").style.visibility = "visible";

 
 
 
 }
}



