
function openFlashMap(){
	window.open("map/flash-map.html", "flash", "scrollbars=0, width=700, height=520");
}
var tblContentWidth = 777;
var addPadding = 0;

function showWidth(){
	addPadding = 0;
	if (navigator.appName == "Microsoft Internet Explorer"){
		if (document.body.scrollWidth > tblContentWidth){
			addPadding = Math.round ( (document.body.scrollWidth - tblContentWidth) / 2);
		}
	}else{
		if ( document.width > (tblContentWidth + 15) ){
			addPadding = Math.round ( (document.body.scrollWidth - tblContentWidth) / 2);
		}
	}
}
function showMenu(spanName, curentPadding){

	showWidth();
	var curentSpan = window.document.getElementById(spanName);

	if ( (window.document.getElementById("subMenu").style.visibility == 'visible') || (window.document.getElementById("subMenu1").style.visibility == 'visible') || (window.document.getElementById("subMenu2").style.visibility == 'visible') || (window.document.getElementById("subMenu3").style.visibility == 'visible')){
		hideMenu("menu1");
		hideMenu("menu2");
	}

	curentSpan.style.left = 0;

	curentSpan.style.left = parseInt(addPadding) + parseInt(curentPadding) + "px";

	curentSpan.style.visibility = 'visible';
	if (curentSpan.id == "subMenu"){
		document.getElementById("airportExpansion").src = "img/buttons/btn_airport_expansion_active.gif";
	}else if (curentSpan.id == "subMenu1"){
		document.getElementById("groundTransport").src = "img/buttons/btn_ground_transport_active.gif";
	}else if (curentSpan.id == "subMenu2"){
		document.getElementById("airlineInfo").src = "img/buttons/btn_airline_info_active.gif";
	}else if (curentSpan.id == "subMenu3"){
		document.getElementById("aboutWrwa").src = "img/buttons/btn_about_wrwa_active.gif";
	}

}




function hideMenu(spanName){
	if (window.document.getElementById("subMenu")){
    	window.document.getElementById("subMenu").style.visibility = 'hidden';
    }
	if (window.document.getElementById("subMenu1")){
		window.document.getElementById("subMenu1").style.visibility = 'hidden';
    }
	if (window.document.getElementById("subMenu2")){
		window.document.getElementById("subMenu2").style.visibility = 'hidden';
    }
	if (window.document.getElementById("subMenu3")){
		window.document.getElementById("subMenu3").style.visibility = 'hidden';
    }

//	if (spanName == "subMenu"){
		document.getElementById("airportExpansion").src = "img/buttons/btn_airport_expansion.gif";

//	}else{
		document.getElementById("groundTransport").src = "img/buttons/btn_ground_transport.gif";
//	}
		document.getElementById("airlineInfo").src = "img/buttons/btn_airline_info.gif";
		document.getElementById("aboutWrwa").src = "img/buttons/btn_about_wrwa.gif";

}

var imgArrayActive = new Array();

imgArrayActive[0] = new Image(67,19);
imgArrayActive[0].src = "img/buttons/btn_home_active.gif";

imgArrayActive[1] = new Image(102,19);
imgArrayActive[1].src = "img/buttons/btn_airport_guide_active.gif";

imgArrayActive[2] = new Image(91,19);
imgArrayActive[2].src = "img/buttons/btn_airline_info_active.gif";

imgArrayActive[3] = new Image(134,19);
imgArrayActive[3].src = "img/buttons/btn_ground_transport_active.gif";

imgArrayActive[4] = new Image(106,19);
imgArrayActive[4].src = "img/buttons/btn_about_wrwa_active.gif";

var imgArray = new Array();

imgArray[0] = new Image(67,19);
imgArray[0].src = "img/buttons/btn_home.gif";

imgArray[1] = new Image(102,19);
imgArray[1].src = "img/buttons/btn_airport_guide.gif";

imgArray[2] = new Image(91,19);
imgArray[2].src = "img/buttons/btn_airline_info.gif";

