// ### dom funktion
function $(id){    
    return document.getElementById(id) || null;
}
// ### funktion init
function initFts() {
    if (typeof(displayTheForm) != 'undefined'){
        displayTheForm();
    }
    else{
        window.setTimeout("initFts()",50);
    }
}
// ### Basic Params setzen
if(typeof(ttFtsInit) != 'undefined') {    
    var ttFtsHost = typeof(ttFtsInit[0])!='undefined'?ttFtsInit[0]:"http://www2.vidado.com/";
    var ttFtsServer = typeof(ttFtsInit[1])!='undefined'?ttFtsInit[1]:"http://www2.vidado.com/";
    var ttFtsCustomer = typeof(ttFtsInit[2])!='undefined'?ttFtsInit[2]:"";
    var ttFtsDisplay = typeof(ttFtsInit[3])!='undefined'?ttFtsServer+'booking/ftsStandalone/'+ttFtsInit[3]:ttFtsServer+'booking/ftsStandalone/ttFts_basic.js';
    var ttFtsStyles = typeof(ttFtsInit[4])!='undefined'?ttFtsInit[4]:ttFtsHost+'kunden_parameter/'+ttFtsCustomer+'/ftsStandalone/css/styleFts.css';
    var ttFtsAction = typeof(ttFtsInit[5])!='undefined' && ttFtsInit[5]!=''?ttFtsInit[5]:window.location.href;    
    var ttFtsTarget = typeof(ttFtsInit[6])!='undefined' && ttFtsInit[6]!=''?ttFtsInit[6]:"_self";
    var ttFtsMethod = typeof(ttFtsInit[7])!='undefined' && ttFtsInit[7]!=''?ttFtsInit[7]:"POST";
    var ttFtsHeader = typeof(ttFtsInit[8])!='undefined' && ttFtsInit[8]!=''?ttFtsInit[8]:"";
    var ttFtsValue = typeof(ttFtsInit[9])!='undefined' && ttFtsInit[9]!=''?ttFtsInit[9]:"";
    var ttFtsParams = typeof(ttFtsInit[10])!='undefined' && ttFtsInit[10]!=''?ttFtsInit[10]:"";
    var ttFtsSubmit = typeof(ttFtsInit[11])!='undefined' && ttFtsInit[11]!=''?ttFtsInit[11]:'<input name="ftsSubmit" id="ftsSubmit" type="image" class="ttFts_elemSubmit" src="'+ttFtsHost+'kunden_parameter/'+ttFtsCustomer+'/ftsStandalone/images/suche.gif" alt="Suche" title="Suche" border="0">';
    if(ttFtsParams != '') {
        if(ttFtsAction.indexOf('?') < 0 && ttFtsParams.indexOf('?') < 0) {
            ttFtsAction+= '?';    
        }
        ttFtsAction+= ttFtsParams;
    }
    // --- Ausgabe    
    if(ttFtsCustomer != '') {            
        //Styles
        document.write('<link rel="stylesheet" type="text/css" href="'+ttFtsStyles+'" media="all">');
        //Ausgabe-JS
        document.write('<script type="text/javascript" src="'+ttFtsDisplay+'"></script>');
        //JS: Formular-Check
        document.write('<script language="JavaScript">');
        document.write('function chFTSinp() {');
        document.write('var of=document.forms["ftsSmall"];');
        document.write('var val = of.ftsSearchSimple.value;');
        document.write('val = String(val);');
        if(ttFtsValue != '') {
            document.write('if ( val.length < 3 || val=="'+ttFtsValue+'" || val=="") {');    
        } else {
            document.write('if ( val.length < 3 || val=="") {');    
        }        
        document.write('alert("Bitte geben Sie einen Suchbegriff mit mind. 3 Buchstaben ein!");');
        document.write('of.ftsSearchSimple.focus();');
        document.write('return false;');
        document.write('}');
        document.write('}');
        document.write('</script>');
        //Formular-Div
        var boxHTML = '';
        boxHTML+= ('<div id="ttFts_main">'); 
        boxHTML+= ('<form name="ftsSmall" id="ftsSmall" action="'+ttFtsAction+'" target="'+ttFtsTarget+'" method="'+ttFtsMethod+'" onSubmit="return chFTSinp();">');
        boxHTML+= ('<div id="ttFts_content"></div>');
        boxHTML+= ('</form>');
        boxHTML+= ('</div>');
        document.write(boxHTML);
        initFts();            
    } else {
        document.write('<div id="ttFts_main">Kundenordner ist nicht definiert!</div>');    
    }
} else {
    document.write('<div id="ttFts_main">ttFtsInit ist nicht definiert!</div>');    
}