/**
 * set params
 */
var swLiveConnect = true;
var loaded = 1;
var message = "Your browser can not work with ''swLiveConnect'' !";

function findFlash(flash){
    if (document.all) {
      if (document.all[flash]) {
        return document.all[flash];
      }

      if (window.opera) {
        var movie = eval(window.document + flash);
        if (movie.SetVariable) {
          return movie;
        }
      }
      return;
    }

    if(document.layers) {
      if(document.embeds) {
        var movie = document.embeds[flash];
        if (movie.SetVariable) {
          return movie;
        }
      }
      return;
    }

    if (!document.getElementById) {
      return;
    }

    var movie = document.getElementById(flash);

    if (movie.SetVariable) {
      return movie;
    }

    var movies = movie.getElementsByTagName('embed');

    if (!movies || !movies.length) {
      return;
    }

    movie = movies[0];

    if (movie.SetVariable) {
      return movie;
    }

    return;
}
////////////////////////////////////////////////////////
///     NOW THE INERESTING JAVASCRIPT FUNCTIONS      ///
////////////////////////////////////////////////////////
	/**
	 *	connect FlashMovie and send variables
	 */
	function ctrlFlash(eic, tso_eic, step){
	
		if(loaded == 1){
			var myMovie = findFlash('gie_map');
			if(myMovie == undefined){
				swLiveConnect = false;
			    alert(message);
			}
				
			// send variables or overwrite sended params
			if(swLiveConnect == true){
				/**
				 *	eiccode=
				 *	company=
				 *	tp_selection_mode=
				 *	tp_show_info_pane=false
				 *	tp_show_search_field=false
				 *	domain_name=http://www.gas-roads.integration.ecg-leipzig.de
				 */
				myMovie.SetVariable("eiccode", eic);
				myMovie.SetVariable("company", tso_eic);
				myMovie.SetVariable("tp_selection_mode", step);
			}
		}
	}

	/**
	 * 	selectPoint - get data from FlashMAP -> TP
	 *	
	 * 	eic-code 		= 21Z000000000004A
	 *	tso_eic-code	= 21X-AT-B-A0A0A-K
	 * 	type_ee			= Entry || Exit
	 * 	step			= Start || End || Point
	 */
	function selectPoint( eic_code, tso_eic_code, type_ee, step){
		
		try{
			alert("eic-code = "+ eic_code +" & tso_eic-code = "+ tso_eic_code +" & type_ee = " +type_ee +" & step = " +step);
		}catch(e){
			/* Error */
			alert(e);
		}
	}

	/**
	 * 	selectGridpoint_frame_flash - get data from TP -> FlashMAP
	 *	
	 * 	eic		 		= 21Z000000000004A
	 *	tso_eic			= 21X-AT-B-A0A0A-K
	 * 	step			= Start || End || Point
	 */
	function selectGridpoint_frame_flash(eic, tso_eic, step){				
		
		try{
			//flash call
			ctrlFlash(eic, tso_eic, step);
		}
		catch(e){
			/* Error */
			alert(e);
		}
	}




true
