function clear_element(element) {

	element.value = '';


}

wmtt = null;

document.onmousemove = updateWMTT;

function updateWMTT(e) {
	
	sX = (document.documentElement) ? document.documentElement.scrollLeft : 0; 
	sY = (document.documentElement) ? document.documentElement.scrollTop : 0;
	
	x = (document.all) ? window.event.x + sX : e.pageX;
	y = (document.all) ? window.event.y + sY : e.pageY;
	
	if (wmtt != null) {

		wmtt.style.left = (x + 20) + "px";
		wmtt.style.top 	= (y) + "px";
	}
}

function showWMTT(id) {
	wmtt = document.getElementById(id);
	wmtt.style.display = "block"
}

function hideWMTT() {
	wmtt.style.display = "none";
	wmtt.innerHTML="";
}


//AJAX
function ab_info(id) {

	xajax.$('img_logo').className="img_logo_wait";
	xajax_anbieter_info(id);

}

function get_image(id,navi,typ,path) {

	xajax.$('img_logo').className="img_logo_wait";
	xajax.$('tt_img').innerHTML='<img src="../images/wait.gif" width="32" height="32" />';
	xajax_get_image(id,navi,typ,path);	
	
}

function ax_ab_detail(id) {
	
	xajax.$('img_logo').className="img_logo_wait";
	xajax_anbieter_info_detail(id);
	
}

function iol_excel_info(id) {

	xajax.$('img_logo').className="img_logo_wait";
	xajax_excel_iol_det(id);
	
}

function get_iol_list(iol_id, h_id) {
	
	xajax.$('img_logo').className="img_logo_wait";
	
	typen = new Array();
	
	typen[0] = xajax.$('iol_d_filter_hkl').checked;
	typen[1] = xajax.$('iol_d_filter_piol').checked;	
	typen[2] = xajax.$('iol_d_filter_vkl').checked;
	typen[3] = xajax.$('iol_d_filter_multifokal').checked;
	
	xajax_get_iol_list(iol_id, h_id, xajax.$('select_det_order').value, typen);
	
}

function get_iol_details(id) {

	xajax.$('img_logo').className="img_logo_wait";
	xajax_get_iol_details(id);
	
}

function get_suche_one() {
	
	xajax.$('img_logo').className="img_logo_wait";	
	
	xajax_get_one_seek(xajax.$('suche_one_ins').value);
	
	if(xajax.$('suche_one_ins').value != '') {
	
		xajax.$('suche_one_all').style.left = findPosX(xajax.$('suche_one_ins')) + 'px';
		xajax.$('suche_one_all').style.top = findPosY(xajax.$('suche_one_ins')) + 22 + 'px';
		xajax.$('suche_one_all').style.display = 'block';
		
	} else {
		
		hide_suche_one('suche_one_ins');	
		
	}
	
	
}

function get_suche_all(el) {

	if(xajax.$(el).value != '') {

		xajax.$('img_logo').className="img_logo_wait";		
		xajax_get_all_seek(el, xajax.$(el).value);
		xajax.$('suche_one_all').style.left = findPosX(xajax.$(el)) + 2 + 'px';
		xajax.$('suche_one_all').style.top = findPosY(xajax.$(el)) + 22 + 'px';		
		xajax.$('suche_one_all').style.display = 'block';

		
	} else {
		
		hide_suche_one(el);
		xajax_del_from_seek(el);
		xajax_mk_all_iol();
		
	}
	
}


function hide_suche_one(el) {
	
	xajax.$('suche_one_all').style.display = 'none';
	
	if(el != false) {
	
		xajax.$(el).value = '';
				
	}
	
	xajax_mk_all_iol();
	
}

function add_seek_para (id,value) {
	
	xajax.$('img_logo').className="img_logo_wait";
	xajax.$(id).value = value;
	hide_suche_one(false);
	
	
	xajax_add_seek_para(id, value);
	xajax_mk_all_iol();
}


function add_to_pdf(id, type) {

	xajax.$('img_logo').className="img_logo_wait";
	xajax_add_to_pdf(id, type);
		
}

function get_all_iol_list(navi, use_seek) {

	xajax.$('img_logo').className="img_logo_wait";	
	xajax_get_all_iol_list(navi, false);
	
}

function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }

function blinker(class_1, class_2) {
	
	var counter = 0;
	var timer = setInterval(updater, 100);	
	var sclass = class_1;
	
	function updater() {
	
		if(counter < 10) {
		
			if (sclass == class_1) {
			
				document.getElementById("bli").className = class_2;
				sclass = class_2;
				
			
			} else {
			
				document.getElementById("bli").className = class_1;
				sclass = class_1;
			
			}
			
			counter++;
		
		} else {
		
			clearInterval(timer);
			counter = 0;
		
		}
	
	}

}
