// JavaScript Document

<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}



function showPort(numb){
	var textMan;
	if (numb == 1){
		
		textMan = "<strong>Pam Glew Website</strong><br /><a href=\"http://www.pamglew.co.uk\">www.pamglew.co.uk</a></p><p><img src=\"pg-large.jpg\" alt=\"Screenshot of www.pamglew.co.uk Loading...\" width=\"440\" />";
}

	if (numb == 2){
		
		textMan = "<strong>Standing with Stones</strong><br /><a href=\"http://www.standingwithstones.com\">www.standingwithstones.com</a></p><p><img src=\"sws-large.jpg\" alt=\"Screenshot of www.standingwithstones.com Loading...\" width=\"515\" />";
}

	if (numb == 3){
		
		textMan = "<strong>LifeWorklife</strong><br /><a href=\"http://www.lifeworklife.co.uk\">www.lifeworklife.co.uk</a></p><p><img src=\"lwl-large.jpg\" alt=\"Screenshot of www.lifeworklife.co.uk Loading...\" width=\"448\" />";
}

if (numb == 4){
		
		textMan = "<strong>Estate Agents Demo</strong><br /><a href=\"http://estates.ravensknowledge.co.uk\">estates.ravensknowledge.co.uk</a></p><p><img src=\"estates-large.jpg\" alt=\"Screenshot of our estate agents demo Loading...\" width=\"460\" />";
}


	if (numb == 5){
		
		textMan = "<strong>Westbourne Motors</strong><br /><a href=\"http://www.westbournemotors.co.uk\">www.westbournemotors.co.uk</a></p><p><img src=\"wb-large.jpg\" alt=\"Screenshot of a www.westbournemotors.co.uk Loading...\" width=\"400\" />";
}

	if (numb == 6){
		
		textMan = "<strong>Fisheye 360</strong><br /><a href=\"http://www.fisheye360.co.uk\">www.fisheye360.co.uk</a></p><p><img src=\"fe-large.jpg\" alt=\"Screenshot of a Fisheye 360 tour Loading...\" width=\"360\" />";
}


document.getElementById('portfolioShow').innerHTML=textMan;
MM_showHideLayers('pageTxt','','hide'); 
MM_showHideLayers('gwcPort','','hide');
MM_showHideLayers('portfolioShow','','show');

}

function hidePort(){
	document.getElementById('portfolioShow').innerHTML='';
	MM_showHideLayers('pageTxt','','show'); 
	MM_showHideLayers('gwcPort','','show');
MM_showHideLayers('portfolioShow','','hide');
}


function updateQuote(){
var amount;
amount = 0;

var totalP;
totalP = eval(document.getElementById('static').value) + eval(document.getElementById('admin').value);

if(document.getElementById('webdesign').checked == true){
amount = amount + 250;
}

amount = amount + ((eval(document.getElementById('static').value) * 45) - 45);

amount = amount + (eval(document.getElementById('admin').value) * 55);

if (document.getElementById('gallery').value == "sg"){
amount = amount + 55;
totalP = totalP + 1;
}
else if (document.getElementById('gallery').value == "mg"){
amount = amount + 115;
totalP = totalP + 1;
}

if (document.getElementById('news').value == "n1"){
amount = amount + 40;
totalP = totalP + 1;
}
else if (document.getElementById('news').value == "n2"){
amount = amount + 75;
totalP = totalP + 1;
}

if (document.getElementById('cm').value == "sc"){
amount = amount + 245;
totalP = totalP + 1;
}
else if (document.getElementById('cm').value == "subc"){
amount = amount + 395;
totalP = totalP + 1;
}
else if (document.getElementById('cm').value == "ssubc"){
amount = amount + 545;
totalP = totalP + 1;
}

if (document.getElementById('basket').value == "p"){
amount = amount + 125;
}
else if (document.getElementById('basket').value == "px"){
amount = amount + 345;
totalP = totalP + 1;
}

if(document.getElementById('logo').checked == true){
amount = amount + 125;
}

if(document.getElementById('newsletter').checked == true){
amount = amount + 35;
}

if (amount < 0){
amount = 0;	
}

document.getElementById('finalQuote').innerHTML = "&pound;" + amount + " for " + totalP + " pages.";

document.getElementById('quoteResult').value = amount;

document.getElementById('quoteTit').innerHTML = "Your Quote";

setQuestion();


}

var AnswerQ;
AnswerQ = 0;

function setQuestion(){
var oneNum = Math.floor(Math.random()*10);
var twoNum = Math.floor(Math.random()*10);
var threeNum = Math.floor(Math.random()*10);

AnswerQ = oneNum + twoNum + threeNum;

document.getElementById('qNumber').innerHTML = "Please enter " + oneNum + " + " + twoNum + " + " + threeNum + "&nbsp;&nbsp;&nbsp;<input onkeyup='checkQuestion(this.value)'  class='required' title='Anti spam answer required' name='qAnswer' type='text' id='qAnswer' size='5' maxlength='3' />";
}

function checkQuestion(bob){
	
	var Answz;
	Answz = bob;
//	alert(Answz + AnswerQ);
if	(Answz == AnswerQ){
	
document.getElementById('button2').disabled = false;
document.getElementById('qNumber').innerHTML = "Correct Answer";
}
}


function timetravel(){
	document.getElementById('timeMachine').style.visibility = 'visible'; 
	so.write('timeMachine');
}

function bgChange(){
	
	document.getElementById('timeMachine').style.background ='#000000';
	
}

function hideOlder(){
	
	document.getElementById('timeMachine').style.visibility = 'hidden'; 
	
}
function showOlder(){
	
	document.getElementById('timeMachine').style.visibility = 'visible'; 
	
}
//-->