///////////////////////////////////////////////////////////////////////////
function moveOver()  
{
var boxLength = document.choiceForm.choiceBox.length;
var selectedItem = document.choiceForm.available.selectedIndex;
var selectedText = document.choiceForm.available.options[selectedItem].text;
var selectedValue = document.choiceForm.available.options[selectedItem].value;
var i;
var isNew = true;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
thisitem = document.choiceForm.choiceBox.options[i].text;
if (thisitem == selectedText) {
isNew = false;
break;
      }
   }
} 
if (isNew) {
newoption = new Option(selectedText, selectedValue, false, false);
document.choiceForm.choiceBox.options[boxLength] = newoption;
}
document.choiceForm.available.selectedIndex=-1;
}
function removeMe() {
var boxLength = document.choiceForm.choiceBox.length;
arrSelected = new Array();
var count = 0;
for (i = 0; i < boxLength; i++) {
if (document.choiceForm.choiceBox.options[i].selected) {
arrSelected[count] = document.choiceForm.choiceBox.options[i].value;
}
count++;
}
var x;
for (i = 0; i < boxLength; i++) {
for (x = 0; x < arrSelected.length; x++) {
if (document.choiceForm.choiceBox.options[i].value == arrSelected[x]) {
document.choiceForm.choiceBox.options[i] = null;
   }
}
boxLength = document.choiceForm.choiceBox.length;
   }
}

function captureItems(){
var strValues = "";
var boxLength = document.choiceForm.choiceBox.length;
var boxLength2 = document.choiceForm.choiceBox2.length;
var count = 0;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
if (count == 0) {
strValues = strValues + "," + document.choiceForm.choiceBox.options[i].value;
document.choiceForm.Bunks.value=strValues+ "," + document.choiceForm.choiceBox.options[i].value;	

	}
		}
}
if (boxLength2 + boxLength == 0) {
			rc = alert('Please enter a date!');	
	} 
		else {
			if (boxLength2 + boxLength != 0) {
			document.choiceForm.submit();
			
		}
	}
}
//////////////////////////////////////////////////////////////////////////////////////////

function moveOver2()  
{
var boxLength = document.choiceForm.choiceBox2.length;
var selectedItem = document.choiceForm.available2.selectedIndex;
var selectedText = document.choiceForm.available2.options[selectedItem].text;
var selectedValue = document.choiceForm.available2.options[selectedItem].value;
var i;
var isNew = true;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
thisitem = document.choiceForm.choiceBox2.options[i].text;
if (thisitem == selectedText) {
isNew = false;
break;
      }
   }
} 
if (isNew) {
newoption = new Option(selectedText, selectedValue, false, false);
document.choiceForm.choiceBox2.options[boxLength] = newoption;
}
document.choiceForm.available2.selectedIndex=-1;
}
function removeMe2() {
var boxLength = document.choiceForm.choiceBox2.length;
arrSelected = new Array();
var count = 0;
for (i = 0; i < boxLength; i++) {
if (document.choiceForm.choiceBox2.options[i].selected) {
arrSelected[count] = document.choiceForm.choiceBox2.options[i].value;
}
count++;
}
var x;
for (i = 0; i < boxLength; i++) {
for (x = 0; x < arrSelected.length; x++) {
if (document.choiceForm.choiceBox2.options[i].value == arrSelected[x]) {
document.choiceForm.choiceBox2.options[i] = null;
   }
}
boxLength = document.choiceForm.choiceBox2.length;
   }
}

function captureItems2(){
var strValues2 = "";
var boxLength2 = document.choiceForm.choiceBox2.length;
var boxLength = document.choiceForm.choiceBox.length;
var count = 0;
if (boxLength2 != 0) {
for (i = 0; i < boxLength2; i++) {
if (count == 0) {
var strValues2 = strValues2 + "," + document.choiceForm.choiceBox2.options[i].value;
document.choiceForm.Dbed.value=strValues2+ "," + document.choiceForm.choiceBox2.options[i].value;
	}
}
}
if (boxLength2 + boxLength == 0  ) {
			rc = alert('Please enter a date!');			
		}
		 else {
			if (boxLength2 + boxLength != 0) {
			document.choiceForm.submit(); 
			
		}	
	}
}
/////////////////////////////////////////////////////////////////////////////////