imgArray[3] = new Image(134,19);
imgArray[3].src = "img/buttons/btn_ground_transport.gif";

imgArray[4] = new Image(106,19);
imgArray[4].src = "img/buttons/btn_about_wrwa.gif";

function changeLinkBg(bgImage, number){
	bgImage.src = imgArray[number].src;
}

function changeLinkBgActive(bgImage, number){
	bgImage.src = imgArrayActive[number].src;
}

var subMenuArray = new Array();

subMenuArray[0] = new Image(88,9);
subMenuArray[0].src = "img/txt_s_menu_expension.gif";

subMenuArray[1] = new Image(73,8);
subMenuArray[1].src = "img/txt_s_menu_current.gif";

subMenuArray[2] = new Image(71,8);
subMenuArray[2].src = "img/txt_s_menu_archived.gif";

subMenuArray[3] = new Image(40,8);
subMenuArray[3].src = "img/txt_s_menu_fun_facts.gif";

subMenuArray[4] = new Image(80,9);
subMenuArray[4].src = "img/txt_s_menu_services.gif";

subMenuArray[5] = new Image(50,7);
subMenuArray[5].src = "img/txt_s_menu_r_cars.gif";

subMenuArray[6] = new Image(83,10);
subMenuArray[6].src = "img/txt_s_menu_parking.gif";

subMenuArray[7] = new Image(77,9);
subMenuArray[7].src = "img/txt_s_menu_d_directions.gif";

subMenuArray[8] = new Image();
subMenuArray[8].src = "img/txt_s_menu_flight.gif";

subMenuArray[9] = new Image();
subMenuArray[9].src = "img/txt_s_menu_shipping.gif";

subMenuArray[10] = new Image();
subMenuArray[10].src = "img/txt_s_menu_airlines.gif";

subMenuArray[11] = new Image();
subMenuArray[11].src = "img/txt_s_dept.gif";

subMenuArray[12] = new Image();
subMenuArray[12].src = "img/txt_s_will_rogers.gif";

subMenuArray[13] = new Image();
subMenuArray[13].src = "img/txt_s_business.gif";

subMenuArray[14] = new Image();
subMenuArray[14].src = "img/txt_s_media.gif";

subMenuArray[15] = new Image();
subMenuArray[15].src = "img/txt_s_links.gif";

subMenuArray[16] = new Image();
subMenuArray[16].src = "img/txt_s_job.gif";

subMenuArray[17] = new Image();
subMenuArray[17].src = "img/txt_s_faq.gif";

subMenuArray[18] = new Image();
subMenuArray[18].src = "img/txt_s_contact.gif";

subMenuArray[19] = new Image();
subMenuArray[19].src = "img/txt_s_statistic.gif";

subMenuArray[20] = new Image();
subMenuArray[20].src = "img/txt_s_reports.gif";

subMenuArray[21] = new Image(40,7);
subMenuArray[21].src = "img/txt_s_pilotinfo.gif";

subMenuArray[22] = new Image();
subMenuArray[22].src = "img/txt_s_the_vision.gif";

subMenuArray[23] = new Image();
subMenuArray[23].src = "img/txt_s_features.gif";

subMenuArray[24] = new Image();
subMenuArray[24].src = "img/txt_s_financing.gif";

subMenuArray[25] = new Image();
subMenuArray[25].src = "img/txt_s_economic_benefits.gif";

subMenuArray[26] = new Image();
subMenuArray[26].src = "img/txt_s_fun_facts.gif";

subMenuArray[27] = new Image();
subMenuArray[27].src = "img/txt_s_photos.gif";

var subMenuArrayActive = new Array();

subMenuArrayActive[0] = new Image(88,9);
subMenuArrayActive[0].src = "img/txt_s_menu_expension_active.gif";

subMenuArrayActive[1] = new Image(73,8);
subMenuArrayActive[1].src = "img/txt_s_menu_current_active.gif";

