{
//	Configuration variables
display_secs = 4000;	// time image is displayed for in milliseconds
fade_secs = 3000;	// time image takes to fade in for in milliseconds
image_count = 11;	// number of images used
image_ids = new Array();
image_ids[0] = "images/mondeo-1.jpg";
image_ids[1] = "images/fiesta-1.jpg";
image_ids[2] = "images/transit-1.jpg";
image_ids[3] = "images/ldv_minibus-1.jpg";
image_ids[4] = "images/galaxy-1.jpg";
image_ids[5] = "images/mondeo-2.jpg";
image_ids[6] = "images/fiesta-2.jpg";
image_ids[7] = "images/galaxy-2.jpg";
image_ids[8] = "images/ldv_minibus-2.jpg";
image_ids[9] = "images/mondeo-est.jpg";
image_ids[10] = "images/transit-2.jpg";

}
if (fade_secs > display_secs)
{
var fade_secs = display_secs;
}

// ------------------------------------------------------------------------------------------------

function start()
{
image_number = 0;

RunImageFader();
}

// ------------------------------------------------------------------------------------------------

function RunImageFader()
{
if (image_number == image_count)
{
image_number=0;
}
nextImage = image_ids[image_number];
document.getElementById("pictures").style.backgroundImage = "url(" + document.getElementById("fading-images").src + ")"; 
document.getElementById('fading-images').src = nextImage; 
image_number++
$("#fading-images").fadeTo(0,0);
$("#fading-images").fadeTo(fade_secs,1,function(){RunImageFader();});
}

// ------------------------------------------------------------------------------------------------

// Next function is a Subroutine to insert the HTML to display the SWFs 
function Swf_Display(filename,width,height,id_name)
{
document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"");
document.write("codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\"");
document.write("width=\"" + width + "\" height=\"" + height + "\" border=\"0\" id=\"" + id_name + "\">");
document.write("<param name=\"movie\" value=\"" + filename + "\">");
document.write("<param name=\"quality\" value=\"high\">");
// document.write("<param name=bgcolor value=#00ff00>");	// overwrites background color in TEXTFADE SWF in IE7
document.write("<embed src=\"" + filename + "\" quality=\"high\"");
// document.write("bgcolor=\"#ffffff\"");	// overwrites background color in TEXTFADE SWF in FIREFOX 3.0
document.write("width=\"" + width + "\" height=\"" + height + "\" name=\"" + id_name + "\" align=\"center\" type=\"application/x-shockwave-flash\"");
document.write("pluginspage=\"http://www.macromedia.com/go/getflashplayer\">");
document.write("</embed>");
document.write("</object>");
}

// ------------------------------------------------------------------------------------------------

// Next function hides the SWF for the first defined milliseconds to mask out the flash at the start of display 
function reveal(mask_swf)
{
var delay = 300;  // mask out delay in milliseconds in local scope
var aaa = setTimeout('document.getElementById("' + mask_swf + '").style.visibility="visible";',delay);
}

// ------------------------------------------------------------------------------------------------

// Sets the E-mail Obfuscation Varibles

{
site = "getaway-car-hire%23co%23uk";
cee = "CarHire%7e";
vee = "VanHire%7e";
emm = "MinibusHire%7e";
enk = "MyEnquiry%7e";
fin = "lto:";
pos_stored = "300px";
}

// ------------------------------------------------------------------------------------------------

// Next function decodes the href mailto settings

function decode_01(mice)
{
document.getElementById("yours").href="mai" + fin + mice.replace(/%7e/g,String.fromCharCode(64)) + site.replace(/%23/g,".");
}

// ------------------------------------------------------------------------------------------------

// Next function decodes the html displayed page settings

function decode_02(fish)
{
document.write(fish.replace(/%7e/g,String.fromCharCode(64)) + site.replace(/%23/g,"."));
}

// ------------------------------------------------------------------------------------------------

// Next function display the E-mail pop-up box on mouseover

function show_email(pos)
{
if(pos == "0px")
{
pos = pos_stored;
}
pos_stored = pos;
document.getElementById("email-pop-up").style.top = pos;
document.getElementById("email-pop-up").style.visibility="visible";
}

// ------------------------------------------------------------------------------------------------

// Next function hides the E-mail pop-up box on mouseout

function hide_email()
{
document.getElementById("email-pop-up").style.visibility="hidden";
}

// ------------------------------------------------------------------------------------------------

// Next function selects enquiry type for the href mailto settings

function select_how(cats)
{
send_email_referrer(cats)
switch(cats)
{
case "car":
decode_01(cee)
  break;
case "van":
decode_01(vee)
  break;
case "minibus":
decode_01(emm)
  break;
case "general":
decode_01(enk)
  break;
default:
}
}

// ------------------------------------------------------------------------------------------------

// Next function selects enquiry type for html displayed page settings

function display(dogs)
{
switch(dogs)
{
case "car":
decode_02(cee)
  break;
case "van":
decode_02(vee)
  break;
case "minibus":
decode_02(emm)
  break;
case "general":
decode_02(enk)
  break;
default:
}
}

// ------------------------------------------------------------------------------------------------

// Next function sets the contact us e-mail referrer as cars, vans, minibus, enquiries

function send_email_referrer(referrer)
{
document.getElementById("fish").innerHTML = "<a id='ours' href='email-form.php?select=" + referrer + "' target='_blank'>>> 'Use our E-Mail Contact Form'</a>";
}

// ------------------------------------------------------------------------------------------------

// Next function sets the close e-mail count-down timer and returns to Contact Us Page

var secs = "6"; // change seconds here (always add an additional second to your total)
var back =  "contact-us.php";

function count_down()
{
secs--;
document.getElementById("dogs").innerHTML = "This window will close and return you to the Contact-Us Page in &nbsp; <span style='color:red;'>" + secs + "</span>&nbsp; seconds";
if(secs == 0)
{
window.location = back;
}
else
{
setTimeout("count_down()",1000);
}
}

// ------------------------------------------------------------------------------------------------

// Next function hides the security entry fields and disables the Submit Button

function hide_fields(yoyo)
{
for(var i=1; i<4; i++)
{
stars = yoyo + i;
document.getElementById(stars).style.visibility="hidden";
}
submit_object = document.getElementById('girls');
submit_object.value = 'disabled';
submit_object.disabled = true;
}


// ------------------------------------------------------------------------------------------------

// Next function hides the Valid CSS checked image logo

function hide_csslogo()
{
document.getElementById("css_logo").style.visibility="hidden";
}

// ------------------------------------------------------------------------------------------------

// calls the go function when everything else has been loaded to start image fading and hide the sub-menus 
// window.onload=go;	// note if () parentheses are included the function runs in sequence of loading
