/**
 * @alias lang.pack
 * @author Arweb <systems@arweb.com>
 * @since 2007.
 */

var lang = {
	
	Dictionary: {
		
		books: {
			'ES': {
				reservs: "Reservaciones",
				showReserv: "Ver Reservaci&oacute;n",
				code: "*C&oacute;digo:&nbsp;",
				show: "Ver",
				car: "*Veh&iacute;culo:&nbsp;",
				selectType: "Seleccionar Tipo",
				selectPickUp: "Seleccionar Salida",
				other: "Otro",
				selectDropOff: "Seleccionar Llegada",
				doOther: "Otro",
				pickUp: "*Salida:&nbsp;",
				dropOff: "*Llegada:&nbsp;",
				from: "*Desde:&nbsp;",
				to: "*Hasta:&nbsp;",
				rackRate: "*Precio:&nbsp;",
				rackRateDesc: "*Precio (US. Dollar (USD)): Incluye kilometraje ilimitado.",
				ticket: "Promo:&nbsp;",
				sSubmit: "Continuar",
				bEdit: "Modificar",
				bPrint: "Imprimir",
				bClose: "Cerrar",
				bCancel: "Cancelar",
				bDelete: "Cancelaci&oacute;n",
				cont: "Continuar",
				canc: "Cancelar",
				
				pleaseFillTheFieldsBelow: "Por favor escribe la informaci&oacute;n personal y de pago abajo:",//Has enviado la siguiente informaci&oacute;n de reservaci&oacute;n, para continuar, p
				personalInfo: "Informaci&oacute;n Personal",
				firstName: "*Nombre:&nbsp;",
				lastName: "*Apellidos:&nbsp;",
				eMail: "*E-mail:&nbsp;",
				country: "Pa&iacute;s:&nbsp;",
				city: "Ciudad:&nbsp;",
				phone: "Tel&eacute;fono:&nbsp;",
				fax: "Fax:&nbsp;",
				recvInfo: "Deseo recibir informaci&oacute;n y ofertas:&nbsp;",
				yes: "si",
				no: "no",
				recvInfoTitle: "Informaci&oacute;n de Reservaci&oacute;n",
				ins: "Seguros",
				perday: "Por d&iacute;a",
				perweek: "Por Semana",
				cdw: "Collision Damage Waiver (Da&ntilde;os por Accidente)",
				sli: "Supplemental Liability (Da&ntilde;os a Terceros)",
				vandalism: "Vandalism (Vandalismo)",
				total: "Total estimado de los cargos:&nbsp;",
				totalIns: "Total de Seguros",
				totalOpt: "Total de Opcionales",
				additionalInfo: "Informaci&oacute;n Adicional:",
				optionals: "Opcionales",
				arrivalAirline: "Aerol&iacute;nea de llegada:&nbsp;",
				comments: "Comentarios:&nbsp;",
				hotelLeyend: "Si seleccionas un hotel en el area metropolitana de San Jos&eacute; como tu punto de llegada o partida, por favor especifica tu hotel en el campo de comentarios.",
				paymentInfo: "Informaci&oacute;n de Pago",
				cardType: "*Tipo de Tarjeta:&nbsp;",
				cardName: "*Nombre en la tarjeta:&nbsp;",
				cardNumber: "*N&uacute;mero de Tarjeta:&nbsp;",
				expDate: "*Fecha de Expiraci&oacute;n:&nbsp;",
				
				pleaseReviewYourReserv: "Por Favor revisa tu reservaci&oacute;n, si ves alg&uacute;n error, ve atras en tu explorador y corrijelo. Si la informaci&oacute;n es correcta, presiona el boton de abajo &quot;Enviar&quot;.",
				reservNum: "N&uacute;mero de Reservaci&oacute;n:&nbsp;",
				enterReservNum: "S&iacute; has reservado un veh&iacute;culo con nosotros, digita tu n&uacute;mero de reservaci&oacute;n:&nbsp;",
				prnt: "Imprimir",
				send: "Enviar",
				
				model: "Moldelo:&nbsp;",
				year: "A&ntilde;o:&nbsp;",
				passingers: "Ocupantes:&nbsp;",
				luggage: "Equipaje:&nbsp;",
				transmission: "Transmisi&oacute;n:&nbsp;",
				air: "Aire:&nbsp;",
				
				success: "Exito",
				bck: "Finalizar",
				finish: "Su reserva se ha completado con &eacute;xito, una copia de esta reserva ser&aacute;<br /> enviado a su direcci&oacute;n de correo electr&oacute;nico, gracias por elegir nuestros servicios.",
				
				reservDetails: "Detalles de Reservaci&oacute;n",
				id: "Id",
				del: "Eliminar",
				
				selectCar: "Seleccione un veh&iacute;culo por favor!",
				userLogin: "",
				promoCode: "C&oacute;digo de Promo:",
				reservNum: "N&uacute;mero de Reservaci&oacute;n:",
				
				fillTheBoxWValidCode: "Por favor, rellena el campo con un c\xF3digo v\xE1lido!",
				fillTheBoxMarked: "Por favor, rellena los campos marcados con un *!",
				ErrorWCardNumber: "Error, el n\xFAmero de tarjeta de cr\xE9dito es inv\xE1lido!",
				ErrorEditingReserv: "Error, el n\xFAmero de reservaci\xF3n es inv\xE1lido!",
				ErrorDeletingReserv: "Error, el tiempo de eliminaci\xF3n ha caducado o ella ya fue eliminada!",
				ConfirmDelete: "Esta seguro de que desea eliminar el item?",
				SelectItem: "Selecciona alg\xFAn \xEDtem!"
			},
			
			'EN': {
				reservs: "Reservations",
				showReserv: "Show Reservation",
				code: "*Code:&nbsp;",
				show: "Show",
				car: "*Car:&nbsp;",
				selectType: "Select Type",
				selectPickUp: "Select Pick up",
				other: "Other",
				selectDropOff: "Select Drop off",
				doOther: "Other",
				pickUp: "*Pick up:&nbsp;",
				dropOff: "*Drop off:&nbsp;",
				from: "*From:&nbsp;",
				to: "*To:&nbsp;",
				rackRate: "*Total Base Rate:&nbsp;",
				rackRateDesc: "*Total Base Rate (US. Dollar (USD)): Includes unlimited mileage.",
				ticket: "Ticket:&nbsp;",
				sSubmit: "Continue",
				bEdit: "Modify",
				bPrint: "Print",
				bClose: "Close",
				bCancel: "Cancel",
				bDelete: "Cancelation",
				cont: "Continue",
				canc: "Cancel",
				
				pleaseFillTheFieldsBelow: "Please fill in the Personal Information and Payment Information sections below:",//Your submitted the following information for your reservation, to continue, p
				personalInfo: "Personal Info",
				firstName: "*First Name:&nbsp;",
				lastName: "*Last Name:&nbsp;",
				eMail: "*E-mail:&nbsp;",
				country: "Country:&nbsp;",
				city: "City:&nbsp;",
				phone: "Phone:&nbsp;",
				fax: "Fax:&nbsp;",
				recvInfo: "I want to receive info and offers:&nbsp;",
				yes: "yes",
				no: "no",
				recvInfoTitle: "Reservation Information",
				ins: "Insurance",
				perday: "Per Day",
				perweek: "Per week",
				cdw: "(Collision Damage Waiver (Da&ntilde;os por Accidente)",
				sli: "Supplemental Liability (Da&ntilde;os a Terceros)",
				vandalism: "Vandalism (Vandalismo)",
				total: "Total estimated charges:&nbsp;",
				totalIns: "Total Insurance",
				totalOpt: "Total Optionals",
				additionalInfo: "Additional Info:",
				optionals: "Optionals",
				arrivalAirline: "Arrival Airline:&nbsp;",
				comments: "Comments:&nbsp;",
				hotelLeyend: "If you selected \"Hotel in the San Jos&eacute; Metropolitan Area\" as your pick up or drop off location, please specify your Hotel in the comments box.",
				paymentInfo: "Payment Info",
				cardType: "*Card Type:&nbsp;",
				cardName: "*Name on Card:&nbsp;",
				cardNumber: "*Card Number:&nbsp;",
				expDate: "*Expiration Date:&nbsp;",
				
				pleaseReviewYourReserv: "Please review your reservation, if you see an error, click on reservations to create a new one. If the information is correct, please press the &quot;Send Reservation&quot; button below.",
				reservNum: "Reservation Number:&nbsp;",
				enterReservNum: "If you have already reserved a vehicle with us, enter your reservation number:&nbsp;",
				prnt: "Print",
				send: "Send",
				
				model: "Moldel:&nbsp;",
				year: "Year:&nbsp;",
				passingers: "Passengers:&nbsp;",
				luggage: "Luggage:&nbsp;",
				transmission: "Transmission:&nbsp;",
				air: "Air:&nbsp;",
				
				success: "Success",
				bck: "Finish",
				finish: "Your reservation has been completed successfully, a copy of this reservation will be sent<br /> to your e-mail address, thank you for choosing our services.",
				
				reservDetails: "Reservation Number",
				id: "Id",
				del: "Delete",
				
				selectCar: "Please select car!",
				userLogin: "",
				promoCode: "Promo Code:",
				reservNum: "Reservation Number:",
				
				fillTheBoxWValidCode: "Please, fill the box with a valid code!",
				fillTheBoxMarked: "Please, fill the box marked with an *!",
				ErrorWCardNumber: "Error, the number of the credit card is invalid!",
				ErrorEditingReserv: "Error, the reservation number is not valid!",
				ErrorDeletingReserv: "Error, the time of deleting has expired or this not exist!",
				ConfirmDelete: "Really, do you want to cancel this reservation?",
				SelectItem: "Select any item!"
			}
		}
		
	},
	
	Translator: function() {
		
		this.base = new Cookie("lang");
		var expdate = new Date();
		expdate.setFullYear(expdate.getFullYear()+1);
		
		var domain = null;
		var args = arguments[0];
		if (args) {
			domain = args.domain ? args.domain : domain;
		}
		
		var language = "EN";
		if (this.base.load()) {
			language = this.base.value;
		}
		this.base.value = language;
		this.base.deathdate = expdate;
		this.base.domain = domain;
		this.base.path = "/";
		this.base.save();
		
		this.toEng = function () {
			this.base.value = "EN";
			this.base.save();
			this.setLang("EN");
			
			var i;
			var j = window.frames.length;
			for (i=0; i<j; i++) {
				try {
					window.frames[i].translator.toEng();
				} catch (e) {
					//alert(e.toString() + "[" + i.toString() + "]");
					//window.frames[i].location.reload(true);
				}
			}
		};
		
		this.toSpa = function () {
			this.base.value = "ES";
			this.base.save();
			this.setLang("ES");
			
			var i;
			var j = window.frames.length;
			for (i=0; i<j; i++) {
				try {
					window.frames[i].translator.toSpa();
				} catch (e) {
					//window.frames[i].location.reload(true);
				}
			}
		};
		
		this.setLang = function (language) {
			var element;
			var keyword;
			var index;
			for (keyword in lang.Dictionary.books[language]) {
				element = document.getElementsByName(keyword);
				if (element.length == 0) {
					element = new Array();
					element.push(document.getElementById(keyword));
				}
				for (index in element) {
					if (element[index] != null) {
						//element.getAttribute("value") != null
						if (element[index].innerHTML == "") {
							element[index].value = lang.Dictionary.books[language][keyword];
						} else {
							element[index].innerHTML = lang.Dictionary.books[language][keyword];
						}
					}
				}
			}
		};
		
		this.getLang = function () {
			return this.base.value;
		};
		
		this.setLang(language);
		
	}
	
};