subMenuArrayActive[2] = new Image(71,8);
subMenuArrayActive[2].src = "img/txt_s_menu_archived_active.gif";

subMenuArrayActive[3] = new Image(40,8);
subMenuArrayActive[3].src = "img/txt_s_menu_fun_facts_active.gif";

subMenuArrayActive[4] = new Image(80,9);
subMenuArrayActive[4].src = "img/txt_s_menu_services_active.gif";

subMenuArrayActive[5] = new Image(50,7);
subMenuArrayActive[5].src = "img/txt_s_menu_r_cars_active.gif";

subMenuArrayActive[6] = new Image(83,10);
subMenuArrayActive[6].src = "img/txt_s_menu_parking_active.gif";

subMenuArrayActive[7] = new Image(77,9);
subMenuArrayActive[7].src = "img/txt_s_menu_d_directions_active.gif";

subMenuArrayActive[8] = new Image();
subMenuArrayActive[8].src = "img/txt_s_menu_flight_active.gif";

subMenuArrayActive[9] = new Image();
subMenuArrayActive[9].src = "img/txt_s_menu_shipping_active.gif";

subMenuArrayActive[10] = new Image();
subMenuArrayActive[10].src = "img/txt_s_menu_airlines_active.gif";

subMenuArrayActive[11] = new Image();
subMenuArrayActive[11].src = "img/txt_s_dept_act.gif";

subMenuArrayActive[12] = new Image();
subMenuArrayActive[12].src = "img/txt_s_will_rogers_act.gif";

subMenuArrayActive[13] = new Image();
subMenuArrayActive[13].src = "img/txt_s_business_act.gif";

subMenuArrayActive[14] = new Image();
subMenuArrayActive[14].src = "img/txt_s_media_act.gif";

subMenuArrayActive[15] = new Image();
subMenuArrayActive[15].src = "img/txt_s_links_act.gif";

subMenuArrayActive[16] = new Image();
subMenuArrayActive[16].src = "img/txt_s_job_act.gif";

subMenuArrayActive[17] = new Image();
subMenuArrayActive[17].src = "img/txt_s_faq_act.gif";

subMenuArrayActive[18] = new Image();
subMenuArrayActive[18].src = "img/txt_s_contact_act.gif";

subMenuArrayActive[19] = new Image();
subMenuArrayActive[19].src = "img/txt_s_statistic_act.gif";

subMenuArrayActive[20] = new Image();
subMenuArrayActive[20].src = "img/txt_s_reports_active.gif";

subMenuArrayActive[21] = new Image(40,7);
subMenuArrayActive[21].src = "img/txt_s_pilotinfo_act.gif";

subMenuArrayActive[22] = new Image();
subMenuArrayActive[22].src = "img/txt_s_the_vision_act.gif";

subMenuArrayActive[23] = new Image();
subMenuArrayActive[23].src = "img/txt_s_features_act.gif";

subMenuArrayActive[24] = new Image();
subMenuArrayActive[24].src = "img/txt_s_financing_act.gif";

subMenuArrayActive[25] = new Image();
subMenuArrayActive[25].src = "img/txt_s_economic_benefits_act.gif";

subMenuArrayActive[26] = new Image();
subMenuArrayActive[26].src = "img/txt_s_fun_facts_act.gif";

subMenuArrayActive[27] = new Image();
subMenuArrayActive[27].src = "img/txt_s_photos_act.gif";

function punktActive(curentPunkt, number){
	curentPunkt.src =  subMenuArrayActive[number].src;
}

function punktPassive(curentPunkt, number){
	curentPunkt.src =  subMenuArray[number].src;
}

