// JavaScript source code Version 19 Oct 2010 HypnotherapyFife.co.uk
var defFont="Font9";
var cr="\r\n";
var currentcolour;
var paracount=27;
var chrAT=String.fromCharCode(64);
var chrLT=String.fromCharCode(60);
var chrGT=String.fromCharCode(62);
var MyLinks=["default.htm","hypnotherapist-fife-sub.htm","WhatIsIt.htm","WhatCanItDo.htm","ProblemsHelped.htm","hypnotherapy-IBS-Fife.htm","HowMany.htm","Easy.htm","WhatHappens.htm","Magic.htm","Aware.htm","RetainControl.htm","Secrets.htm","Psychotherapy.htm","Advantages.htm","Payment.htm","",  "",  "Maps.htm","Hypnotherapy-Weight-Loss-Fife.htm","",  "",  "",  "",  "",  "Hypnotherapy-Anxiety-Fife.htm", "Stop-Smoking-Fife.htm", ""];
var MyPara=[ "0",          "1",                          "2",           "3",              "4",                 "5",                        "6",          "7",       "8",              "9",        "10",       "11",               "12",         "13",               "14",            "15",         "16","17","18",      "19",                               "20","21","22","23","24","25",                            "26",                    "27"];
var MyFormName;
//0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27]
function body_onload() {
	// QQ REMEMBER each page needs MyFormName hidden element set to the form name!
	MyFormName=document.getElementById("MyFormName").value;
	// Rename the leftbar links according to the current page.htm
	if (MyFormName=="Hypnotherapist-Fife.htm") 
	{
		MyLinks[0]="Hypnotherapist-Fife.htm";		
	}
	window.scrollBy(0,-5000); // Scroll to top of page
	//window.scrollBy(0,20); // Scroll to top of page
	// Resize the font
	var h=window.location.hash;
	if  (h=="#Font9") {setFont("Font9");}
	else if (h=="#Font10") {setFont("Font10");}
	else if (h=="#Font11") {setFont("Font11");}
	else {setFont("Font9");}
	window.scrollBy(0,-5000); // Scroll to top of page
	//window.scrollBy(0,20); // Scroll to top of page
	
	var special=(MyFormName=="Hypnotherapy-Weight-Loss-Fife.htm" || MyFormName=="Hypnotherapy-IBS-Fife.htm" || MyFormName=="Hypnotherapy-Anxiety-Fife.htm" || MyFormName=="Hypnotherapy-PTSD-Fife.htm" || MyFormName=="Hypnotherapist-Fife.htm" || MyFormName=="Stop-Smoking-Fife.htm");
	if (special==true)
	{
		//remove going blocks + run MakeChanges()
		try
		{
			startClock();
		}
		catch(e){}
	}

	// Rename the leftbar links according to the current page.htm
	if (MyFormName=="Hypnotherapist-Fife.htm") 
	{
		MyLinks[0]="Hypnotherapist-Fife.htm";		
	}
	if (MyFormName=="Hypnotherapy-Anxiety-Fife.htm") 
	{
		MyLinks[25]="Hypnotherapy-Anxiety-Fife.htm";
	}
	if (MyFormName=="Hypnotherapy-PTSD-Fife.htm") 
	{
		MyLinks[25]="Hypnotherapy-PTSD-Fife.htm";
	}
	//if (MyFormName=="Stop-Smoking-Fife.htm") 
	//{
		
	//}
		
	//add mail address (anti-hacker)
	var em= chrLT + "span style='font-family: Tahoma; font-size:8pt'" + chrGT + "Email: " + chrLT + "/" + "s" + "pan" + chrGT + chrLT + "spa" + "n style='color: Blue; font-size: 10pt; font-weight: bold'" + chrGT + chrLT + "A href='mailto:David" + "Stocks" + "Hyp" + chrAT + "aol." + "c" + "o.u" + "k' Title='Mail to David Stocks (WebMaster)' /" + chrGT + chrLT + "s" + "pan style='color: Blue; text-decoration:underline'" + chrGT + "David" + "Stocks" + "Hyp" + chrAT + "aol." + "c" + "om" + chrLT + "/span" + chrGT + chrLT + "/" + "a" + chrGT;
	document.getElementById("mail").innerHTML=em;

	if (!(navigator.appName=="Microsoft Internet Explorer"))
	{
		//dont display para23 for non=IE
		try
		{
		document.getElementById("para23").style.visibility="hidden";
		document.getElementById("para23").style.display="none";
		document.getElementById("para23Line").style.visibility="hidden";
		document.getElementById("para23Line").style.display="none";
		} catch(e){}
	}
	SetNoHighlight();
	//qq HolidayMessage(); // + make holidaymessagespan VISIBLE
	window.scrollBy(0,-5000); // Scroll to top of page
	//window.scrollBy(0,20); // Scroll to top of page
}

