
/* ====================================================

> General Site variables script - The Clear Box Co.
>
> Created by John Mounsey, Peaknet LTD. for TCB
> john@peaknet.ltd.uk
> June © 2OO6 - please do not steal!

==================================================== */

// Right-click disabling code added 19.06.2006 (JNM)

// Site specific settings

siteUrl			= 'www.theclearboxbenelux.com'
siteName		= 'The Clear Box Co Benelux.'
siteBase		= 'Benelux'
siteLang		= 'English'
siteCurr		= '€'
currencies		= 'Euro [€]'
minCarriage		= '??'
telePhone		= '+44 (0)7932 723624'
freePhone		= ''
fax			= ''
Zip			= ''
vatNo			= ''
eMail			= 'info@theclearboxbenelux.com'
mailTo			= '<A HREF="mailto:' + eMail + '?subject=message from ' + siteUrl + '" title="Email us ..">click here</A>'
air			= ' '
wardrobe		= 'wardrobe'
optimalRes	= '1024 x 768'

pagelink		= document.location
pageName		= document.title
defaultStatus		= siteUrl
lastPage		= document.referrer
var now			= new Date();
var thisYear		= now.getYear();
pageW			= screen.width
pageH			= screen.height
pageColours		= screen.colorDepth
ns4			= document.layers
ns6			= document.getElementById&&!document.all
ie4			= document.all



var days		= new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
var months		= new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
var monthNos		= new Array('01','02','03','04','05','06','07','08','09','10','11','12');
var date		= ((now.getDate()<10) ? "0" : "")+ now.getDate();
today			= date + '/' + monthNos[now.getMonth()] + '/' + thisYear +"<SPAN class=hidden></SPAN>";
// today		= days[now.getDay()] + ", " + date + air + monthNos[now.getMonth()] + air + thisYear +"<SPAN class=hidden></SPAN>";

// Developer details

dev			= 'Peaknet Limited'
designer		= 'John Mounsey'
devUrl			= 'http://www.peaknet.ltd.uk/'


/* ====================================================
Print the current Date
==================================================== */

function printDate()

{
document.write('<SPAN TITLE="Today\'s date .." class="date">' + today + '</SPAN>');
}


/* ====================================================
Page Greeting
==================================================== */

function greeting()

{
document.write('');
}


/* ====================================================
Hide "Loading" message
==================================================== */

function hideLoad()

{
document.getElementById('loading')
loading.style.display='none';
}


/* ====================================================
Hi-Lite <TR> areas
==================================================== */

function hi(field)	{ field.className = 'trhi' }
function lo(field)	{ field.className = 'trlo' }


/* ====================================================
Things to do when page 100% loaded or resized
==================================================== */

function loaded()

{
//top.location='http://www.theclearbox.com/shop.htm';
window.status		= 'Page Loaded.'
alert('Orders for '+siteBase+' will be dispatched from the U.K. and shipping is quoted as you shop.\n\nClick OK to be redirected to theclearbox.com');
top.location='http://www.theclearbox.com/shop.htm';
} 

function diag()

{
var winW 		= document.body.clientWidth
var winH 		= document.body.clientHeight
window.status		= 'Screen across: ' + winW + ' Screen height: ' + winH
}


/* ====================================================
Show Destination of a url
==================================================== */

function preUrl(goal)	{ goal.title = 'Goes to..\n ' + goal.href; }


/* ====================================================
Bookmark / Add to Favorites script
==================================================== */

function bookmark()

{ 
if (window.external) { external.AddFavorite(pagelink,pageName) }
	
else if (navigator.appName == "Netscape") 	{ alert('press control and D now to bookmark this page') }
else if (navigator.appName == "Opera") 		{ alert('press control and T now to bookmark this page') }
}


/* ====================================================
Recommend a Friend
==================================================== */

function sendPage()
	{
	alert('This opens a blank Email for you to send to friends ..');
	window.location='mailto:?subject=I recommend this site: ' + siteUrl + ' (' + siteName + ')';
	}


/* ====================================================
Previous Pages
==================================================== */

function goBack() { history.go(-1); }
function doubleBack() { history.go(-2); }


/* ====================================================
Go to a page
==================================================== */

function go(destUrl)
{
top.location=destUrl;
}


/* ====================================================
Status Bar Captions [note! does not work on <A> tags]
==================================================== */

function cap(label)
{ 
status=label; return true;
}


/* ====================================================
Change text within an ID'd <P> or <TD> tag
==================================================== */

function change(part,msg)
{
document.getElementById(part).innerText = msg;
}


/* ====================================================
Footer Tools
==================================================== */

function footerTools()
{
document.write('<P><A title="Our secure online shop.." HREF="/shop.htm">Shop</A>&nbsp; &nbsp; | &nbsp; &nbsp; <a href="#" onclick=\'window.open("/tc.htm","terms","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,height=600,width=600");\'>Terms</A>&nbsp; &nbsp; | &nbsp; &nbsp; <A title="return to the Home page of this site.." HREF="/">Home</A>&nbsp; &nbsp; | &nbsp; &nbsp; <a href="#" onClick="Language(\'ben\');" class="pink">English</a> &nbsp; &nbsp; | &nbsp; &nbsp; <a href="#" onClick="Language(\'dut\');" class="pink">Nederlands</a></P>');
}

