function valDocs(myForm,docType, lang) {
	if(lang == "de")
	{
	 	sentence = "Bitte wählen Sie eine ";
	}
	else if(lang == "fr")
	{
		sentence = "Veuillez sélectionner ";
	}
	else if(lang == "es")
	{
		sentence = "Por favor seleccionar  ";
	}
	else
	{
		sentence = "Please select a ";
	}
    if ("x" == myForm.filename.value) {
        window.alert(sentence + docType + "!")
        return false
    }
    return true
}
//surpress ie errors window
window.onerror = function(){
    return true;
}
function submitMe(val)
{
	form = document.forms.regionSelectForm;
	form.submit();
}
//below function is used inconjunction with rotating image flash movie /inc/balances.php
//a flash movie products2.swf/fla when view image button is pushed function in flash movie
//calls function below which creates a cookie of the image name wanted for enlarging
//the cookie created below is ued by php in balances.php to render image
//howvever as a cookie is being used so the page needs to be reloaed so cookie is updated
//I have had to use two different methods to achieve this as both main browsers would only
//work on one or the other method
//IE used soft reload method go(0) where as firefox gets sent to get_images.php then returned back
//to balances.php
function openNewWindow(URLtoOpen, windowName, windowFeatures) 
{
 	var the_cookie = "smallImg="+ URLtoOpen;
 	document.cookie= the_cookie
	
	if(navigator.appVersion.indexOf("MSIE") != -1)
	{
		history.go(0);
	}
	else
	{
		location.href = "/inc/get_image.php";
	}
}
function valWarr(lang) {
    var val = [['serial_number','distributors_name','distributors_ctry','forename','surname','address_line1','city','postal_zip_code','Country','email'],['Serial number','Name of distributor','Distributor\'s country','First name','Last name','Address Line 1','Town/city','ZIP/postal code','Country','E-mail address'],['','','x','','','','','','x','']]
    if (valThisForm(val,'warranty3','warr_email', lang)) {
        return true
    } else {
        return false
    }
}
function toggleBoxes(chkd) {
    myArrayLength = document.models_to_show.elements.length - 3;
    for (i = 0; i < myArrayLength; i++) {
        document.models_to_show.elements[i].checked = chkd
    }
}
function subSpecs(myform, lang) 
{
    if (valCheckBoxes(lang)) 
	{
	    myform.submit();
        return false;
    } 
	  return false;
}
function valCheckBoxes(lang) {
    myArrayLength = document.models_to_show.elements.length - 3;
    var atLeastOneChecked = 0;
	var total = 0;
    for (i = 0; i < myArrayLength; i++) {
        if (document.models_to_show.elements[i].checked) 
		{
            atLeastOneChecked = 1;
			total += 1; 
        }
    }
	if(total > 11)
	{
		if(lang == "de")
		{
	 		alert("Bitte nicht mehr als 11 Modelle auswählen")
		}
		else if(lang == "fr")
		{
			alert("Veuillez ne pas sélectionner plus de 11 modèles")
		}
		else if(lang == "es")
		{
			alert("Please do not select more than 11 models")
		}
		else
		{
			alert("Please do not select more than 11 models")
		}
		
		return false;
	}
    if (atLeastOneChecked != 1) {
		if(lang == "de")
		{
	 		window.alert("Please select one  or more models from the list.");
		}
		else if(lang == "fr")
		{
			window.alert("Please select one or more models from the list.");
		}
		else if(lang == "es")
		{
			window.alert("Please select one or more models from the list.");
		}
		else
		{
			window.alert("Please select one or more models from the list.");
		}
        
        return false;
    }
	else
	{
    	return true;
	}
	
}
function toggleDetails(init) {
  if (document.getElementById('details'))
  {
    var details
    var img
    details = document.getElementById('details')
    img = document.getElementById('dt')
    if ('none' != details.style.display || 1 == init)
    {
      details.style.display = 'none'
      img.src =  '/img/balances/dt1.png'
    } else 
	{
     details.style.display = 'inline'
      img.src =  '/img/balances/dt2.png'
    }
  }
}
function init()
{
  toggleDetails(1); 
}
function symbolExplain(name, action, lang)
{
	if(lang == "de")
	{
	 	sentence = "Fahren Sie mit der Maus über die Symbole für nähere Beschreibung";
	}
	else if(lang == "fr")
	{
		sentence = "Déplacer votre souris au-dessus des symboles pour une explication";
	}
	else if(lang == "es")
	{
		sentence = "para mas información mueva el ratón sobre los símbolos";
	}
	else
	{
		sentence = "Move mouse over a symbol for an explanation";
	}
	if(action == "over")
	{
		document.getElementById("symbolKeyExplain").innerHTML = name;
	}
	else
	{
		document.getElementById("symbolKeyExplain").innerHTML = sentence;
	}
}
function changeLanguage(lang)
{
	var the_language_cookie = "lang=" + lang;
	document.cookie=the_language_cookie 
 //location = 'index.php';
}
function valSearch(myForm) {
    if (myForm.cap.value == 'Capacity' && myForm.read.value == 'Readability') 
	{
        window.alert("Please select a value for capacity and/or readablility");
        return false;
    }
	else  if (myForm.cap.value == 'Kapazität' && myForm.read.value == 'Ablesbarkeit') 
	{
        window.alert("Bitte wählen Sie einen Wert für Kapazität und/oder Ablesbarkeit");
        return false;
    }
	else  if (myForm.cap.value == 'Capacidad' && myForm.read.value == 'Legibilidad') 
	{
        window.alert("Por favor seleccione un valor de capacidad y/o resolución");
        return false;
    }
	else  if (myForm.cap.value == 'Capacité' && myForm.read.value == 'Précision') 
	{
        window.alert("Veuillez sélectionner une valeur pour la capacité et/ou la précision");
        return false;
    }
   
    return true;
}
function valSearchAdv(myForm, lang) {
    if (myForm.cap.value == 'e.g. 1500' && myForm.read.value == 'e.g. 0.1') 
	{
        
		if(lang == "de")
		{
	 		window.alert("Bitte wählen Sie einen Wert für Kapazität und/oder Ablesbarkeit");
		}
		else if(lang == "fr")
		{
			window.alert("Veuillez sélectionner une valeur pour la capacité et/ou la précision");
		}
		else if(lang == "es")
		{
			window.alert("Por favor seleccione un valor de capacidad y/o resolución");
		}
		else
		{
			window.alert("Please select a value for capacity and/or readablility");
		}
		
        return false;
    }
    return true;
}
function emptyKWBox(myBox) {
    if (myBox.value == 'Keywords...') {
        myBox.value = '';
    }
}
function valKWSearch(myForm) {
    if ((myForm.kwquery.value == 'keywords') || (myForm.kwquery.value == '')) 
	{
	 window.alert("Please enter a keyword/s");
        return false;
    }
	else if ((myForm.kwquery.value == 'Stichwörter') || (myForm.kwquery.value == '')) 
	{
	 window.alert("Please enter a keyword/s");
        return false;
    }
	else if ((myForm.kwquery.value == 'Palabras clave') || (myForm.kwquery.value == '')) 
	{
	 window.alert("Please enter a keyword/s");
        return false;
    }
	else if ((myForm.kwquery.value == 'Mots clés') || (myForm.kwquery.value == '')) 
	{
	 window.alert("Please enter a keyword/s");
        return false;
    }
    return true;
}
function valMarkets(myForm, lang) 
{
    if (myForm.marketTypes.value == '') 
	{
		if(lang == "en")
		{
			window.alert("Please select a market type from the drop down list");
        	return false;
		}
		else if(lang == "fr")
		{
			window.alert("Veuillez sélectionner un type de marché de la liste déroulante");
        	return false;
		}
		else if(lang == "de")
		{
			window.alert("Bitte wählen Sie einen Branchentyp aus der Drop-down-Liste");
        	return false;
		}
		else if(lang == "es")
		{
			window.alert("Por favor seleccione un mercado de la lista de abajo");
        	return false;
		}
    }
    return true;
}
function valpanSquare(myForm, lang) 
{
    if (myForm.panSizeSquare.value == '') 
	{
		if(lang == "en")
		{
			window.alert("Please select a pan size from the drop down list");
        	return false;
		}
		else if(lang == "fr")
		{
			window.alert("Veuillez sélectionner une taille de plateau dans la liste déroulante");
        	return false;
		}
		else if(lang == "de")
		{
			window.alert("Bitte wählen Sie eine Größe für die Wägeplatte aus der Drop-Down-Liste");
        	return false;
		}
		else if(lang == "es")
		{
			window.alert("Por favor seleccione un tamaño de plataforma de la lista de abajo");
        	return false;
		}
    }
    return true;
}
function valUnits(myForm, lang) 
{
    if (myForm.unitTypes.value == '') 
	{
		if(lang == "en")
		{
			window.alert("Please select a unit from the drop down list");
        	return false;
		}
		else if(lang == "fr")
		{
			window.alert("Veuillez sélectionner un type de marché de la liste déroulante");
        	return false;
		}
		else if(lang == "de")
		{
			window.alert("Bitte wählen Sie einen Branchentyp aus der Drop-Down-Liste");
        	return false;
		}
		else if(lang == "es")
		{
			window.alert("Por favor seleccione una unidad de la lista de abajo");
        	return false;
		}
    }
    return true;
}
function valPanRound(myForm, lang) 
{
    if (myForm.panSizeRound.value == '') 
	{
		if(lang == "en")
		{
			window.alert("Please select a pan size from the drop down list");
        	return false;
		}
		else if(lang == "fr")
		{
			window.alert("Veuillez sélectionner une taille de plateau dans la liste déroulante");
        	return false;
		}
		else if(lang == "de")
		{
			window.alert("Bitte wählen Sie eine Größe für die Wägeplatte aus der Drop-Down-Liste");
        	return false;
		}
		else if(lang == "es")
		{
			window.alert("Por favor seleccione un tamaño de plataforma de la lista de abajo");
        	return false;
		}
    }
    return true;
}
//open close search and dealer zone login tabs on lefthand menu bar
function viewLayer(openLayer, closeLayer, closeLayer2)
{
	document.getElementById(closeLayer).style.display = 'none';
	document.getElementById(openLayer).style.display = 'block';
	document.getElementById(closeLayer2).style.display = 'none';
}