function SetNoHighlight()	{
    for(var loop = 0; loop < (paracount+1); loop++)
    {
		try
		{
			if (!(MyLinks[loop]==""))
			{
				var linkname='Para' + loop;
				var elelink=document.getElementById(linkname);
				if (MyLinks[loop]==document.getElementById("MyFormName").value)
				{
					elelink.className="nohighlight";
				}
			}
		}
		catch(e){}
    }
}

function setFont(f) {
    for(var loop = 0; loop < paracount; loop++)
    {
		try
		{
			if (!(MyLinks[loop]==""))
			{
				var linkname='Para' + loop;
				var elelink=document.getElementById(linkname);
				elelink.href=MyLinks[loop]+"#"+f;
			}
		}
		catch(e){}
    }
    document.getElementById("Font9").style.fontWeight="normal";
    document.getElementById("Font10").style.fontWeight="normal";
    document.getElementById("Font11").style.fontWeight="normal";
    try
    {
		document.getElementById(f).style.fontWeight="bold";
	} catch(e){}

    document.getElementById("Font9").style.color="Black";
    document.getElementById("Font10").style.color="Black";
    document.getElementById("Font11").style.color="Black";
    try
    {
		document.getElementById(f).style.color="Blue";
	} catch(e){}

    document.getElementById("Font9").style.backgroundColor="White";
    document.getElementById("Font10").style.backgroundColor="White";
    document.getElementById("Font11").style.backgroundColor="White";
    try
    {
		document.getElementById(f).style.backgroundColor="Yellow";
	} catch(e){}
    defFont=f;
    document.getElementById("MainFill").className=f;
    document.getElementById("LeftBar").className="Bar"+f;
}

function mousein(myobject) {
	currentcolour=myobject.style.color;
	myobject.style.color="red";
}

function mouseout(myobject) {
	myobject.style.color=currentcolour;
}

function PrintPage()
{
	beforeprint()
	window.print();
	afterprint();
}

function beforeprint() {
try
	{
		document.getElementById('PrintFooter').style.display = '';
		document.getElementById('PrintFooter').style.visibility = 'visible';
		document.getElementById('header').style.display = 'none';
		document.getElementById('header').style.visibility = 'hidden';
		document.getElementById('LeftBar').style.display = 'none';
		document.getElementById('LeftBar').style.visibility = 'hidden';
		document.getElementById('verybottom').style.display = 'none';
		document.getElementById('verybottom').style.visibility = 'hidden';
		document.getElementById('footer').style.display = 'none';
		document.getElementById('footer').style.visibility = 'hidden';
    } catch(e){}
}

function afterprint() {
	try
	{
		document.getElementById('verybottom').style.display = '';
		document.getElementById('verybottom').style.visibility = 'visible';
		document.getElementById('header').style.display = '';
		document.getElementById('header').style.visibility = 'visible';
		document.getElementById('LeftBar').style.visibility = 'visible';
		document.getElementById('LeftBar').style.display = '';
		document.getElementById('PrintFooter').style.display = 'none';
		document.getElementById('PrintFooter').style.visibility = 'hidden';
		document.getElementById('footer').style.display = '';
		document.getElementById('footer').style.visibility = 'visible';
    } catch(e){}
}

