
var e_id 			= ''; 
var color			= 'fff';
var focus_status 	= 'off';

function set_focus_status(status){
	focus_status = status;
}

function check_focus_status(){
	if (focus_status == 'off'){
		return true;
	}else{
		return false;	
	}
}

function checkKeys (evt) {
	if(document.getElementById('suchen_fx')){
		var this_one = document.getElementById('suchen_fx');
		if(this_one.value != ''){
			if (!evt){
				evt = window.event;
			}
			var keyCode = document.layers ? evt.which : document.all ? evt.keyCode : document.getElementById ? evt.keyCode : 0;
			if (keyCode == 40 || keyCode == 38){
				var navRoot = window.document.getElementById('search_result');
				var test = navRoot.firstChild.nodeName;
				alert(test);
				/*
				for (i=0; i<navRoot.childNodes.length; i++) {
					node = navRoot.childNodes[i];
					if (node.nodeName == "LI") {
						if(i == 1){
							alert(node.childNodes.length);
						}
					}
				}
				*/			
			}
		}
	}
}

/*document.onkeydown = checkKeys;*/

function show(e_id){ 
	document.getElementById(e_id).style.display='block'; 
	document.getElementById(e_id).style.visibility='visible'; 
}
function hide(e_id){ 
	document.getElementById(e_id).style.display='none';
	document.getElementById(e_id).style.visibility='hidden'; 
}

function fx_opacity(e_id, e_opy_cypher, e_opy_cypher2){
	var this_one = document.getElementById(e_id);
	
	this_one.style.filter	  = 'alpha(opacity='+e_opy_cypher+')';
	this_one.style.filter	  = 'progid:DXImageTransform.Microsoft.Alpha(opacity='+e_opy_cypher+')';
	this_one.style.MozOpacity  = e_opy_cypher2;
	this_one.style.opacity     = e_opy_cypher2;
}
			
function omover_fx(e_id, color){
	var this_one = document.getElementById(e_id);
	this_one.style.backgroundColor = "#" + color; 
	this_one.style.cursor = 'pointer';
}
function omout_fx(e_id, color){ 
	var this_one = document.getElementById(e_id);
	this_one.style.backgroundColor = "#" + color; 
	this_one.style.cursor = 'pointer';
}

function check_suchfeld_status(e_id, e_color_start, e_color_end, text_color, border_color){
	var this_one = document.getElementById(e_id);
	
	if(this_one.value == ''){
		this_one.value = 'Suchbegriff';
		fx_fader_color(e_id, 'bgcolor', e_color_start, e_color_end, '25');
		this_one.style.borderColor = '#'+border_color;
		this_one.style.color = '#'+text_color;
		this_one.style.fontSize = '10px';
	}else{
		if(this_one.value == 'Suchbegriff'){
			this_one.value = '';
			fx_fader_color(e_id, 'bgcolor', e_color_start, e_color_end, '25');
			this_one.style.borderColor = '#000000';
			this_one.style.color = '#000000';
			this_one.style.fontSize = '13px';
		}
	}
}

var counter = 0;

function fx_fader_color_combo(e_id, e_style, e_color_start, e_color_end, e_speed, e_count){
	var check_it 	= false;
	check_it		= check_focus_status();
	if (check_it === true){
		if(counter <= e_count){
			var wst_01 = window.setTimeout("fx_fader_color('"+e_id+"', '"+e_style+"', '"+e_color_start+"', '"+e_color_end+"', '"+e_speed+"')", 1000);
			var wst_02 = window.setTimeout("fx_fader_color_combo('"+e_id+"', '"+e_style+"', '"+e_color_end+"', '"+e_color_start+"', '"+e_speed+"', '"+e_count+"')", 1000);
			counter++;
		}else{
			var wst_03 = window.setTimeout("fx_fader_color('"+e_id+"', '"+e_style+"', '"+e_color_start+"', '"+e_color_end+"', '"+e_speed+"')", 1000);
			
		}
	}
}

function onload_work(active_bgcolor, active_bgcolor2){
	fx_fader_color('td_box2', 'bgcolor', '#ffffff', '#'+active_bgcolor, '25');
	fx_fader_color('div_left_side', 'bgcolor', '#ffffff', '#'+active_bgcolor, '25');
	window.setTimeout("fx_fader_color_combo('suchfeld_links', 'bgcolor', '#"+active_bgcolor2+"', '#ffffcc', '25', '4')", 4000);
}

/*

var searchinput = document.getElementById('suchen_fx');
var sugbox = document.getElementById('quickfinder_results');
var suggestions = new Array();
var hoveredSuggestion = -1;



	document.onkeydown = mach_dies;
	function mach_dies(ev) {
			try { searchKeyDown(event.keyCode); }
			catch(e) { searchKeyDown(ev.keyCode); }
		};
		
	searchinput.onkeyup = mach_das;
	function mach_das(ev) {
			try { searchKeyUp(event.keyCode); }
			catch(e) { searchKeyUp(ev.keyCode); }
		}


function hoverSuggestion(sug) {
 for(var i=0; i<5; i++)
  sugbox.getElementsByTagName('span')[i].style.color = '#00FF00';

 if(sug != -1) {
  sugbox.getElementsByTagName('a')[sug].style.color = '#FF0000';
  hoveredSuggestion = sug;
 }

}


function searchKeyDown(kc) {
 if(sugbox.style.display == 'block') {

  if(kc != 38 && kc != 40)
    hoveredSuggestion = -1;

  if(kc == 38 && hoveredSuggestion != -1) { // Key code 38 is the up arrow key
   hoveredSuggestion--;
   hoverSuggestion(hoveredSuggestion);
   searchinput.value = suggestions[hoveredSuggestion];
  }

  if(kc == 40 && hoveredSuggestion < suggestions.length-1) { // Key code 40 is the down arrow key
   hoveredSuggestion++;
   hoverSuggestion(hoveredSuggestion);
   searchinput.value = suggestions[hoveredSuggestion];
  }

  if(kc == 38 && hoveredSuggestion == -1)
   searchinput.value = searchValue; // Recall the old search value

 }
}


function searchKeyUp(kc) {

 if(kc != 38 && kc != 40)
  searchValue = searchinput.value; // Save the current search field value

 if(searchinput.value != '' && kc != 13 && kc != 27 && kc != 38 && kc != 40) // Key code 13 is the enter key and 27 is the escape key
  giveSuggestions();

 if((searchinput.value == '' || kc == 27) && sugbox.style.display == 'block')
  hideSugbox();
 
}
*/