var tsx=0;
function tsinit(x)
{
	tsx=x;
	s = document.cookie + ";";
	i = s.indexOf("P14TS");
	if (i < 0)
	{
		if (i == "") document.getElementById("ts1").style.borderColor='#547FBD'; else document.getElementById("ts1").style.borderColor='#547FBD';
	 	return;
	}
	j = s.indexOf(";", i);
	if (j < 0) return;
	n = parseFloat(s.substr(i+6, j-i-6));
	if (n < 1 || n > 4) return;
	tschange(n);
}
//increase/decrease font size
function tschange(n)
{
	e = document.getElementById("tscontent");
	//alert(e)
	if (e == null) return;
	document.cookie = "P14TS=" + n + "; expires=Sun, 01 Dec 2030 23:59:59 GMT; path=/; domain=adamequipment.com;";
	if (document.getElementById("ts1"))
	{
		if (n == 1) document.getElementById("ts1").style.borderColor='#547FBD'; else document.getElementById("ts1").style.borderColor='#ccc';
		if (n == 2) document.getElementById("ts2").style.borderColor='#547FBD'; else document.getElementById("ts2").style.borderColor='#ccc';
		if (n == 3) document.getElementById("ts3").style.borderColor='#547FBD'; else document.getElementById("ts3").style.borderColor='#ccc';
		if (n == 4) document.getElementById("ts4").style.borderColor='#547FBD'; else document.getElementById("ts4").style.borderColor='#ccc';
	}
	if (n == 4)
	{
		n = 130;
		h = "300px"
		g = "260px"
		k = "230px";
		j = "200px";
		m = "200px";
		o = "110px";
	}
	else if(n == 1)
	{
		n = 100
		h = "200px";
		g = "200px";
		k = "170px";
		j = "150px";
		m = "200px";
		o = "95px";
	}
	else if(n == 2)
	{
		n = 90 + n * 10;
		h = "240px";
		g = "220px";
		k = "190px";
		j = "160px";
		m = "220px";
		o = "95px";
	}
	else
	{
		n = 90 + n * 10;
		h = "270px";
		g = "240px";
		k = "210px";
		j = "180px";
		m = "200px";
		o = "105px";
	}
	e.style.fontSize = n + "%";
	
	for (i=1 ; i <= tsx ; i++)
	{
		e = document.getElementById("tsx" + i);
		if (e) e.style.fontSize = n + "%";
	}
	e = document.getElementById("lower_columns");
	if (e) e.style.height = h;
	e = document.getElementById("homepageBox");
	if (e) e.style.height = g;
	e = document.getElementById("homepageBox2");
	if (e) e.style.height = g;
	e = document.getElementById("homepageBox3");
	if (e) e.style.height = g;
	e = document.getElementById("homepageFindOutMore");
	if (e) e.style.top = k;
	e = document.getElementById("homepageFindOutMore2");
	if (e) e.style.top = k;
	e = document.getElementById("quick_link_columns");
	if (e) e.style.height = j;
	e = document.getElementById("greenLineBottomBalances");
	if (e) e.style.height = '13px';
	e = document.getElementById("quick_link_fourth");
	if (e) e.style.height = o;
	e = document.getElementById("tsheader");
	if (e) e.style.fontSize = n + "%";
	e = document.getElementById("tsfooter");
	if (e) e.style.fontSize = n + "%";
}
//mouseover mousedown and onclick menu function
//if menu item clicked on rollon rollover and onclick image all set to the same into 'on' state
//if another menu item is clicked then first of all all img are set back to 'on', 'over' and 'off' state
//clicked on image all set to the same into 'on' state and so on
function OverImage(name, event, section) 
{
	if (document.images) 
	{
		if(event == "over")
		{
			fullname = eval(name + "_on");
			document[name].src = fullname.src;
		}
		else if(event == "off")
		{
			fullname = eval(name + "_off");
			document[name].src = fullname.src;
		}		
	}
}
function beginDownload(flnm) 
{
    dl = window.open(flnm,"dl","width=400,height=400,scrollbars,statusbar,menubar,resizable");
	 //window.location.href = flnm;
}
function valBuy(lang) {
'First name','Last name','Phone number','E-mail address','Town/city','State','ZIP/postal code','Country'
	switch (lang)
{
	case "de":
	first_name = "Vorname";
	surname = "Zuname";
	phone = "Telefonnummer";
	email_address = "Email- Adresse";
	town = "Stadt";
	county = "Bundesland/ Region";
	postcode = "Postleitzahl";
	country = 'Land';
	break;
	case "fr":
	first_name = "Prenom";
	surname = "Nom";
	phone = "Telephone";
	email_address = "Adresse email";
	address = "Adresse";
	town = "Ville";
	county = "Departement / region";
	postcode = "Code postal";
	country = 'Pays';
	break;
	case "en":
	first_name = "First name";
	surname = "Surname";
	phone = "Telephone";
	email_address = "Email address";
	address = "Address";
	town = "Town / City";
	county = "Country";
	postcode = "Postcode";
	country = "Country";
	break;
	case "es":
	first_name = "Nombre";
	surname = "Apellido";
	phone = "Teléfono";
	email_address = "Dirección de correo electrónico";
	address = "Dirección";
	town = "Pueblo/ciudad";
	county = "Provincia/Comunidad Autónoma ";
	postcode = "Código Postal";
	country = 'País';
	break;
}
    var val = [['buy_forename','buy_surname','buy_phone','buy_email','buy_city','buy_state','buy_postal','buy_country'],[first_name, surname, phone, email_address,town,county,postcode,country],['','','','','','x','','x']]
    if (valThisForm(val,'enquiry','buy_email', lang)) {
        return true
    } else {
        return false
    }
}
function valThisForm(val,myForm,myEmail,lang) 
{
    var alertMsg = ""
     for (var i=0; i < val[0].length; i++) {
        if (eval("document." + myForm + "." + val[0][i])) {
            myEle = eval("document." + myForm + "." + val[0][i] + ".style")
            if (!document.layers) {
                myEle.background = '#fff'
            }
        }
        if (eval("document." + myForm + "." + val[0][i]) && (eval("document." + myForm + "." + val[0][i] + ".value") == val[2][i])) {
            alertMsg += "\n - " + val[1][i]
            if (!document.layers) {
                myEle.background = '#fdd'
            }
        }
    }
    if ("" != alertMsg) 
	{
        if(lang == "en")
		{
			window.alert("The following fields are required:" + alertMsg)
        	return false;
		}
		else if(lang == "fr")
		{
			window.alert("The following fields are required:" + alertMsg)
        	return false;
		}
		else if(lang == "de")
		{
			window.alert("The following fields are required:" + alertMsg)
        	return false;
		}
		else if(lang == "es")
		{
			window.alert("The following fields are required:" + alertMsg)
        	return false;
		}
    }
	else if (!isEmail(eval("document." + myForm + "." + myEmail + ".value"))) 
	{
        window.alert("Please enter a valid email address.");
        eval("document." + myForm + "." + myEmail).select()
		return false;
    } return true;
}
function valAppl(lang) 
{
	switch (lang)
	{
		case "de":
		company_name = 'Firmenname';
		address = 'Adresszeile 1';
		town = 'Stadt';
		postcode = 'Postleitzahl';
		country = 'Land';
		phone = 'Telefon';
		email = 'E-mail';
		name = 'Name';
		job = 'Tätigkeit';
		break;
		case "fr":
		company_name = 'Entreprise';
		address = 'Address line 1';
		town = 'Ville';
		postcode = 'Code postal';
		country = 'Pays';
		phone = 'Phone number';
		email = 'E-mail';
		name = 'Name';
		job = 'Tätigkeit';
		break;
		case "en":
		company_name = 'Company name';
		address = 'Address line 1';
		town = 'Town/city';
		postcode = 'ZIP/postal code';
		country = 'Country';
		phone = 'Phone number';
		email = 'E-mail address';
		name = 'Contact name';
		job = 'Job title';
		break;
		case "es":
		company_name = 'Nombre de la Compañía';
		address = 'Dirección Línea 1';
		town = 'Ciudad o lugar';
		postcode = 'Código Postal';
		country = 'País';
		phone = 'Teléfono';
		email = 'E-mail';
		name = 'Nombre';
		job = 'Título puesto de trabajo';
		break;
	}
	var val = [['Company_name','Address_1','City','Postal_code','Country','Phone_number','email','Name','Position_in_company'],[company_name, address, town, postcode, country, phone, email, name, job],['','','','','x','','','','']]
    if (valThisForm(val,'dealerapp','appl_email', lang)) 
	{
        return true
    } 
	else 
	{
        return false
    }
}
function valSvc(lang) 
{
	switch (lang)
	{
		case "de":
		serial = 'Seriennummer';
		distributor = 'Name des Händlers';
		dist_country = 'Land des Händlers';
		first_name = 'Vorname';
		surname = "Zuname";
		address = "Adresse";
		town = "Stadt";
		postcode = "Postleitzahl";
		country = 'Land';
		email = 'E-mail';
		prob_description = 'Problembeschreibung';
		break;
		case "fr":
		serial = 'Numéro de série';
		distributor = 'Nom du distributeur';
		dist_country = 'Pays du distributeur';
		first_name = 'Prenom';
		surname = "Nom";
		address = "Adresse";
		town = "Ville";
		postcode = "Code postal";
		country = 'Pays';
		email = 'E-mail';
		prob_description = 'Description du problème';
		break;
		case "en":
		serial = 'Serial number';
		distributor = 'Name of distributor';
		dist_country = 'Distributor\'s country';
		first_name = 'First name';
		surname = 'Last name';
		address = 'Address line 1';
		town = 'Town/city';
		postcode = 'ZIP/postal code';
		country = 'Country';
		email = 'E-mail address';
		prob_description = 'Problem description';
		break;
		case "es":
		serial = 'Serial number';
		distributor = 'Name of distributor';
		dist_country = 'Distributor\'s country';
		first_name = "Nombre";
		surname = "Apellido";
		address = "Dirección";
		town = "Pueblo/ciudad";
		postcode = "Código Postal";
		country = 'País';
		email = 'E-mail';
		prob_description = 'Problem description';
		break;
	}
    var val = [['Serial_number','Distributor_name','Distributor_country','Forename','Surname','Address_1','City','Postal_code','Country','email','Problem'],[serial, distributor, dist_country, first_name, surname, address, town, postcode, country,email, prob_description],['','','x','','','','','','x','','']]
    if (valThisForm(val,'service','svc_email', lang)) 
	{
        return true;
    } 
	else 
	{
        return false;
    }
}
function valEnq(lang) 
{
	switch (lang)
	{
		case "de":
		first_name = "Vorname";
		surname = "Zuname";
		email_address = "Email- Adresse";
		address = "Adresse";
		town = "Stadt";
		county = "Bundesland/ Region";
		postcode = "Postleitzahl";
		phone = "Telefonnummer";
		message = "Message"
		break;
		case "fr":
		first_name = "Prenom";
		surname = "Nom";
		email_address = "Adresse email";
		address = "Adresse";
		town = "Ville";
		county = "Departement / region";
		postcode = "Code postal";
		phone = "Telephone";
		message = "Message"
		break;
		case "en":
		first_name = "First name";
		surname = "Surname";
		email_address = "Email address";
		address = "Address";
		town = "Town / City";
		county = "Country";
		postcode = "Postcode";
		phone = "Telephone";
		message = "Message"
		break;
		case "es":
		first_name = "Nombre";
		surname = "Apellido";
		email_address = "Dirección de correo electrónico";
		address = "Dirección";
		town = "Pueblo/ciudad";
		county = "Provincia/Comunidad Autónoma ";
		postcode = "Código Postal";
		phone = "Teléfono";
		message = "Message"
		break;
	}
    var val = [['Forename','Surname','enquiry','Phone_number','email','City','State','Postal_code','Country'],[first_name,surname,message,phone,email_address,town,'State',postcode,county],['','','','','','','x','','x']]
    if (valThisForm(val,'enquiry','enq_email', lang)) 
	{
        return true
    } 
	else 
	{
        return false
    }
}
/**
	Frédéric Saunier
	http://www.tekool.net/javascript/backtothehtml

	This program is part of a free software; you can redistribute it and/or
	modify it under the terms of the GNU General Public License
	as published by the Free Software Foundation; either version 2
	of the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
**/
/*****************************************************************************
* BackToTheHtml Command
*///**************************************************************************
function BackToTheHtml(node)
{
	if(node == null)
		this.node = document; 
	else
		this.node = node; 
};
BackToTheHtml.prototype.node = null;

