// JavaScript Document

//ToDOs!
// middleBox --> if IE 6 margin-left:10px

function pageLoad(sender, e)
{
	/*alert(navigator.appName);
	if(navigator.appName == "MSIE");
	{
		alert("true");
	}*/
}


function jsTopNaviHover(currentObject)
{
	var imageBasePath = "/App_Themes/LotusTravelsStyleSheet/Images/";

	// Top-Navi
	if(currentObject.id == "imgTopNaviStartseite")
		currentObject.src = imageBasePath + "topicon_startseite_hover.gif";
	if(currentObject.id == "imgTopNaviImpressum")
		currentObject.src = imageBasePath + "topicon_impressum_hover.gif";
	if(currentObject.id == "imgTopNaviKontakt")
		currentObject.src = imageBasePath + "topicon_kontakt_hover.gif";
		
	// Main-Navi
	if(currentObject.id == "imgMainNaviStartseite")
		currentObject.src = imageBasePath + "txt_startseite_hover.gif";
	if(currentObject.id == "imgMainNaviAngebote")
		currentObject.src = imageBasePath + "txt_angebote_hover.gif";
	if(currentObject.id == "imgMainNaviTourPackage")
		currentObject.src = imageBasePath + "txt_tour_package_hover.gif";
	if(currentObject.id == "imgMainNaviReiseversicherung")
		currentObject.src = imageBasePath + "txt_reiseversicherung_hover.gif";
	if(currentObject.id == "imgMainNaviUeberUns")
		currentObject.src = imageBasePath + "txt_ueber_uns_hover.gif";
}

function jsTopNaviNormal(currentObject)
{
	var imageBasePath = "/App_Themes/LotusTravelsStyleSheet/Images/";

	// Top-Navi
	if(currentObject.id == "imgTopNaviStartseite")
		currentObject.src = imageBasePath + "topicon_startseite.gif";
	if(currentObject.id == "imgTopNaviImpressum")
		currentObject.src = imageBasePath + "topicon_impressum.gif";
	if(currentObject.id == "imgTopNaviKontakt")
		currentObject.src = imageBasePath + "topicon_kontakt.gif";
	
	// Main-Navi
	if(currentObject.id == "imgMainNaviStartseite")
		currentObject.src = imageBasePath + "txt_startseite.gif";
	if(currentObject.id == "imgMainNaviAngebote")
		currentObject.src = imageBasePath + "txt_angebote.gif";
	if(currentObject.id == "imgMainNaviTourPackage")
		currentObject.src = imageBasePath + "txt_tour_package.gif";
	if(currentObject.id == "imgMainNaviReiseversicherung")
		currentObject.src = imageBasePath + "txt_reiseversicherung.gif";
	if(currentObject.id == "imgMainNaviUeberUns")
		currentObject.src = imageBasePath + "txt_ueber_uns.gif";
}

function jsChangeImage (imgObject, newImgSrc)
{
	imgObject.src = newImgSrc;
}

function jsLoadImageGallery()
{
}

function ManageHiddenElement(ddlValue, associatedElement)
{
    if (ddlValue == 'Other') 
    { 
        document.getElementById(associatedElement).className = 'visible'; 
    }
    else 
    {
        document.getElementById(associatedElement).className = 'hidden'; 
    }
}

function ValidateForm(controlsToValidate, errorPanel)
{
	validatedControls = new Boolean();
	controlsValidationStatus = new Array();
	
	for (var i = 0; i < controlsToValidate.length; i++)
	{
		controlsValidationStatus.push(false);
		
		if (controlsToValidate[i].value != '')
		{
			controlsToValidate[i].className = "fieldValidationSuccess";
			controlsValidationStatus[i] = true;
		}
		else
		{
			controlsToValidate[i].className = "fieldValidationFailed";
			controlsValidationStatus[i] = false;
		}
		
		validatedControls = validatedControls + controlsValidationStatus[i];
	}
	
	if (validatedControls == controlsToValidate.length)
	{
		return true;
	}
	else
	{
		document.getElementById(errorPanel).style.display = "block";
		return false;
	}
}