function scrollBetweenImages(array, cnt, direction){
//    window.alert("before "+current);
	if (direction=="+"){
    	cnt++;
        if (cnt<array.length-2){
			document.gal0.src = "img/gallery/medium/"+array[cnt][0];
			document.gal0.alt = array[cnt][1];
			document.gal1.src = "img/gallery/medium/"+array[cnt+1][0];
			document.gal1.alt = array[cnt+1][1];
			document.gal2.src = "img/gallery/medium/"+array[cnt+2][0];
			document.gal2.alt = array[cnt+2][1];
            current = cnt;
        }
    }else{
    	cnt--;
        if (cnt>=0){
			document.gal0.src = "img/gallery/medium/"+array[cnt][0];
			document.gal0.alt = array[cnt][1];
			document.gal1.src = "img/gallery/medium/"+array[cnt+1][0];
			document.gal1.alt = array[cnt+1][1];
			document.gal2.src = "img/gallery/medium/"+array[cnt+2][0];
			document.gal2.alt = array[cnt+2][1];
            current = cnt;
        }
    }
    if (cnt>0 && cnt<array.length-3){
       document.btn_right.style.cursor="hand";
       document.btn_left.style.cursor="hand";
    }
    if (cnt==0){
       document.btn_right.style.cursor="default";
       document.btn_left.style.cursor="hand";
    }
    if (cnt==array.length-3){
       document.btn_right.style.cursor="hand";
       document.btn_left.style.cursor="default";
    }
//    window.alert("after "+current);
}

function getId(array,pic){
	var ret=0;
    for (var i=0; i<array.length; i++){
    	if (array[i][0] == pic){
        	ret = i;
        }
    }
    var url="expansion.php?etype=current&start="+ret;
	window.location=url;
}

function scrollImages(array, cnt, direction){	
	if (direction=="+"){
        if (cnt<array.length-5){
           	cnt++;
			document.gal0.src = "img/gallery/small/"+array[cnt][0];
			document.gal0.alt = array[cnt][1];
            if (cnt+1>array.length-1){
				document.gal1.src = "img/gallery/blank.jpg";
    		}else{
	            document.gal1.src = "img/gallery/small/"+array[cnt+1][0];
	            document.gal1.alt = array[cnt+1][1];
            }
            if (cnt+2>array.length-1){
				document.gal2.src = "img/gallery/blank.jpg";
    		}else{
	            document.gal2.src = "img/gallery/small/"+array[cnt+2][0];
	            document.gal2.alt = array[cnt+2][1];
            }
            if (cnt+3>array.length-1){
				document.gal3.src = "img/gallery/blank.jpg";
    		}else{
	            document.gal3.src = "img/gallery/small/"+array[cnt+3][0];
	            document.gal3.alt = array[cnt+3][1];
            }
            if (cnt+4>array.length-1){
				document.gal4.src = "img/gallery/blank.jpg";
    		}else{
	            document.gal4.src = "img/gallery/small/"+array[cnt+4][0];
	            document.gal4.alt = array[cnt+4][1];
            }
//			document.mainPic.src = "img/gallery/large/"+array[cnt][0];
//			document.mainPic.alt = array[cnt][1];
//            document.getElementById("mainTitle").innerHTML = array[cnt][1];
            current = cnt;
        }
    }else{
        if (cnt>0){
	    	cnt--;
			document.gal0.src = "img/gallery/small/"+array[cnt][0];
			document.gal0.alt = array[cnt][1];
            if (cnt+1>array.length-1){
				document.gal1.src = "img/gallery/small/blank.jpg";
    		}else{
	            document.gal1.src = "img/gallery/small/"+array[cnt+1][0];
	            document.gal1.alt = array[cnt+1][1];
            }
            if (cnt+2>array.length-1){
				document.gal2.src = "img/gallery/small/blank.jpg";
    		}else{
	            document.gal2.src = "img/gallery/small/"+array[cnt+2][0];
	            document.gal2.alt = array[cnt+2][1];
            }
            if (cnt+3>array.length-1){
				document.gal3.src = "img/gallery/small/blank.jpg";
    		}else{
	            document.gal3.src = "img/gallery/small/"+array[cnt+3][0];
	            document.gal3.alt = array[cnt+3][1];
            }
            if (cnt+4>array.length-1){
				document.gal4.src = "img/gallery/small/blank.jpg";
    		}else{
	            document.gal4.src = "img/gallery/small/"+array[cnt+4][0];
	            document.gal4.alt = array[cnt+4][1];
            }
//			document.mainPic.src = "img/gallery/large/"+array[cnt][0];
//			document.mainPic.alt = array[cnt][1];
//            document.getElementById("mainTitle").innerHTML = array[cnt][1];
            current = cnt;
        }
    }
    if (cnt>0 && cnt<array.length-1){
       document.btn_right_small.style.cursor="hand";
       document.btn_left_small.style.cursor="hand";
//       document.btn_right.style.cursor="hand";
//       document.btn_left.style.cursor="hand";
    }
    if (cnt==0){
       document.btn_right_small.style.cursor="default";
       document.btn_left_small.style.cursor="hand";
//       document.btn_right.style.cursor="default";
//       document.btn_left.style.cursor="hand";
    }
    if (cnt==array.length-5){
       document.btn_right_small.style.cursor="hand";
       document.btn_left_small.style.cursor="default";
//       document.btn_right.style.cursor="hand";
//       document.btn_left.style.cursor="default";
    }
//    window.alert("after "+current);
}