BackToTheHtml.prototype.execute = function()
{
	this.activateObject();
}
BackToTheHtml.prototype.activateObject = function(domObject)
{
	var aDomObject = this.node.getElementsByTagName('object');
	var activationObject;
	for(var i=0; i<aDomObject.length; i++)
		if
		(
			aDomObject[i].getAttributeNode('BackToTheHtml') == null
			&&
			(activationObject = this.getActivationObject(aDomObject[i])) != null
		)
			activationObject.execute();
};
BackToTheHtml.prototype.getActivationObject = function(domObject)
{
	var classid = domObject.classid.toUpperCase().substr('clsid:'.length);
	var mimeType = domObject.type.toLowerCase();

	switch(true)
	{
		case 
			classid == 'D27CDB6E-AE6D-11CF-96B8-444553540000' 
			||
			mimeType == 'application/x-shockwave-flash'
		:
			return new ActivateObjectFlash(domObject);

		default :
			return null;
	}
};
BackToTheHtml.uniqueID = function(prefix)
{
	var sPrefix;
	if(prefix == null)
		sPrefix = 'uniqueId';
	else
		sPrefix = prefix;
		
	var i=0;
	while(document.getElementById(sPrefix + (i++)))
		;
	return sPrefix + (i-1);
};
BackToTheHtml.isParentOf = function(parent,child)
{
	var found = false;
	for(var i=0; i<parent.childNodes.length; i++)
		if(parent.childNodes[i] == child)
			return true;
		else
			found = arguments.callee(parent.childNodes[i],child);

	return found;
}
/*****************************************************************************
* ActivateObject Command
*///**************************************************************************
function ActivateObject(domObject)
{
	this.domObject = domObject;
}