//qq HolidayMessage default.htm ONLY
function HolidayMessage() {
	var mm1="Please note that I am on holiday now until 23rd September.";
	var mm2=cr + cr;
	var mm3="I HOPE to be picking up emails from time to time, but I may not be able to do this until the second week as I'm on a ship for the first 7 days. The time difference is such that I not be able to respond to phone messages. (My DAY time will be your NIGHT time.)";
	if (MyFormName=="default.htm")
	{		//alert("Please note that I am away for a few days." + cr + cr + "I WILL respond to phone and email messages but you may need to wait a 2 or 3 days. If you'd rather to talk to me, just call with a short message, (maybe including your email address), and I will contact you in 2 to 3 days." + cr + cr + "If you send an email, please indicate, if you can, a range of days/times that suit you best, (I'm booked up to March 3rd). If it's ok for me to phone or text you, please include your number." + cr + cr + "Note that when you come for your first appointment, we'll have a long chat. I will explain what needs to be done and how much it is likely to cost. NB Should you decide not to proceed at this stage - there is NO charge at all. So, making a 1st appointment doesn't commit you to paying anything." + cr + cr + "{Click the 'Show Message' button to display this message again}");
		//alert("My apologies - there is a problem with the server." + cr + cr + "The database underpinning the Testimonials System (see bottom of the pages) is not working." + cr + cr + "It should be fixed sometime today.");
		alert(mm1+mm2+mm3);
	}
	try
	{
	document.getElementById('holidaymessagespan').style.display = '';
	document.getElementById('holidaymessagespan').style.visibility = 'visible';
	document.getElementById('holidaymessageline').innerHTML=mm1 + " " + mm3;
	} catch(e){}
}

function checkbrowser()  {
  var nav;
  nav=      "navigator.product: " + navigator.product + cr;
  nav=nav + "navigator.appName: " + navigator.appName + cr;
  nav=nav + "navigator.userAgent: " + navigator.userAgent + cr;
  nav=nav + "navigator.appCodeName: " + navigator.appCodeName + cr;
  nav=nav + "navigator.language: " + navigator.language + cr;
  nav=nav + "navigator.userLanguage: " + navigator.userLanguage + cr;
  nav=nav + "navigator.platform: " + navigator.platform + cr;
  nav=nav + "navigator.javaEnabled(): " + navigator.javaEnabled() + cr;
  nav=nav + "navigator.appCodeName: " + navigator.appCodeName + cr;
  nav=nav + "document.referrer: " + document.referrer + cr;
  nav=nav + "document.location.href: " + document.location.href + cr;
  nav=nav + "navigator.savePreferences: " + navigator.savePreferences + cr;
  nav=nav + "navigator.userAgent.toLowerCase().indexOf('netscape/7'): " + navigator.userAgent.toLowerCase().indexOf( "netscape/7" ) + cr;
  nav=nav + "navigator.userAgent.toLowerCase().indexOf('msie'): " + navigator.userAgent.toLowerCase().indexOf( "msie" );
  //navigator.userAgent.toLowerCase().indexOf( "msie" ) + 1
  alert(nav); // Test only
}