//document.write('Your settings are ' + screen.width + ' x ' + screen.height + '');
if (screen.width == 640) {
document.write('<link rel="stylesheet" type="text/css" href="640.css">');
document.write('<script type="text/javascript" language="javascript" src="resources/sniffer.js"></script>');
document.write('<script type="text/javascript" language="javascript1.2" src="resources/custom2.js"></script>');
document.write('<script type="text/javascript" language="javascript1.2" src="resources/style.js"></script>');
//alert("Style Sheet for 640 x 480 would have been loaded.");
}
if (screen.width == 800) {
document.write('<link rel="stylesheet" type="text/css" href="1024.css">');
document.write('<script type="text/javascript" language="javascript" src="resources/sniffer.js"></script>');
document.write('<script type="text/javascript" language="javascript1.2" src="resources/custom2.js"></script>');
document.write('<script type="text/javascript" language="javascript1.2" src="resources/style.js"></script>');
//alert("Style Sheet for 800 x 600 would have been loaded.");
}
if (screen.width == 1024) {
document.write('<link rel="stylesheet" type="text/css" href="1024.css">');
document.write('<script type="text/javascript" language="javascript" src="resources/sniffer.js"></script>');
document.write('<script type="text/javascript" language="javascript1.2" src="resources/custom2.js"></script>');
document.write('<script type="text/javascript" language="javascript1.2" src="resources/style.js"></script>');
//alert("Style Sheet for 1024 x 768 would have been loaded.");
}
if (screen.width == 1152) {
document.write('<link rel="stylesheet" type="text/css" href="1024.css">');
document.write('<script type="text/javascript" language="javascript" src="resources/sniffer.js"></script>');
document.write('<script type="text/javascript" language="javascript1.2" src="resources/custom2.js"></script>');
document.write('<script type="text/javascript" language="javascript1.2" src="resources/style.js"></script>');
//alert("Style Sheet for 1152 x 864 would have been loaded.");
}
if (screen.width == 1280) {
document.write('<link rel="stylesheet" type="text/css" href="1280.css">');
document.write('<script type="text/javascript" language="javascript" src="resources/sniffer.js"></script>');
document.write('<script type="text/javascript" language="javascript1.2" src="resources/custom3.js"></script>');
document.write('<script type="text/javascript" language="javascript1.2" src="resources/style.js"></script>');
//alert("Style Sheet for 1280 x 960 would have been loaded.");
}
if (screen.width == 1366) {
document.write('<link rel="stylesheet" type="text/css" href="1280.css">');
document.write('<script type="text/javascript" language="javascript" src="resources/sniffer.js"></script>');
document.write('<script type="text/javascript" language="javascript1.2" src="resources/custom2.js"></script>');
document.write('<script type="text/javascript" language="javascript1.2" src="resources/style.js"></script>');
//alert("Style Sheet for 1366 x 900 would have been loaded.");
}
if (screen.width == 1440) {
document.write('<link rel="stylesheet" type="text/css" href="1280.css">');
document.write('<script type="text/javascript" language="javascript" src="resources/sniffer.js"></script>');
document.write('<script type="text/javascript" language="javascript1.2" src="resources/custom2.js"></script>');
document.write('<script type="text/javascript" language="javascript1.2" src="resources/style.js"></script>');
//alert("Style Sheet for 1440 x 900 would have been loaded.");
}
if (screen.width == 1600) {
document.write('<link rel="stylesheet" type="text/css" href="1280.css">');
document.write('<script type="text/javascript" language="javascript" src="resources/sniffer.js"></script>');
document.write('<script type="text/javascript" language="javascript1.2" src="resources/custom3.js"></script>');
document.write('<script type="text/javascript" language="javascript1.2" src="resources/style.js"></script>');
//alert("Style Sheet for 1600 x 1200 would have been loaded.");
}
//////////////////////////////////////////////////////////////////////////////////////