function credit()
{
document.write('<P>The Clear Box Company [Benelux] is an authorised distributor for <br>The Clear Box Company Worldwide Limited.<br>Copyright of all images and content owned by The Clear Box Company Worldwide Limited.<br>Reproduction without prior permission is forbidden.');
document.write('</P>');
}
function footerToolsdut()
{
document.write('<P><A title="Our secure online shop.." HREF="/shop.htm">Winkel</A>&nbsp; &nbsp; | &nbsp; &nbsp; <a href="#" onclick=\'window.open("/tc.htm","terms","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,height=600,width=600");\'>Algemene voorwaarden</A>&nbsp; &nbsp; | &nbsp; &nbsp; <A title="return to the Home page of this site.." HREF="/">Startpagina</A>&nbsp; &nbsp; | &nbsp; &nbsp; <a href="#" onClick="Language(\'ben\');" class="pink">English</a> &nbsp; &nbsp; | &nbsp; &nbsp; <a href="#" onClick="Language(\'dut\');" class="pink">Nederlands</a></P>');
}

function creditdut()
{
document.write('<P>The Clear Box Company [Benelux] is een erkende verdeler voor <br>The Clear Box Company Worldwide Limited.<br>Het copyright voor alle afbeeldingen en inhoud is eigendom van The Clear Box Company Worldwide Limited.<br>Reproductie zonder voorafgaande toestemming is verboden.');
document.write('</P>');
}


/* ====================================================
Group menu controller
==================================================== */

function fusionGroup(targ,chosen,restore)
	{
	eval(targ+".location='"+chosen.options[chosen.selectedIndex].value+"'");
	if (restore) chosen.selectedIndex=0;
	}


/* ====================================================
Top right promotional area [default = off]
==================================================== */

function promo()

{
document.write('&nbsp;');
}


/* ====================================================
Menu rollover code
==================================================== */

function mOn(slot)

{
slot.className = 'menuitemon';
}

function mOff(slot)

{
slot.className = 'menuitem';
}

function mHi(slot)

{
slot.className = 'menuhi';
}



/* ====================================================
Generic image roller
==================================================== */

function roll(obj,src)
{
obj.src = src;
}

/* ====================================================
Email Olivia Rocca "Badge"
==================================================== */

function emailOR()
{
document.write('<A HREF="mailto:info@theclearbox.com?subject=message from: ')
document.write(siteUrl + ' site..')
document.write('"><IMG src="gfx/olivia-rocca.gif" alt="Email Clearbox" class="gfx">')
document.write('</A>')
}

/* ====================================================
Generic Pop-Up opener
==================================================== */

function MM_openBrWindow(theURL,winName,features)
{
window.open(theURL,winName,features);
}

/* ====================================================
Home Page Map Captioner
==================================================== */

function nuLabel(msg)
{
document.getElementById('label').innerText=msg;
}

function defLabel()
{
document.getElementById('label').innerText='United Kingdom – Head Office';
}

/* ====================================================
start of Right-click blocker
==================================================== */

function stopRightClick() {
	if (event.button==2) {
		alert('Copyright of all images and content is owned by The Clear Box Company Worldwide Limited.\n\n\Reproduction withour prior permission from The Clear Box Company is FORBIDDEN.');
	}
}
document.onmousedown=stopRightClick
/* ====================================================
end of Right-click blocker
==================================================== */

/* remove a class from a page object */

function deClass(targCell)
{
targCell.className='';
}


strLanguage = 'ben';

/*
	Fetch language cookie
*/
strCookieLanguage = cookieGet('Language');
if(strCookieLanguage != '')
{
	strLanguage = strCookieLanguage;
}


function Language(strNewLanguage)
{
	strLanguage = strNewLanguage;
	
	/*
		Need to set cookie here
	*/
	cookieSet('Language', strNewLanguage, 672);
	
	
	ToggleLanguage();
}


function ToggleLanguage()
{
	arrDIVs = document.getElementsByTagName('div');
	arrSPAN = document.getElementsByTagName('span');
	
	DoObjects(arrDIVs);
	DoObjects(arrSPAN);
}


function DoObjects(arrObj)
{
	
	for(intLoop=0; intLoop<arrObj.length; intLoop++)
	{
		objDIV = arrObj[intLoop];
		if(objDIV.className.substring(0, 4) == 'tcb_')
		{
			if(objDIV.className.substring(4) != strLanguage)
			{
				objDIV.style.display = 'none';
			}
			else
			{
				objDIV.style.display = 'block';
			}
		}
	}
}






function cookieGet(strName)
{
	//alert(document.cookie);
	var arrCookie       = document.cookie.split('; ');
	//var arrEachCookie = new Array();
	var strValue        = '';
	
	for( var intLoop = 0; intLoop < arrCookie.length; intLoop++)
	{
		var arrEachCookie = arrCookie[intLoop].split('=');
		
		if(arrEachCookie[0] == strName)
		{
			var strValue = arrEachCookie[1];
		}
	}
	
	return strValue;
}




function cookieSet(strName, strValue, intHours)
{
	var dtmToday    = new Date();
	var dtmExpiry   = new Date(dtmToday.getTime() + (intHours * 60 * 60 * 1000));
	
	document.cookie = strName + "=" + escape(strValue) + "; expires=" + dtmExpiry.toGMTString() + "; path =/";
}



function cookieDelete(strName)
{
	cookieSet(strName, null, -24);
}