ActivateObject.prototype.domObject = null;
ActivateObject.prototype.classid = null;
ActivateObject.prototype.aHtmlAttribute = ['accessKey','align','alt','archive','border','code','codeBase','codeType','declare','dir','height','hideFocus','hspace','lang','language','name','standby','tabIndex','title','useMap','vspace','width'];
ActivateObject.prototype.aObjectProperty = null;

ActivateObject.prototype.execute = function()
{
	this.xndObjectId = BackToTheHtml.uniqueID();
	this.setTextHtml();
	this.writeObject();

	this.xndObject = document.getElementById(this.xndObjectId);
	this.setSpecialProperties();
	this.removeOriginalObject();
}

ActivateObject.prototype.setTextHtml = function()
{
	var str = '';
	str += '<object BackToTheHtml ' + '\n';
	str += ' classid="clsid:' + this.classid + '" ' + '\n';

	//Add HTML attributes to the <object> tag
	for(var i=0; i<this.aHtmlAttribute.length; i++)
	{
		var name = this.aHtmlAttribute[i];
		if(typeof this.domObject[name] != 'undefined' && this.domObject[name].toString() != '')
			str += '\t' + name + '="' + this.domObject[name].toString() + '" ' + '\n';
	}

	str += 'id="' + this.xndObjectId + '" ' + '\n';
	str += '>';

	for(var i=0; i<this.aObjectProperty.length; i++)
	{
		var name = this.aObjectProperty[i];
		if(typeof this.domObject[name] != 'undefined' && this.domObject[name].toString() != '' )
			str += '\t<param name="' + name + '" value="' + this.domObject[name].toString() + '"></param>' + '\n';
	}
	str += '</object>';

	this.textHtml = str;
};

