// JavaScript Document



function createCookie(NameOfCookie, value, expirehours)
{
	if (typeof(expirehours) == "undefined") expirehours = 720;
	var ExpireDate = new Date ();
	ExpireDate.setTime(ExpireDate.getTime() + (expirehours * 3600 * 1000));
	document.cookie = NameOfCookie + "=" + escape(value) + ((expirehours == null) ? "" : "; expires=" + ExpireDate.toGMTString()) + "; path=/;" ;
}

function readCookie(NameOfCookie)

{

	var cokie = document.cookie;

	var index = cokie.indexOf(NameOfCookie + "=");

	if (index == -1) return null;

	index = cokie.indexOf("=", index) + 1; // first character

	var endstr = cokie.indexOf(";", index);

	if (endstr == -1) endstr = cokie.length; // last character

	//alert(unescape(cokie.substring(index, endstr)));

	return unescape(cokie.substring(index, endstr));

}

function eraseCookie(NameOfCookie)

{

	createCookie(NameOfCookie,"",-1);

}

function Clickheretoprint()
{
  var disp_setting="toolbar=no,location=no,directories=yes,menubar=yes,";

  disp_setting+="scrollbars=yes,width=850, height=575,left=100, top=25";

  var content_vlue = document.getElementById("search_id").innerHTML;

  var docprint=window.open("","",disp_setting);

  docprint.document.open();

  docprint.document.write('<html><head><title>GEC Anderson</title>');

  docprint.document.write('<script language="javascript" src="../../../../js/imageprotect_fun.js">');  

  docprint.document.write('</script>');  

  docprint.document.write('<link href="../../../../stylesheet.css" rel="stylesheet" type="text/css" />');  

  docprint.document.write('</head><body onload="init();"  onkeydown="return false;" >');

  docprint.document.write('<table width="95%" align="center">');

  docprint.document.write('<tr><td height="20px" colspan="2"></td></tr>');

  docprint.document.write('<tr><td align="left" width="40%"><img src="../../../../images/Logo.jpg"></td><td width="60%" align="right"><div style="font-family:Arial;font-size:12px;"><div style="margin-left:10px;">Oakengrove &nbsp;Shire Lane &nbsp;Hastoe &nbsp;Tring &nbsp;HP23 6LY</div> <div style="margin-left:10px;float:bottom;">&nbsp;&nbsp;&nbsp;T +44(0)1442 82 6999 &nbsp;F +44(0)1442 82 5999</div><div style="margin-left:10px;float:bottom;">info@gecanderson.co.uk &nbsp;www.gecanderson.co.uk </div></div></td></tr>');

  docprint.document.write('<tr><td colspan="2" height="10px"><hr></td></tr>');

  docprint.document.write('<tr><td colspan="2" align="center"  class="detailsfont"><div style="font-family:Arial;font-size:11px;color:#000000;">');

  

  var content= content_vlue.replace(/color/g,'');
  
  

  var content1= content.replace(/#cccccc/g,'');

  var content2= content.replace(/hptext1/g,'hptext2');
  
  var content3= content2.replace(/whitelinks/g,'blacklink');  

  docprint.document.write(content3);

  docprint.document.write('</div></td></tr>');

  docprint.document.write('<tr><td colspan="2" height="10px"><hr></td></tr>');

  docprint.document.write('<tr><td align="left" width="50%"><div style="font-family:Arial;font-size:11px;">© 2008 GEC Anderson Limited. All Rights Reserved.</div></td><td width="50%" align="right"><div style="font-family:Arial;font-size:11px;">www.gecanderson.co.uk</div></td></tr>');

  docprint.document.write('</table>');

  docprint.document.write('<input type="hidden" id="alert_id" value="The images are copyright &copy; GEC Anderson" >');

  docprint.document.write('</body></html>');

  docprint.document.close();

  docprint.focus();

}

function check()

{

  	if(document.search1.search.value=="")

	  {

	   	alert("Please enter value for Search");

	   	document.search1.search.focus();

		  return false;

	  }

	  var query=document.search1.search.value;



	  document.search1.action="http://gecanderson.websitters.co.uk/scripts/search_results.php?query="+query;

	  document.search1.submit();

	  return false;

}

function call_terms()

{
  //alert("test");
  window.open("../../../../pdf/terms.html");

}



var specialcase = ((navigator.userAgent.indexOf('Mac') != -1) || document.all)

var flag = 0;

//var msg = 'This image is protected by copyright.\nWe request you not to copy it.';

var msg = 'The images are copyright © GEC Anderson.';

var x,y,x1,y1,copyAttempt;



function init()

{

	if (!(document.getElementById || document.all || document.layers)) return;

	if (specialcase && document.layers)

	{

		document.captureEvents(Event.MOUSEMOVE);

		document.onmousemove = special;

	}

	for (i=0;i<document.images.length;i++)

	{

		document.images[i].onmousedown = checkIt;

		document.images[i].onmouseup = function() {return false};

		if (specialcase)

		{

			document.images[i].onmousemove = special;

			document.images[i].onclick = clearIt;

		}

	}

}



function checkIt(e)

{

	copyAttempt = 0;

	if (window.Event)

	{

		x = e.screenX;

		y = e.screenY;

		theButt = (e.which == 3);

	}

	else

	{

		x = window.event.clientX;

		y = window.event.clientY;

		theButt = (window.event.button == 2);

	}

	if (theButt)

	{

		copyAttempt = 1;

		flag = 0;

		alert(msg);

		return false; // NN4 only

	}

	if (specialcase) flag = 1;

	return false;

}



function special(e)

{

	theObj = '';

	if (window.Event)

	{

		x1 = e.screenX;

		y1 = e.screenY;

		if (e.target.parentNode) theObj = e.target.parentNode.tagName;

	}

	else

	{

		x1 = window.event.clientX;

		y1 = window.event.clientY;

		theObj = window.event.srcElement.parentElement.tagName;

	}

	var isLink = (theObj == 'A');

	if (flag && (!isLink || ((Math.abs(x-x1) > 10) || (Math.abs(y-y1) > 10))))

	{

		copyAttempt = 1;

		flag = 0;

		alert(msg1);

		return false;

	}

}



function clearIt()

{

	flag = 0;

	if (copyAttempt)

	{

		copyAttempt = 0;

		return false;

	}

}

/*function View_Cart_Fun()

{

    //document.getElementById("view_cart_id").style.display="";

    if(window.XMLHttpRequest) // Mozilla

    {

       objXMLHTTP = new XMLHttpRequest();

    }

    else if(window.ActiveXObject) // IE

    {

       objXMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");

    }  

    url="../../../../scripts/view_cart.php";      

    objXMLHTTP.open("GET",url,false);

    objXMLHTTP.send("");

    data =objXMLHTTP.responseText;    

    if(data==1)

    {

       document.getElementById("view_cart_img").style.display='';

       document.getElementById("view_cart_text").style.display='';

    }          

}*/

function WelcomeNote()

{  

   if(window.XMLHttpRequest) // Mozilla

   {

       objXMLHTTP = new XMLHttpRequest();

   }

   else if(window.ActiveXObject) // IE

   {

       objXMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");

   }

   
  var root_path = "http://www.gecanderson.co.uk/";
  /* var root_path = "../";*/

   url=root_path+"scripts/welcome_note.php";      

   objXMLHTTP.open("GET",url,false);

   objXMLHTTP.send("");

   data = objXMLHTTP.responseText;
   if(data !=0)       

   {

     document.getElementById("name_id").innerHTML=data;

     document.getElementById("logout_id").innerHTML="<a href='"+root_path+"/scripts/signout.php' class='whitlink'>Sign out</a>";

     

    /* document.getElementById("viewcart_sitemap_id").innerHTML='<table border="0px" width="100%"><tr><td width="50%"><a href="../../../../scripts/shopping_cart.php" class="whtfont"><img src="../../../../images/btn_view.gif" alt="" border="0"></a></td><td width="50%"><a href="../../../../scripts/sitemap.php" class="whtfont"><img src="../../../../images/btn_sitemap.gif"  border="0" alt="" /></a></td></tr></table>';*/

     document.getElementById("viewcart_sitemap_id").innerHTML='<table border="0px" width="100%"><tr><td style="padding-right:2.2px;" align="right" class="whitefont"><a href="'+root_path+'scripts/shopping_cart.php" class="whtfont"><img src="'+root_path+'images/cart.gif" alt="" border="0">&nbsp;View Cart</a></td><td><a href="'+root_path+'sitemap/index.html" class="whtfont"><img src="'+root_path+'images/btn_sitemap.gif"  border="0" alt="" /></a></td><td><a href="http://www.facebook.com/pages/Tring-United-Kingdom/GEC-Anderson-Limited/114603725261829" target="_blank"><img src="'+root_path+'images/facebook.png"  border="0" alt="Facebook" /></a></td><td><a href="http://twitter.com/gecanderson" target="_blank"><img src="'+root_path+'images/twitter.png"  border="0" alt="Twitter" /></a></td><td><a href="http://www.linkedin.com/in/gecanderson" target="_blank"><img src="'+root_path+'images/linkedin.png"  border="0" alt="Linkedin" /></a></td><td><a href="http://feeds.feedburner.com/gecanderson" target="_blank"><img src="'+root_path+'images/rss.png"  border="0" alt="RSS Feed" /></a></td></tr></table>';

   }

   else

   {

      /*document.getElementById("viewcart_sitemap_id").innerHTML='<table border="0px" width="100%"><tr><td width="50%">&nbsp;</td><td width="50%"><a href="../../../../scripts/sitemap.php" class="whtfont"><img src="../../../../images/btn_sitemap.gif"  border="0" alt="" /></a></td></tr></table>';*/


     document.getElementById("viewcart_sitemap_id").innerHTML='<table border="0px" width="100%"><tr><td>&nbsp;</td><td><a href="'+root_path+'sitemap/index.html" class="whtfont"><img src="'+root_path+'images/btn_sitemap.gif"  border="0" alt="" /></a></td><td>&nbsp;<a href="http://www.facebook.com/pages/Tring-United-Kingdom/GEC-Anderson-Limited/114603725261829" target="_blank"><img src="'+root_path+'images/facebook.png"  border="0" alt="Facebook" /></a></td><td><a href="http://twitter.com/gecanderson" target="_blank"><img src="'+root_path+'images/twitter.png"  border="0" alt="Twitter" /></a></td><td><a href="http://www.linkedin.com/in/gecanderson" target="_blank"><img src="'+root_path+'images/linkedin.png"  border="0" alt="Linkedin" /></a></td><td><a href="http://feeds.feedburner.com/gecanderson" target="_blank"><img src="'+root_path+'images/rss.png"  border="0" alt="RSS Feed" /></a></td></tr></table>';

   }

}

/*_uacct = "UA-2651079-1";

urchinTracker();*/



function clickIE()

{

  if (document.all)

  {(message);return false;}

}

function clickNS(e) {

if

(document.layers||(document.getElementById&&!document.all))

{

if (e.which==2||e.which==3) {(message);return false;}}}

if (document.layers)

{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}

else

{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}



document.oncontextmenu=new Function("return false")