function check(choiceForm){

if (choiceForm.T1.value == ''&&choiceForm.T3.value == ''){
	alert('You must enter an arrival date!');
	choiceForm.name.value = '';
	choiceForm.name.focus();
	return false;
	}	
if (choiceForm.T2.value == ''&&choiceForm.T4.value == ''){
	alert('You must enter a date for your last night!');
	choiceForm.name.value = '';
	choiceForm.name.focus();
	return false;
	}	
if (choiceForm.name.value == ''){
	alert('You must provide your name!');
	choiceForm.name.value = '';
	choiceForm.name.focus();
	return false;
	}	
if (choiceForm.phone.value == ''){
	alert('You must provide your phone number!');
	choiceForm.phone.value = '';
	choiceForm.phone.focus();
	return false;
	}
			
if (choiceForm.email.value == ''){
	alert('You must provide your e-mail address!');
	choiceForm.email.value = '';
	choiceForm.email.focus();
	return false;
	}
if (!document.choiceForm.checkbox.checked) {
	alert('You must indicate that you agree to our Terms & Conditions!');
	return false;
}
		
else {
document.choiceForm.submit();
}
} 
/////////////////////////////////////////////////////////////////////////////////////////////////
function UpCase(TheField){
	TheField.value = TheField.value.toUpperCase();
}
function Replace(TheStr,TheDelStr,ThePutStr){
var Str=TheStr;
var Del=TheDelStr;
var Put=ThePutStr;
	while(Str.match(Del)){
		tmp=Str.indexOf(Del);
		BeforRep=Str.substring(0, tmp);
		AfterRep=Str.substring(tmp+Del.length, Str.length);
		Str=BeforRep+Put+AfterRep;
	}	
	return Str;
}
function CheckForm(contactForm){
 if (Replace(contactForm.name.value, ' ', '') == ''){
	alert('You must provide your name!');
	contactForm.name.value = '';
	contactForm.name.focus();
	return false;
	}	
var emailadd = contactForm.email.value.toLowerCase();
 if (Replace(emailadd, ' ', '') == ''){
	alert('You must provide your email address!');
	contactForm.email.value = '';
	contactForm.email.focus();
	return false;
	}
 if (emailadd.indexOf('@') == -1){
	alert('You must provide a valid email address!');
	contactForm.email.focus();
	return false;
	}
 if (emailadd.indexOf('.') == -1){
	alert('You must provide a valid email address!');
	contactForm.email.focus();
	return false;
	}
 var leftPos = contactForm.email.value.indexOf('@')
 var LeftStr = contactForm.email.value.substring(0, leftPos)
 if (Replace(LeftStr, ' ', '') == ''){
	alert('You must provide a valid email address!');
	contactForm.email.focus();
	return false;
	}
var valid = 0
if (emailadd.indexOf('.co.uk') > 0){valid = 1}
if (emailadd.indexOf('.uk.com') > 0){valid = 1}
if (emailadd.indexOf('.gb.com') > 0){valid = 1}
if (emailadd.indexOf('.org.uk') > 0){valid = 1}
if (emailadd.indexOf('.ltd.uk') > 0){valid = 1}
if (emailadd.indexOf('.plc.uk') > 0){valid = 1}
if (emailadd.indexOf('.uk.net') > 0){valid = 1}
if (emailadd.indexOf('.gb.net') > 0){valid = 1}
if (emailadd.indexOf('.com') > 0){valid = 1}
if (emailadd.indexOf('.org') > 0){valid = 1}
if (emailadd.indexOf('.net') > 0){valid = 1}
if (emailadd.indexOf('.edu') > 0){valid = 1}
if (emailadd.indexOf('.ac') > 0){valid = 1}
if (emailadd.indexOf('.sh') > 0){valid = 1}
if (valid == 0){
		if (confirm('Are you sure about your email address?')) {
		//do nothing;
		}
		else {
		contactForm.email.focus();
		return false;
		}
	}
 
else {
document.contactForm.submit();
}
} 


/////////////////////////////////////////////////////////////////////////////////////////////////

function initArray() {
 for (i=0;i<initArray.arguments.length;i++)
  this[i] = initArray.arguments[i];
 this.length = initArray.arguments.length;
}

// *** Replace the sample messages with your messages.    ***
// *** You can put as few or as many messages as you want "Fares to Carcassonne, from £5.49 in February!!");***

var msg = new initArray("Flight News - Flight News- Flight News",
                        "Fares London/Carcassonne £10 total in July!!!!");
                       

// DEFINE THESE VARIABLES TO CUSTOMIZE AS FOLLOWS:
// start_automatically - start Typing Marquee automatically?
// marq_repeat - repeat after all messages are shown?
// marq_length - length of box
// type_speed - typing speed (175 recommended)
// intermsg_delay - delay between messages (1700 recommended)
// marq_default - message to show when idle

var start_automatically = true;
var marq_repeat = true;
var marq_length = 49;
var type_speed = 100;
var intermsg_delay = 500;
var marq_default = "";