ActivateObject.prototype.writeObject = function()
{
	this.domObject.insertAdjacentHTML("afterEnd",this.textHtml);
};

ActivateObject.prototype.setSpecialProperties = function()
{
	if(typeof this.domObject.className != 'undefined' && this.domObject.className.toString() != '')
		this.xndObject.className = this.domObject.className

	if(typeof this.domObject.style.cssText != 'undefined' && this.domObject.style.cssText.toString() != '')
		this.xndObject.style.cssText = this.domObject.style.cssText;

	if(typeof this.domObject.SWRemote != 'undefined' && this.domObject.SWRemote.toString() != '')
		this.xndObject.FlashVars = this.domObject.SWRemote;

	if(typeof this.domObject.codebase == 'undefined' || this.domObject.codebase.toString() == '')
		this.xndObject.codebase = 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,24,0';

	if(typeof this.domObject.id != 'undefined' && this.domObject.id.toString() != '')
		this.xndObject.id = this.domObject.id;

};

ActivateObject.prototype.removeOriginalObject = function()
{
	this.domObject.parentNode.removeChild(this.domObject);
};

/*****************************************************************************
* ActivateObjectFlash Command
*///**************************************************************************
function ActivateObjectFlash(domObject)
{
	ActivateObject.call(this,domObject);
}
ActivateObjectFlash.prototype = new ActivateObject;
ActivateObjectFlash.prototype.aObjectProperty = ['FrameNum','Playing','Quality','Quality2','Scalemode','Scale','AlignMode','SAlign','BackgroundColor','BGColor','Loop','Movie','WMode','Base','DeviceFont','EmbedMovie','SWRemote','FlashVars','AllowScriptAccess'];
ActivateObjectFlash.prototype.classid = 'D27CDB6E-AE6D-11CF-96B8-444553540000';
/*****************************************************************************
* Script initialisation
*///**************************************************************************
if(typeof ActiveXObject != 'undefined' && typeof Function.call != 'undefined')
{
	var styleId = BackToTheHtml.uniqueID();
	document.write('<style id="' + styleId + '" ></style>');
	var domStyle = document.getElementById(styleId);

	var isHead = false;
	var aHead = document.getElementsByTagName('head');
	for(var i=0; i<aHead.length; i++)
		if(BackToTheHtml.isParentOf(aHead[i],domStyle))
			isHead = true;

	if(isHead)
	{
		document.write('<style type="text/css">OBJECT{visibility:hidden;}</style>');
		document.onreadystatechange = function()
		{
			if(document.readyState == 'complete')
			{
				new BackToTheHtml().execute();
				document.styleSheets[document.styleSheets.length-1].addRule("OBJECT","visibility:visible;");
				//alert('head');
				//alert(document.body.innerHTML);
			}
		}
	}
	else
	{
		new BackToTheHtml().execute();
		//alert('body');
		//alert(document.body.innerHTML);
	}
	
	domStyle.parentNode.removeChild(domStyle);
}

function toggleBasket(idVal,img) 
{
  if(idVal == "start")//set all hide/show menu items to 'none' 
  {
	var allElements = new Array("hotels","bed"); 
	for (i = 0; i < allElements.length; i++)
	{
		ells = document.getElementById(allElements[i])
	 	ells.style.display = 'none'
	}	
  }
  if (document.getElementById(idVal))
  {
	var basket
    var img
    basket = document.getElementById(idVal)
    img = document.getElementById(img)
    if (basket.style.display == "none")
    {
      basket.style.display = 'inline'
      img.src =  '../img/homepage/red_arrow_down.gif'
    } 
	else 
	{
      
	   basket.style.display = 'none'
      img.src =  '../img/homepage/red_arrow.gif'
    }
  }
}