function showLargePicture(pic_name,alt){
	if (pic_name.indexOf("blank.jpg") >= 0){
    	return;
    }
    newLink = pic_name.substring(0,pic_name.indexOf("small"))+"large/"+pic_name.substring(pic_name.indexOf("small/")+6);
	document.mainPic.src = newLink;
	document.mainPic.alt = alt;
    document.getElementById("mainTitle").innerHTML = alt;
}


var imgArrayPoint = new Array()
imgArrayPoint[0] = new Image(4,4);
imgArrayPoint[0].src = "img/pic_punkt_left_menu1.gif";

var imgArrayPointAct = new Array()
imgArrayPointAct[0] = new Image(4,4);
imgArrayPointAct[0].src = "img/pic_punkt_left_menu_act1.gif";

function leftMenuActive(number){
//	document.images["points" + number].src = imgArrayPointAct[0].src;
}

function leftMenuPassive(number){
//	document.images["points" + number].src = imgArrayPoint[0].src
}

function createPopUpWindow(pic_name, pic_title){
	if (pic_name.indexOf("blank.jpg") >= 0){
    	return;
    }
	var newLink = pic_name;
    if (pic_name.indexOf("/medium/") >= 0){
    	newLink = pic_name.substring(0,pic_name.indexOf("medium"))+"large/"+pic_name.substring(pic_name.indexOf("medium/")+7);
    }
    if (pic_name.indexOf("/small/") >= 0){
    	newLink = pic_name.substring(0,pic_name.indexOf("small"))+"large/"+pic_name.substring(pic_name.indexOf("small/")+6);
    }
	var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=350,height=300,left=0,top=0';
	var tabWindow = window.open('', '_blank', styleStr);
	tabWindow.document.write('<html><head><title>Gallery</title><link href="../style/style.css" rel="stylesheet" type="text/css"></head>');
	tabWindow.document.write('<body style="background-image:none"><center><span class="cssTxtHeadRedBig">'+pic_title+'</span><br><br><img src="'+newLink+'">');
	tabWindow.document.write('<br><br><div align="center"><a href="javascript:window.close()" class="SubMenu">Close</a></div></body></html>');
}

function CreateWindow(url) {
	var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=400,height=400,left=10,top=10,screenX=10,screenY=10';
	var tabWindow = window.open(url, '_blank', styleStr);
	tabWindow.location.href = url;
}

function validate(current_form){
	var forbibben = new Array('<','>','script');
	for (var counter=0; counter < current_form.length; counter++){
		for (var i=0; i<forbibben.length; i++){
        	if (current_form[counter].value.indexOf(forbibben[i])!=-1){
            	return false;
            }
        }
    }
    return true;
}