/**
 * 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;
}



/**
 * tt_news list script functions 
 *
 * 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=null;

function prog_latest_mover (id) {
	if (lastover) {
		do_latest_off(lastover);
	}
	lastover=id;
	newover=1;
	if (document.getElementById) {
		target = document.getElementById( "box_"+id );
		target.className = "afw-latest-container_over";
		target = document.getElementById( "title_"+id );
		target.className = "afw-latest-title_over";
	}
}
function prog_latest_mout (id) {
	newover=0;
	if(lastover) {
		setTimeout('prog_latest_off_recheck(lastover)',300);
	}
}
function prog_latest_off_recheck (id) {
	if (newover==0) {
		do_latest_off(id);
	}
}
function do_latest_off (id) {
	if (document.getElementById){
		target = document.getElementById( "box_"+id );
		target.className = "afw-latest-container";
		target = document.getElementById( "title_"+id );
		target.className = "afw-latest-title";
	}
}
function prog_list_mover (id) {
	if (lastover) {
		do_list_off(lastover);
	}
	lastover=id;
	newover=1;
	if (document.getElementById) {
		target = document.getElementById( "date_"+id );
		target.className = "afw-list-date_over";
		target = document.getElementById( "titles_"+id );
		target.className = "afw-list-titles_over";
		target = document.getElementById( "title_"+id );
		target.className = "afw-list-title_over";
	}
}
function prog_list_mout (id) {
	newover=0;
	if(lastover) {
		setTimeout('prog_list_off_recheck(lastover)',100);
	}
}
function prog_list_off_recheck (id) {
	if (newover==0) {
		do_list_off(id);
	}
}
function do_list_off (id) {
	if (document.getElementById) {
		target = document.getElementById( "date_"+id );
		target.className = "afw-list-date";
		target = document.getElementById( "titles_"+id );
		target.className = "afw-list-titles";
		target = document.getElementById( "title_"+id );
		target.className = "afw-list-title";
	}
}
function prog_click (thehref) {
	location.href=thehref;
}