function MakeChanges()	{
		//Change individual PAGE headers *******
		try
		{
			document.getElementById("Hypnotherapy-Weight-Loss-Fife1").innerHTML="Hypnotherapy and Weight Loss";
			document.getElementById("Hypnotherapy-Weight-Loss-Fife2").innerHTML="Weight Loss Treatment";
			document.getElementById("Hypnotherapy-Weight-Loss-Fife3").innerHTML="Weight/Snacking";
		}
		catch(e){}

		try
		{
			document.getElementById("Stop-Smoking-Fife1").innerHTML="Smoking Cessation";
			document.getElementById("Stop-Smoking-Fife2").innerHTML="Hypnotherapy to Stop Smoking";
			//document.getElementById("Stop-Smoking-Fife2").innerHTML="Smoking Cessation";
		}
		catch(e){}
		
		try
		{
			document.getElementById("Hypnotherapy-Anxiety-Fife1").innerHTML="Hypnotherapy and Anxiety Disorders";
			document.getElementById("Hypnotherapy-Anxiety-Fife2").innerHTML="Hypnotherapy & Anxiety Treatment";
			document.getElementById("Hypnotherapy-Anxiety-Fife3").innerHTML="<strong>Anxiety is at the root of most problems treated by Hypnotherapy</strong>.";
			document.getElementById("Hypnotherapy-Anxiety-Fife4").innerHTML="Anxiety";
			document.getElementById("Hypnotherapy-Anxiety-Fife5").innerHTML="Anxiety";
		}
		catch(e){}
		try
		{
			document.getElementById("Hypnotherapy-PTSD-Fife1").innerHTML="Hypnotherapy and PTSD Disorders";
			document.getElementById("Hypnotherapy-PTSD-Fife2").innerHTML="Hypnotherapy & PTSD Treatment";
			document.getElementById("Hypnotherapy-PTSD-Fife3").innerHTML="<strong>PTSD is at the root of most problems treated by Hypnotherapy</strong>.";
			document.getElementById("Hypnotherapy-PTSD-Fife4").innerHTML="PTSD";
			document.getElementById("Hypnotherapy-PTSD-Fife5").innerHTML="PTSD";
		}
		catch(e){}
}

// JScript File
// startClock();

var intTimeOutSeconds=2;
var strTimeOutfont=10;
var maxblocks=10;
function startClock() {
	// Check for spider bots
	var uA=""+navigator.userAgent.toString().toLowerCase();
	//var IsNotSpiderBot=((uA.indexOf("crawl")==-1) && (uA.indexOf("search")==-1) && (uA.indexOf("bot")==-1) && (uA.indexOf("yell.com")==-1) && (uA.indexOf("java")==-1) && (uA.indexOf("spider")==-1) && (uA.indexOf("google")==-1) && (uA.indexOf("yahoo")==-1) && (uA.indexOf("msnbot")==-1));
	var IsNotSpiderBot=((uA.indexOf("talktalk virus alerts")==-1) && (uA.indexOf("crawl")==-1) && (uA.indexOf("wise-guys")==-1) && (uA.indexOf("bingbot")==-1) && (uA.indexOf("kilomonkey")==-1) && (uA.indexOf("healthhaven")==-1) && (uA.indexOf("panscient")==-1) && (uA.indexOf("twenga")==-1) && (uA.indexOf("baidu")==-1) && (uA.indexOf("soso")==-1) && (uA.indexOf("puritysearch")==-1) && (uA.indexOf("twenga")==-1) && (uA.indexOf("googlebot")==-1) && (uA.indexOf("adsbot-google")==-1) && (uA.indexOf("search")==-1) && (uA.indexOf("yandex")==-1) && (uA.indexOf("bot")==-1) && (uA.indexOf("yell")==-1) && (uA.indexOf("java")==-1) && (uA.indexOf("spider")==-1) && (uA.indexOf("google")==-1) && (uA.indexOf("yahoo")==-1) && (uA.indexOf("msnbot")==-1));
	//talktalk virus alerts scanning engine ADDED
	if(IsNotSpiderBot==true)
	{
		intTimeOutSeconds=intTimeOutSeconds-1;
		if (intTimeOutSeconds<1)
		{
			MakeChanges();
			for(var loop = 0; loop < maxblocks; loop++)
			{
				try
				{
					var goingid='going' + loop;
					var going=document.getElementById(goingid);
					going.classname="gone";
					going.style.display="none";
					going.style.visibility="";
					//Hypnotherapy-Weight-Loss-Fife4
				}
				catch(e) {}
				try
				{
					var comingid='coming' + loop;
					var coming=document.getElementById(comingid);
					coming.classname="going";
					coming.style.display="";
					coming.style.visibility="visible";
					//Hypnotherapy-Weight-Loss-Fife4
				}
				catch(e) {}
			}
			return true;
		}
		else
		{  
			timerID=setTimeout("startClock()", 1000);
		}
	}
	else
	{
		//alert("Spider Bot qq");
	}
}

