/**
 * functions for submitbutton mouseover and out
 * @author Ralf Hettinger
 */
function submitbutton_over (obj) {
	if(obj) {
		obj.className = 'csc-mailform-submit-over';
	}
}
function submitbutton_out (obj) {
	if(obj) {
		obj.className = 'csc-mailform-submit';
	}
}



/**
 * functions for swapping images at mouseover and out
 * @author Ralf Hettinger
 */

var swapme_outimg = new Image();
swapme_outimg.src = "";
var swapme_namerestore = null;
var swapme_objrestore = null;

function swapover(newsrc,name,imgObj) {
	if (version == "n3" && document[name]) {
		swapme_namerestore = name;
		swapme_outimg.src = document[name].src;
		tempImg = new Image();
		tempImg.src = newsrc;
		document[name].src = tempImg.src;
	} else if (imgObj) {
		swapme_objrestore = imgObj;
		swapme_outimg.src = imgObj.src;
		imgObj = new Image();
		imgObj.src = newsrc;
	}
}
function swaprestore() {
	if (version == "n3" && document[swapme_namerestore]) {
		document[swapme_namerestore].src = swapme_outimg.src;
		swapme_namerestore = null;
	} else if (swapme_objrestore) {
		swapme_objrestore.src = swapme_outimg.src;
		swapme_objrestore = null;
	}
}



/**
 * functions for div-over and div-out
 * @author Ralf Hettinger
 *
 * Notice:
 * thanks to Internet Explorer: to prevent flickering, we wait some time before turning
 * back to mouseout-state. and we only turn back if no new mouseover has taken place.
 * if a new mouseover took place (newover==1), then this mouseover will have turned
 * the previous mouseover-state back to mouseout-state.
 */
var newover = 0;
var lastover_div_id = null;
var lastover_div_class_out = "";
var lastover_img_id = null;
var lastover_img = new Image();
lastover_img.src = "";

function div_over (act_id, div_class_over, div_class_out, div_id_prefix, img_src_over, img_src_out, img_id_prefix) {
	if (lastover_div_id) {
		if (lastover_div_id != div_id_prefix+''+act_id) {
			div_turnoff(lastover_div_id);
		}
	}
	newover = 1;
	if (document.getElementById) {
		if (div_obj = document.getElementById(div_id_prefix+''+act_id)) {
			lastover_div_id = div_id_prefix+''+act_id;
			div_obj.className = div_class_over;
			lastover_div_class_out = div_class_out;
		}
		if (img_obj = document.getElementById(img_id_prefix+''+act_id)) {
			lastover_img_id = img_id_prefix+''+act_id;
			lastover_img.src = img_src_out;
			tempImg = new Image();
			tempImg.src = img_src_over;
			img_obj.src = tempImg.src;
		}
	}
}
function div_out () {
	newover=0;
	if(lastover_div_id) {
		setTimeout('div_recheck_turnoff(lastover_div_id)',180);
	}
}
function div_recheck_turnoff (id) {
	if (newover==0) {
		div_turnoff(id);
	}
}
function div_turnoff (id) {
	if (document.getElementById){
		if (div_obj = document.getElementById(id)) {
			div_obj.className = lastover_div_class_out;
			lastover_div_id = null;
		}
		if (lastover_img_id) {
			if (img_obj = document.getElementById(lastover_img_id)) {
				img_obj.src = lastover_img.src;
			}
			lastover_img_id = null;
		}
	}
}

function div_click (thehref) {
	location.href=thehref;
}




/**
 * function used by map24
 */

function map24_removeDefaultValues() {
	if (document.link2map24.sstreet.value == 'Straße') {
		document.link2map24.sstreet.value = '';
	}
	if (document.link2map24.szip.value == 'PLZ') {
		document.link2map24.szip.value = '';
	}
	if (document.link2map24.scity.value == 'Ort') {
		document.link2map24.scity.value = '';
	}
}