/* Script adapted by Grafixation from dhtmlgoodies.com
/***************************************************************************************************
	(C) www.dhtmlgoodies.com, October 2005
	
	This is a script from www.dhtmlgoodies.com.
	You will find this and a lot of other scripts at our website.	
	
	Terms of use:
	You are free to use this script as long as the copyright message is kept intact.
	However, you may not redistribute, sell or repost it without our permission.
	
	Thank you!
	
	www.dhtmlgoodies.com
	Alf Magne Kalleland	
****************************************************************************************************/

var activeMenuItem = new Array();
var currentlyActiveMenuItem;
function isUlInArray(inputObj,ulObj)
{while(inputObj && inputObj.id!='openmenu')
{if(inputObj==ulObj)return true;
inputObj = inputObj.parentNode;}
return false;}
function showHideSub(e,inputObj)
{if(!inputObj)inputObj=this;
if(currentlyActiveMenuItem)
{currentlyActiveMenuItem.className='';}
currentlyActiveMenuItem = inputObj;
currentlyActiveMenuItem.className='currentlyActiveMenuItem';
var parentObj = inputObj.parentNode;
var ul = parentObj.getElementsByTagName('UL')[0];
if(!ul && inputObj.parentNode.parentNode.id!='openmenu')return;
if(activeMenuItem.length>0)
{for(var no=0;no<activeMenuItem.length;no++)
{if(!isUlInArray(ul,activeMenuItem[0]) && !isUlInArray(activeMenuItem[0],ul))
{activeMenuItem[no].style.display='none';
activeMenuItem.splice(no,1);
no--;}}}
if(!ul)return;
if(ul.offsetHeight == 0)
{ul.style.display='block';
activeMenuItem.push(ul);}
else
{ul.style.display='none';}}
function showHidePath(inputObj)
{var startTag = inputObj;
showHideSub(false,inputObj);
inputObj = inputObj.parentNode;
while(inputObj)
{inputObj = inputObj.parentNode;
if(inputObj.tagName=='LI')showHideSub(false,inputObj.getElementsByTagName('A')[0]);
if(inputObj.id=='openmenu')inputObj=false;}}
function initMenu()
{var obj = document.getElementById('openmenu');
var linkCounter=0;
var aTags = obj.getElementsByTagName('A');
var activeMenuItem = false;
var activeMenuLink = false;

// server
var loc = location.href;
var domain = 'http://www.grafixation.co.uk/client/pinpoint/';
if(loc.length<=domain.length+1)loc = 'http://www.grafixation.co.uk/client/pinpoint/index.html';
var thisLocationArray = loc.split(/\//);

// local
// var thisLocationArray = location.href.split(/\//);

var fileNameThis = thisLocationArray[thisLocationArray.length-1];
if(fileNameThis.indexOf('?')>0)fileNameThis = fileNameThis.substr(0,fileNameThis.indexOf('?'));
if(fileNameThis.indexOf('#')>0)fileNameThis = fileNameThis.substr(0,fileNameThis.indexOf('#'));
for(var no=0;no<aTags.length;no++)
{var parent = aTags[no].parentNode;
var subs = parent.getElementsByTagName('UL');
if(subs.length>0)
{aTags[no].onclick = showHideSub;
linkCounter++;
aTags[no].id = 'aLink' + linkCounter;}
else aTags[no].onclick = showHideSub;
if(aTags[no].href.indexOf(fileNameThis)>=0 && aTags[no].href.charAt(aTags[no].href.length-1)!='#')
// added  && aTags[no].parentNode.parentNode.id!='openmenu'
{if(aTags[no].parentNode.parentNode && aTags[no].parentNode.parentNode.id!='openmenu')
{var parentObj = aTags[no].parentNode.parentNode.parentNode;
var a = parentObj.getElementsByTagName('A')[0];
if(a.id && !activeMenuLink)
{activeMenuLink = aTags[no];
activeMenuItem = a.id;}}}}
if(activeMenuLink)
{activeMenuLink.className='currentlyActiveMenuItem';}
if(activeMenuItem)
{if(document.getElementById(activeMenuItem))showHidePath(document.getElementById(activeMenuItem));}}
window.onload = initMenu;

//other scripts start here

function pinpoint(s, m, e)
{l = 'mai' + 'lt' + 'o:' + s + '\u0040' + m + '.' + e + '?subject=Enquiry%20from%20Website';
window.location.replace(l);}

function popUp(URL, name, Width, Height, Left, Top)
{popWin = window.open("",name,'width=' + Width + ',height=' + Height + ',left=' + Left + ',top=' + Top + ', status=0, location=0, toolbar=0, menubar=0, resizable=0, scrollbars=0');
Height=(Height-20);
var text = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
text += '<html><head><title>' + name + '</title><style type="text/css">'; 
text += 'body {margin:0;padding:0;background: white;}</style></head><body><div ';
text += 'align="center"><a href="#" onClick="window.close()">Close window</a>';
text += '<img src="' + URL + '" alt="' + name + '" width="' + Width + '" height="' + Height + '"></div></body></html>';
popWin.document.open("text/html");
popWin.document.write(text);
popWin.document.close();}

function popupvid(URL, name, Width, Height, Left, Top)
{popvid=open(URL,name,'width=' + Width + ',height=' + Height + ',left=' + Left + ',top=' + Top + ', status=0, location=0, toolbar=0, menubar=0, resizable=1, scrollbars=1');
popvid.focus();
if (popvid.opener == null) popvid.opener = self;}

function InsertObject()
{var x = '<object id="rvocx"\n';
x += 'classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="304">\n';
x += '<param name="src" value="images/video/pinpoint.rm">\n';
x += '<param name="autostart" value="true">\n';
x += '<param name="controls" value="imagewindow">\n';
x += '<param name="console" value="video">\n';
x += '<param name="loop" value="false">\n';
x += '<embed name="rvocx" type="audio/x-pn-realaudio-plugin"\n';
x += 'height="304" width="400" autostart="true" console="video" maintainaspect="true" \n';
x += 'controls="ImageWindow" loop="false" src="images/video/pinpoint.rm">\n';
x += '</object><br>\n';
x += '<object id="player"\n';
x += 'classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="30">\n';
x += '<param name="src" value="images/video/pinpoint.rm">\n';
x += '<param name="autostart" value="true">\n';
x += '<param name="controls" value="ControlPanel">\n';
x += '<param name="console" value="video">\n';
x += '<embed src="images/video/pinpoint.rm" width="400" height="30" controls="ControlPanel" \n';
x += 'type="audio/x-pn-realaudio-plugin" console="video" autostart="true">\n';
x += '</object><br>\n';
document.write(x);
return;}

function printWindow()
{bV = parseInt(navigator.appVersion)
if (bV >= 4) window.print()}