//The code in this file is copyright © Creative Technology 2000.  All rights are reserved.
//The ordering system uses the hard-coded cookie called ct_basket, which has the format
// number_of_items | item_ordercode ^ quantity | item_ordercode ^ quantity (etc)
//JS Common file - graphic routines common to all pages, and browser detection
//

//------THESE ROUTINES DEAL WITH DESIGN FEATURES 
//-------SUCH AS HEADER-WRITERS ETC

//----------This section is purely UI Design & visual - no shopping cart stuff

markin_version='v3.1 Release 3 Build 1';
textoys_version='v3.1 Release 0 Build 7';
function show_screen(width){
	   screenshot=window.open("screen.htm","messageWindow", "width="+width,"titlebar=no", "resizeable=yes");
}
function show_header(headertext) {
//Faded white heading background
	if (ct_checkout)
	{document.write('<table width="386" border="0" cellspacing="0" cellpadding="0" background="common/heading_bg.gif">');
  	document.write('<tr valign="middle"><td width="8"> <img src="common/heading_edge.gif" width="8" height="20" align="absmiddle"></td>');
  	document.write('<td width="388" class="subheading">' + headertext + '</td></tr></table>');

	}
	else {
	document.write('<table width="386" border="0" cellspacing="0" cellpadding="0" background="/images/common/heading_bg.gif">');
  	document.write('<tr valign="middle"><td width="8"><img src="/images/common/heading_edge.gif" width="8" height="20" align="absmiddle"></td>');
  	document.write('<td width="388" class="subheading">' + headertext + '</td></tr></table>');
	}
}

function examplewindow(page){
//opens fixed size new window without menubar etc and loads 'page' into it
example=window.open(page, "messageWindow","width=620,scrollbars=yes");
}

function ExistCookie(name) {
//Used by browser check below
	var nameEQ = name + "="
	var ca = document.cookie.split(";")
	if (document.cookie != "") {
		for(var i=0;i<ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length)
			if (c.indexOf(nameEQ) == 0) {return true}
		}
     return false}
}


//Stuff which executes on every page
browser_v = parseInt(navigator.appVersion);
if (browser_v <=3 && !ExistCookie('ct_browser')){
	document.cookie = "ct_browser=v3;path=/"
	location = '/warning.htm';
}
function COL_link(productname){
	returnstring='<p class="smallcentre"><a href="../../shop/curriculumonline.htm"><img src="/images/col/COL_S_S_RGB.gif" width="75" height="71" border="0"></a><br>';
	returnstring+=productname+' is a Curriculum Online Registered product, and can be purchased by UK schools using Electronic Learning Credits.</p>';
	return returnstring;
}
function COL_caption(){
	return '<p class="smallcentre"><a href="/shop/curriculumonline.htm" class="smallcentre">&quot;Curriclum Online&quot; Registered Product</a></p>';
}
var ct_checkout = false; // flag to indicate whether we're at the secure server - set to true in secure pages