function toggle(par) {
 document.marq_form.marq.blur();
 if (par || start_automatically) {
  marq_status = !marq_status;
  if (verify()) {
   cur_msg = 0;
   cur_char = 0;
   type();
  } else {
   marq_status = false;
  }
 }
}
function verify() {
 var valid = true;
 for (j=0;j<msg.length;j++) {
  if (msg[j].length > marq_length) {
   alert("Message "+(j+1)+" is too long! "
    + "You must fix it for the script to run. "
    + "Either shorten the message or increase "
    + "marq_length so it fits.");
   valid = false;
  }
 }
 return valid;
}
function type() {
 if (cur_char >= msg[cur_msg].length) {
  cur_char = 0;
  cur_msg++;
 }
 if (cur_char == 0)
  document.marq_form.marq.value = "";
 if ((cur_msg >= msg.length) && (marq_repeat))
  cur_msg = 0;
 if ((cur_msg<msg.length) && (marq_status)) {
  document.marq_form.marq.value += msg[cur_msg].charAt(cur_char);
  cur_char++;
  if (cur_char >= msg[cur_msg].length)
   setTimeout("type()",intermsg_delay);
  else
   setTimeout("type()",type_speed);
 } else {
  document.marq_form.marq.value = marq_default;
  marq_status = false;
 }
}
var marq_status = false;
var cur_msg = 0;
var cur_char = 0;


//////////////////////////////////////////////////////////////////////////////////

	/*Script distributed by Hypergurl.com
Visit http://www.hypergurl.com/easyhtml.html
  for this script and many more
*/
 
//Pre-loads your image/s below
//Configure below - change URL path to the snow image

grphcs=new Array(6)
Image0=new Image();
Image0.src=grphcs[0]="images/snow.gif";
Image1=new Image();
Image1.src=grphcs[1]="images/snow.gif"
Image2=new Image();
Image2.src=grphcs[2]="images/snow.gif"
Image3=new Image();
Image3.src=grphcs[3]="images/snow.gif"
Image4=new Image();
Image4.src=grphcs[4]="images/snow.gif"
Image5=new Image();
Image5.src=grphcs[5]="images/snow.gif"

//Smoothness depends on image file size, 
//the smaller the size the more you can use!

// Configure below - change number of snow to render
Amount=15; 

Ypos=new Array();
Xpos=new Array();
Speed=new Array();
Step=new Array();
Cstep=new Array();
ns=(document.layers)?1:0;
ns6=(document.getElementById&&!document.all)?1:0;

if (ns){
	for (i = 0; i < Amount; i++){
		var P=Math.floor(Math.random()*grphcs.length);
		rndPic=grphcs[P];
		document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0><img src="+rndPic+"></LAYER>");
	}
}
else{
	document.write('<div style="position:absolute;top:-10px;left:-10px"><div style="position:relative">');
	for (i = 0; i < Amount; i++){
		var P=Math.floor(Math.random()*grphcs.length);
		rndPic=grphcs[P];
		document.write('<img id="si'+i+'" src="'+rndPic+'" style="position:absolute;top:0px;left:0px">');
	}
	document.write('</div></div>');
}
WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;
WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;
for (i=0; i < Amount; i++){
	Ypos[i] = Math.round(Math.random()*WinHeight);
	Xpos[i] = Math.round(Math.random()*WinWidth);
	Speed[i]= Math.random()*5+3;
	Cstep[i]=0;
	Step[i]=Math.random()*0.1+0.05;
}
function fall(){
	var WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;
	var WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;
	var hscrll=(ns||ns6)?window.pageYOffset:document.body.scrollTop;
	var wscrll=(ns||ns6)?window.pageXOffset:document.body.scrollLeft;
	for (i=0; i < Amount; i++){
		sy = Speed[i]*Math.sin(90*Math.PI/180);
		sx = Speed[i]*Math.cos(Cstep[i]);
		Ypos[i]+=sy;
		Xpos[i]+=sx;
		if (Ypos[i] > WinHeight){
			Ypos[i]=-60;
			Xpos[i]=Math.round(Math.random()*WinWidth);
			Speed[i]=Math.random()*5+3;
		}
		if (ns){
			document.layers['sn'+i].left=Xpos[i];
			document.layers['sn'+i].top=Ypos[i]+hscrll;
		}
		else if (ns6){
			document.getElementById("si"+i).style.left=Math.min(WinWidth,Xpos[i]);
			document.getElementById("si"+i).style.top=Ypos[i]+hscrll;
		}
		else{
			eval("document.all.si"+i).style.left=Xpos[i];
			eval("document.all.si"+i).style.top=Ypos[i]+hscrll;
		}
		Cstep[i]+=Step[i];
	}
	setTimeout('fall()',115);
	}
//////////////////////////////////////////////////////////////////////////////////////


