

// NOT SO SMART  ------------------------------------------------------
function go() {

	for (var i=1; i<=4; i++) {

		switch(i) 
		{
			case 1: alert("We  ...");     break;
			case 2: alert("... knew ...");  break;
			case 3: alert("\t... you ..."); break;
			case 4: alert("\t\t... would"); break;
		}
	}
}

// OPEN WINDOW  ------------------------------------------------------
function open_window(arg_which) {
	switch(arg_which) {
		case 1:   window.open("http://www.plymouth-dakar.co.uk/", "", "features=no"); break;
		default:  window.open("http://www.gosoft.co.uk", "", "features=no");         break;
	}
}

// OPEN WINDOW FOR SMALL AMOUNTS OF TEXT -------------------------
function open_window_short_text(arg_which2) {
		window.open("http://www.gosoft.co.uk/sites/bangertobanjul/short_text.php?id=" + arg_which2, "", "width=300,height=200,top=50,left=100");
}

// USE TO OPEN A PICTURE AT ITS TRUE LARGER SIZE IN A NEW PICTURE ONLY WINDOW
function open_pic_only_window(arg_url,w,h) {
	//  alert(arg_url);           // resizable=yes, status=no,
	v_new_win = window.open("", "", "resizable=no,status=yes,width=10,height=10,left=50,top=50");   // features=no
	var vText = "<html><head><title>Banger to Banjul</title>\n";
	vText += "<script language=\"JavaScript\" src=\"js/nrc.js\"></script>\n";
    vText += "<script language=\"javascript\">\n";
    vText += "<!--\n";
    vText += "function f_resize(n) { \n";
	vText += "if (n==0) {setTimeout(\"f_resize(1)\", 20);  }\n";
	vText += "else { window.resizeTo(document.images[0].width+10,document.images[0].height+27); }\n";
    vText += "}\n";
    vText += "//-->\n";
    vText += "</script>\n";
    vText += "</head><body style=\"margin: 0;\">\n";
	//vText += "var openerWin=opener.v_new_win;";
    vText += "<img src=\"" + arg_url + "\">\n";
    vText += "<script language=\"javascript\">\n";
    vText += "<!--\n";
    vText += "f_resize(0);\n";
    vText += "//-->\n";
    vText += "</script>\n";
    vText += "</body></html>";
	//  if (window.focus()) { v_new_win.focus(); }
	v_new_win.document.write(vText);
}

    // FROM BA FOR THE SLIDESHOW
	function f_pics(v_url) {
		//  var v_url_2;
		//  if (v_url == 1) { v_url_2 = 'images.html'; }
		//  window.open(v_url_2,"pics","menubar=no, location=no, status=no, toolbar=no, scrollbars=no, resizable=no, directories=no, width=630, height=540, left=5, top=5");
		//  alert(v_url);
		window.open(v_url,"pics","menubar=no, location=no, status=no, toolbar=no, scrollbars=no, resizable=no, directories=no, width=630, height=580, left=5, top=5");
	}

// MOVE THE CAR  ------------------------------------------------------
var v_left = (window.screen.availWidth/2)+(710/2)-87-100;   // 710 = table width, 87 = car width
var v_top = 18;  
var v_right_start = (window.screen.availWidth/2)+(710/2)-87;
var v_left_rise = (window.screen.availWidth/2)-(710/2);
function move_car(n) {

    // n WILL EQUAL 0 WHEN move_car() IS CALLED FROM THE POP UP 2006_trip.php
	// THAT IS THE DIARY PREVIEW FROM THE ADMIN PAGES
	if (n==0) {return 0;}

	v_left = v_left - 2;
	id_car.style.left = v_left;
	id_car.style.top  = v_top;
	// Move the car off the top of the screen
	if (v_left < v_left_rise  || (v_left < v_left_rise+100 && v_top <= 24)) {v_top = v_top - 10;}
	// Car is off the screen, so set it back to its starting position
	if (v_top < -40) {v_left = v_right_start; v_top = 81;}
	// Move the car twenty times a second
	setTimeout("move_car()", 50);
}



// NO RIGHT CLICK ---------------------------------------------------- START

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="Right click functionality is not available on this page\t";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
// alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
// alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

// document.oncontextmenu=new Function("alert(message);return false");
document.oncontextmenu=new Function("return false");

// NO RIGHT CLICK ------------------------------------------------------ END

// LETTERS APPEAR ONE AT A TIME, BUT QUICKLY
// t is the text, n is the iteration that we are in, w is which id
function f_one_letter(t,n,w) {

	//AFTER THE EVENT, SO NO LONGER NEEDED
	if (t.indexOf("Sponsor Us") != -1 || t.indexOf("Make a Donation") != -1) { t = "&nbsp;" }

	var v_len = t.length;
	try
	{ eval(w).innerHTML = t.substr(0, n++); }
	catch(e)
	{ id_header.innerHTML = t.substr(0, n++); }
	if (n<=v_len) { setTimeout("f_one_letter('" + t + "'," + n + ",'" + w + "')", 20); }
}

// ON THE ROAD DIARY PAGE
function f_2006_trip(week_number) {
	if (week_number < 1 || week_number > 4) {week_number=1};
    document.location.href = '2006_trip.php?week_num=' + week_number;
}
