/**
 *
 * www.promotionbasis.de / v.5.00
 * /scripts.js
 * various Javascript functions
 *
 * last update: 2008-04-15, 12:00 (TPic)
 *
 * @copyright 2004-2008 moonchild media AG
 *
 **/

// ################################################################################################################################
// DIVERSE FUNKTIONEN #############################################################################################################
// ################################################################################################################################

function MM_findObj(n, d) { //v4.0
var p,i,x;  if (!d) d=document; if ((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+ 1)].document; n=n.substring(0,p);}
if (!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if (!x && document.getElementById) x=document.getElementById(n); return x;
}

// --

function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+ 2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}

// --

function MM_preloadImages() { //v3.0
var d=document; if (d.images){ if (!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

// --

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if (!x.oSrc) x.oSrc=x.src; x.src=a[i+ 2];}
}

// --

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

// ################################################################################################################################


// ################################################################################################################################
// ANTI-SPAM ROUTINEN #############################################################################################################
// ################################################################################################################################

function UnCryptMailTo(ea, es) {

  var n 	= 0;
  var r 	= "";

	// --

  for (var i = 0; i < ea.length; i++) {

      n = ea.charCodeAt(i);

      if (n >= 8364) {

				n = 128;

			}

		r += String.fromCharCode(n - 1);

  }

	// --

	r += "?";

	// --

  for (var i = 0; i < es.length; i++) {

      n = es.charCodeAt(i);

      if (n >= 8364) {

				n = 128;

			}

		r += String.fromCharCode(n - 1);

  }

	// --

	return r;

}

// --

function linkTo_UnCryptMailTo(ea, es) {

	location.href = UnCryptMailTo(ea, es);

}

// ################################################################################################################################


// ################################################################################################################################
// TOGGLE BLOCK ELEMENTS ##########################################################################################################
// ################################################################################################################################

function toggleElement(eNo) {
	var e = document.getElementById(eNo);
	if (e.style.display == '')
	e.style.display = "none";
	if (e.style.display == "none")
	e.style.display = "block";
	else
	e.style.display = "none";
	return false;
}

// ################################################################################################################################


// ################################################################################################################################
// TOGGLE BLOCK 2 ELEMENTS ########################################################################################################
// ################################################################################################################################

function toggleElement2(eNo) {
	var e = document.getElementById(eNo);
	if (e.style.display == '')
	e.style.display = "none";
	if (e.style.display == "none")
	e.style.display = "inline";
	else
	e.style.display = "none";
	return false;
}

// ################################################################################################################################


// ################################################################################################################################
// TOGGLE ADMIN / ARROW SMALL #####################################################################################################
// ################################################################################################################################

function show_div(div_id) {

	var div_element = document.getElementById(div_id);

	if (div_element.style.display == "none")
	{
	  div_element.style.display = "block";
	  document.getElementById("optional_" + div_id).src = "../img/ico/ico_toggle_minus_11x11.gif";
	} else {
	 	div_element.style.display = "none";
	  document.getElementById("optional_" + div_id).src = "../img/ico/ico_toggle_plus_11x11.gif";
	}
}

// ################################################################################################################################


// ################################################################################################################################
// ICONS / VALUES SWITCHEN - ANZEIGEN / VERBERGEN PREMIUMTOOL: KOMMENTARE BETRACHTEN ##############################################
// ################################################################################################################################

function show_other_div(div_id) {

	if (document.getElementById(div_id).style.display == 'none') {

	  document.getElementById(div_id).style.display = 'block';
	  document.getElementById('optional_' + div_id).src = '../img/ico/ico_dropup.gif';

	} else {

    document.getElementById(div_id).style.display = 'none';
    document.getElementById('optional_' + div_id).src = '../img/ico/ico_dropdown.gif';
	}
}

// ################################################################################################################################


// ################################################################################################################################
// ICONS / VALUES SWITCHEN - EINZELNE ANZEIGEN / VERBERGEN / ÜBERSICHTEN: EIN- UND AUSKLAPPEN #####################################
// ################################################################################################################################

function DisplaySingleDivListings(div_id) {

	if (document.getElementById(div_id).style.display == 'none') {

//	  document.getElementById(div_id).style.display = 'block';
// 		$('#' + div_id).show('slow');
		$('#' + div_id).show('slideImproved', { direction : 'up' }, 500);
	  document.getElementById('optional_' + div_id).src = '../img/ico/ico_dropup.gif';
	  document.getElementById('optional_' + div_id).setAttribute('value', '1');

	} else {

//    document.getElementById(div_id).style.display = 'none';
//		$('#' + div_id).hide('slow');
//		$('#' + div_id).slideUp('slow');
//		$('#' + div_id).hide('fold', { size: 30 }, 1000);
		$('#' + div_id).hide('slideImproved', { direction : 'up' }, 500);
    document.getElementById('optional_' + div_id).src = '../img/ico/ico_dropdown.gif';
    document.getElementById('optional_' + div_id).setAttribute('value', '0');

	}
}

// ################################################################################################################################


// ################################################################################################################################
// ICONS / VALUES SWITCHEN - EINZELNE ANZEIGEN / VERBERGEN / ÜBERSICHTEN: EIN- UND AUSKLAPPEN ##################################### MOOTOOLS!
// ################################################################################################################################

function DisplaySingleDivListings2(div_id) {

	if (document.getElementById('optional_' + div_id).getAttribute('value') == '0') {

	  document.getElementById('optional_' + div_id).src = '../img/ico/ico_dropup.gif';
	  document.getElementById('optional_' + div_id).setAttribute('value', '1');

	} else if (document.getElementById('optional_' + div_id).getAttribute('value') == '1') {

		document.getElementById('optional_' + div_id).src = '../img/ico/ico_dropdown.gif';
    document.getElementById('optional_' + div_id).setAttribute('value', '0');

	}

}

// ################################################################################################################################


// ################################################################################################################################
// ICONS / VALUES SWITCHEN - ALLE ANZEIGEN / VERBERGEN / ÜBERSICHTEN: EIN- UND AUSKLAPPEN #########################################
// ################################################################################################################################

function DisplayAllDivListings(mode, counter_limit) {

	if (mode == '0') {

		for(i = 1; i <= counter_limit; i++) {

		  if (document.getElementById('show_' + i)) {

			  document.getElementById('show_' + i).style.display = 'none';
//			  $('#show_' + i).hide('slow');
//				$('#show_' + i).hide('slide', { direction : 'up' }, 500);
			  if (document.getElementById('optional_show_' + i)) {
			  	
			  	document.getElementById('optional_show_' + i).src = '../img/ico/ico_dropdown.gif';
			  	document.getElementById('optional_show_' + i).setAttribute('value', '0');
			  
				}

			}
		}

// --

	} else if (mode == '1') {

		for(i = 1; i <= counter_limit; i++) {

			if (document.getElementById('show_' + i)) {

		    document.getElementById('show_' + i).style.display = 'block';
//				$('#show_' + i).show('slow');
//				$('#show_' + i).show('slide', { direction : 'up' }, 500);
			  if (document.getElementById('optional_show_' + i)) {

			    document.getElementById('optional_show_' + i).src = '../img/ico/ico_dropup.gif';
			    document.getElementById('optional_show_' + i).setAttribute('value', '1');

		  	}

			}
		}
	}

// --

}

// ################################################################################################################################


// ################################################################################################################################
// AJAX REQUEST - EINZELNE ANZEIGEN / VERBERGEN / ÜBERSICHTEN: EIN- UND AUSKLAPPEN ################################################
// ################################################################################################################################

function sendRequestDisplaySingle(tb, rw, mode, number_show_div, cust_type, cust_id, add_id) {

	display_status = document.getElementById('optional_show_' + number_show_div).getAttribute('value');

	// WENN EIN KOMMENTAR BEARBEITET WERDEN SOLL -> AUSKLAPPEN MERKEN

	if (cust_type == 'show_voting') { var display_changed_status = 1; }

	else if (display_status == '1') { var display_changed_status = 0; }

	else { var display_changed_status = 1; }

	req = AjaxHttpRequest();

  req.open("get", "include_global/inc_ajax.php?tb=" + tb + "&rw=" + rw + "&mode=" + mode + "&show_div=" + display_changed_status + "&cust_type=" + cust_type + "&cust_id=" + cust_id + "&add_id=" + add_id);
  req.send(null);

	// --

	window.clearTimeout(session_timer);
	startT(3601);

}

// ################################################################################################################################


// ################################################################################################################################
// AJAX REQUEST - ALLE ANZEIGEN / VERBERGEN / ÜBERSICHTEN: EIN- UND AUSKLAPPEN ####################################################
// ################################################################################################################################

function sendRequestDisplayAll(tb, rw, mode, show_div, cust_type, cust_id, add_id) {

	req = AjaxHttpRequest();

  req.open("get", "include_global/inc_ajax.php?tb=" + tb + "&rw=" + rw + "&mode=" + mode + "&show_div=" + show_div + "&cust_type=" + cust_type + "&cust_id=" + cust_id + "&add_id=" + add_id);
  req.send(null);

	// --

	window.clearTimeout(session_timer);
	startT(3601);

}

// ################################################################################################################################


// ################################################################################################################################
// ICONS / VALUES SWITCHEN & AJAX REQUEST - EINZELNE STATI WECHSELN / ÜBERSICHTEN: HÄKCHEN / KREUZE (OK/NOT-OK) SETZEN ############
// ################################################################################################################################

function DisplaySingleFlagsOperator(tb, rw, mode, number_flag_div, cust_type, cust_id, add_id) {

	if (document.getElementById(number_flag_div).getAttribute('value') == '1') {

	  document.getElementById(number_flag_div).src = '../img/ico/ico_no.gif';
	  document.getElementById(number_flag_div).setAttribute('value', '0');

	} else {

    document.getElementById(number_flag_div).src = '../img/ico/ico_ok.gif';
    document.getElementById(number_flag_div).setAttribute('value', '1');

	}

	display_status = document.getElementById(number_flag_div).getAttribute('value');

	req = AjaxHttpRequest();

  req.open("get", "include_global/inc_ajax.php?tb=" + tb + "&rw=" + rw + "&mode=" + mode + "&show_div=" + display_status + "&cust_type=" + cust_type + "&cust_id=" + cust_id + "&add_id=" + add_id);
  req.send(null);

	// --

	window.clearTimeout(session_timer);
	startT(3601);

}

// ################################################################################################################################


// ################################################################################################################################
// AJAX REQUEST - EINZELNE DATEIEN VOM SERVER LÖSCHEN / EXTERNAL ##################################################################
// ################################################################################################################################

function sendRequestDeleteFile(cust_id, random_code, mode, div_id) {

	req = AjaxHttpRequest();

  req.open("get", "../include_global/inc_ajax.php?cust_id=" + cust_id + "&random_code=" + random_code + "&mode=" + mode);
  req.send(null);

	if (document.getElementById(div_id)) 							{ document.getElementById(div_id).style.display = 'none'; }
	if (document.getElementById(div_id + '_x')) 			{ document.getElementById(div_id + '_x').style.display = 'none'; }
	if (document.getElementById(div_id + '_none')) 		{ document.getElementById(div_id + '_none').style.display = 'block'; }
	if (document.getElementById(div_id + '_x_none')) 	{ document.getElementById(div_id + '_x_none').style.display = 'block'; }

	// --

	window.clearTimeout(session_timer);
	startT(3601);

	// --

	if (mode == 'promoter_files_fotos' || mode == 'promoter_files_video') {

		document.getElementById('promoter_uploader1_msg').style.display = 'block';
		window.setTimeout("document.getElementById('promoter_uploader1_msg').style.display = 'none'", 5000);

	} else {

		document.getElementById('promoter_uploader2_msg').style.display = 'block';
		window.setTimeout("document.getElementById('promoter_uploader2_msg').style.display = 'none'", 5000);

	}

}

// ################################################################################################################################


// ################################################################################################################################
// AJAX REQUEST - GOOGLE-MAPS: EIN- UND AUSKLAPPEN ################################################################################
// ################################################################################################################################

function sendRequestDisplayGoogleMaps(tb, mode, item_id, add_id, url_search, origin_display_status) {

	display_status = document.getElementById('display_google_map').checked;

	if (display_status == true) {

    var display_changed_status = 1;

	  document.getElementById('div_google_maps').style.display = 'block';

	} else {

		var display_changed_status = 0;

    document.getElementById('div_google_maps').style.display = 'none';

	}

	req = AjaxHttpRequest();

  req.open("get", "include_global/inc_ajax.php?tb=" + tb + "&mode=" + mode + "&show_map=" + display_changed_status + "&item_id=" + item_id + "&add_id=" + add_id);
  req.send(null);

	if (display_status == true && origin_display_status == '0') {	location.search = url_search; }

	// --

	window.clearTimeout(session_timer);
	startT(3601);

}

// ################################################################################################################################


// ################################################################################################################################
// AJAX REQUEST - EINZELNE BEWERTUNG IN EINE SESSION SPEICHERN ####################################################################
// ################################################################################################################################

function sendRequestStarRatingVote(mode, vote_mode, vote_value, element_id) {

	document.getElementById(element_id).style.width = vote_value + '0px';
	req = AjaxHttpRequest();

  req.open("get", "include_global/inc_ajax.php?mode=" + mode + "&vote_mode=" + vote_mode + "&vote_value=" + vote_value);
  req.send(null);

	// --

	window.clearTimeout(session_timer);
	startT(3601);

}

// ################################################################################################################################


// ################################################################################################################################
// AJAX REQUEST - KOMMENTAR SPEICHERN #############################################################################################
// ################################################################################################################################

function saveComment(tb, mode, comment, vc, i) {

	var write_comment = comment.replace(/\n/g, '<br />');
	var comment = comment.replace(/\n/g, 'zzzzzzzz');

	req = AjaxHttpRequest();

  req.open("get", "include_global/inc_ajax.php?tb=" + tb + "&mode=" + mode + "&comment=" + comment + "&vc=" + vc);

	req.onreadystatechange = function() {

		if (req.readyState == '4') {

			req_update_msg = AjaxHttpRequest();

		  req_update_msg.open("get", "include_global/ajax_update_msg.php?tb=" + tb + "&mode=" + mode + "&vc=" + vc);

		  req_update_msg.onreadystatechange = function() {

		  	if (req_update_msg.readyState == '4') {

		  		document.getElementById('ajax_update_msg' + i).innerHTML = req_update_msg.responseText;
		  		document.getElementById('ajax_update_msg' + i).style.display = 'block';

				}
			}

			req_update_msg.send(null);

// --

			//document.getElementById('optional_comment_' + i).style.display = 'none';
			//document.getElementById('optional_comment_' + i).outerHTML = '<span id="optional_comment_' + i + '"><img border="0" src="img/ico/ico_comment_write_not_active.gif" title="Premium-Vote -&gt; Kommentar wurde bearbeitet." alt="Premium-Vote -&gt; Kommentar wurde bearbeitet . "> </span>';
			//document.getElementById('show_comment' + i).innerHTML = '';

			document.getElementById('show_comment_form' + i).style.display = 'none';
			document.getElementById('show_comment_update_msg' + i).style.display = 'block';
			document.getElementById('show_comment_update_msg' + i).innerHTML = write_comment;
			document.getElementById('show_comment_text_head1' + i).style.display = 'block';
			document.getElementById('show_comment_text_head2' + i).style.display = 'block';
			document.getElementById('if_no_comment' + i).value = 0;


		}

	}

  req.send(null);

	// --

	window.clearTimeout(session_timer);
	startT(3601);

}

// ################################################################################################################################


// ################################################################################################################################
// AJAX REQUEST - MAILS VERSENDEN #################################################################################################
// ################################################################################################################################

function sendMail(mode, special_options) {

	req = AjaxHttpRequest();

  req.open("get", "include_global/inc_ajax_sendmail.php?mode=" + mode + "&special_options=" + special_options);

  req.send(null);

	// --

	window.clearTimeout(session_timer);
	startT(3601);

}

// ################################################################################################################################


//#################################################################################################################################
// AJAX HTTP REQUEST IE UND ALTERNATIV BROWSER ####################################################################################
//#################################################################################################################################

function AjaxHttpRequest() {

	if (window.XMLHttpRequest) {

	req = new XMLHttpRequest(); // Wenn kein IE, dann XMLHttp Handling

	} else if (window.ActiveXObject) { // Wenn IE, dann ActiveX XML Handling

	  try {

			req = new ActiveXObject("Msxml.XMLHTTP");

	  } catch (e) {

		  try {

				req = new ActiveXObject("Microsoft.XMLHTTP");

		  } catch (e) {

		  }
	  }
	}

return req;

}

//#################################################################################################################################


//#################################################################################################################################
// DIVERSE FUNKTIONEN ZUM AUSLESEN VON RADIO/SELECT-FELDERN #######################################################################
//#################################################################################################################################

function radioValue(rObj) {
  for (var i=0; i<rObj.length; i++) if (rObj[i].checked) return rObj[i].value;
  return false;
}


function selectValue(sObj) {
  with (sObj) return options[selectedIndex].value;
}


function multipleValue(sObj, separator) {
  var rVal = '';
  for (var i=0; i<sObj.options.length; i++) with (sObj.options[i])
  if (selected) rVal += separator + value;
  return rVal.substring(separator.length);
}

function toggleDocumentElements(tag_name, display_mode) { // 'show' oder 'hide' sind als Vis-Wert erlaubt

	var all_doc_elements = document.getElementsByTagName(tag_name);

	for (var i=0; i<all_doc_elements.length; i++) {

		if (all_doc_elements[i].style) { display_mode = (display_mode == 'show') ? 'visible' : (display_mode == 'hide') ? 'hidden' : display_mode; }

		all_doc_elements[i].style.visibility = display_mode;

	}
}

//#################################################################################################################################


//#################################################################################################################################
// SETZEN DES TABINDEX EINES ELEMENTS PER ID FÜR FORMULARE ########################################################################
//#################################################################################################################################

function set_tabindex_by_id(_tabindex_value, _id) {

	var element;
	var _debug_mode = true;

	if (element = document.getElementById(_id)) {

		element.setAttribute("tabIndex", _tabindex_value);

		return true;
	}

	if (_debug_mode) alert("Element " + _id + " nicht gefunden!");

}

//#################################################################################################################################


//#################################################################################################################################
// number_format() FÜR JAVASCRIPT - ANALOG ZUR PHP number_format() ################################################################
//#################################################################################################################################

function number_format(number, decimals, dec_point, thousands_sep) {

	var exponent	= "";
	var numberstr = number.toString ();
	var eindex		= numberstr.indexOf ("e");

	// --

	if (eindex > -1) {

    exponent	= numberstr.substring (eindex);
    number		= parseFloat (numberstr.substring (0, eindex));

  }

  if (decimals != null) {

    var temp	= Math.pow (10, decimals);
    number		= Math.round (number * temp) / temp;

  }

	// --

  var sign		= number < 0 ? "-" : "";
  var integer = (number > 0 ? Math.floor (number) : Math.abs (Math.ceil (number))).toString ();

  var fractional	= number.toString ().substring (integer.length + sign.length);
  dec_point				= dec_point != null ? dec_point : ".";
  fractional			= decimals != null && decimals > 0 || fractional.length > 1 ? (dec_point + fractional.substring (1)) : "";

	// --

  if (decimals != null && decimals > 0) {

    for (i = fractional.length - 1, z = decimals; i < z; ++i) {

			fractional += "0";

		}

  }

	// --

  thousands_sep = (thousands_sep != dec_point || fractional.length == 0) ? thousands_sep : null;

  if (thousands_sep != null && thousands_sep != "") {

		for (i = integer.length - 3; i > 0; i -= 3) {

			integer = integer.substring (0 , i) + thousands_sep + integer.substring (i);

		}

  }

  return sign + integer + fractional + exponent;

}

//#################################################################################################################################


// ################################################################################################################################
// RICHTIG KAUFMÄNNISCH RUNDEN MIT ROUNDOFF-FUNKTION  #############################################################################
// ################################################################################################################################

function roundoff(v, d) {

	r = Math.pow(10, d);
	v *= r;

	if (v - Math.floor(v) >= 0.49) {

		return (Math.ceil(v)/r);
	
	} else {

		return (Math.floor(v)/r);

	}

}

// ################################################################################################################################


// ################################################################################################################################
// TRIM-FUNKTIONEN ################################################################################################################
// ################################################################################################################################

function trim(str, chars) {
	
    return ltrim(rtrim(str, chars), chars);

}

function ltrim(str, chars) {
	
    chars = chars || "\\s";
    return str.replace(new RegExp("^[" + chars + "]+", "g"), "");

}

function rtrim(str, chars) {
	
    chars = chars || "\\s";
    return str.replace(new RegExp("[" + chars + "]+$", "g"), "");

}

// ################################################################################################################################


//#################################################################################################################################
// POP-UP WINDOWS / FUNCTIONS #####################################################################################################
//#################################################################################################################################

// POP-UP FUNKTION

function windowPopUp001(winURL, winName, winMode) {

	// Fallback, Standardwerte setzen

	mainURL 	= 'http://www.promotionbasis.de';

	if (winURL == '') 	{ winURL 	= mainURL; }
	if (winName == '') 	{ winName = 'faq_popup'; }
	if (winMode == '') 	{ winMode = 'faq_popup_standard'; }

	// --

	winClose 	= '';

	// --

	// PDF-Download

	if (winMode == 'pdf_download') {

		winURL 		= mainURL + '/pdf/pdf_download_tracker.php' + winURL;
		winProps 	= 'width=10, height=10, top=10000, left=10000, toolbar=0, location=0, directories=0, menuBar=0, scrollbars=0, resizable=0';
		winClose	= '2000';

	}

	// --

	// Admin, additional PopUp (1)

	if (winMode == 'admin_add_popup_1') {

		winProps 	= 'width=500, height=500, top=50, left=50, toolbar=0, location=0, directories=0, menuBar=0, scrollbars=1, resizable=1';

	}


	// --

	// Admin, additional PopUp (2)

	if (winMode == 'admin_add_popup_2') {

		winProps 	= 'width=300, height=100, top=50, left=50, toolbar=0, location=0, directories=0, menuBar=0, scrollbars=0, resizable=0';
		winClose	= '10000';

	}

	// --

	winOpener = window.open(winURL, winName, winProps);

	if (parseInt(navigator.appVersion) >= 4) { winOpener.window.focus(); }

	if (winClose != '') { winOpener.setTimeout('window.close()', winClose); }

}

// --

// POPUP WINDOW - CENTERED (SETCARD-VIEWS & VOTINGS)

function popup_1(mypage, myname) {

	var winh = screen.height - 260;
	var winl = ((screen.width - 568) / 2) - 10;
	var wint = ((screen.height - winh) / 2) -15;

	winprops = 'width=568, height=' + winh + ', top=' + wint + ', left=' + winl + ', toolbar=0, location=0, directories=0, menuBar=0, scrollbars=0, resizable=1'

	win = window.open(mypage, myname, winprops)

	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }

}

// Y
// POPUP WINDOW - CENTERED (EXPORT-DOWNLOADS)

function popup_1a(mypage, myname, mode) {

	if (mode == 'pdf_download') { winprops = 'width=10,height=10,top=10000,left=10000,toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0'; }

	win = window.open(mypage, myname, winprops)

	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }

	if (mode == 'pdf_download') { win.setTimeout('window.close()', 2000); }

}

// Y
// POPUP WINDOW - POSTIONABLE, SCROLLABLE, RESIZABLE (CMS, ADMIN)

function popup_2(mypage, myname, w, h, scroll, t, l) {
winprops = 'height=' + h + ',width=' + w + ',top=' + t + ',left=' + l + ',scrollbars=' + scroll + ',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

// POPUP WINDOW - CENTERED (FORUM, JOB-DETAIL-PRINT)

function popup_3(mypage, myname, w, h) {
var winl = ((screen.width - w) / 2) - 10;
var wint = ((screen.height - h) / 2) - 15;
winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + ',toolbar=1,location=0,directories=0,menuBar=0,scrollbars=1,resizable=1'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


// POPUP WINDOW - CENTERED (INFOS, FAQs, CONTACTERS)

function popup_faq(mypage, myname) {

if (myname == '1') { var myname = 'faq'; }
var winl = ((screen.width - 550) / 2) - 10;
var wint = ((screen.height - 430) / 2) - 15;
winprops = 'width=550,height=430,top=' + wint + ',left=' + winl + ',toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


// POPUP WINDOW - CENTERED (INFOS, FAQs, CONTACTERS) #2

function popup_faq_2(mypage, myname) {
var winh = screen.height - 260;
var winl = ((screen.width - 568) / 2) - 10;
var wint = ((screen.height - winh) / 2) - 15;
winprops = 'width=568,height=' + winh + ',top=' + wint + ',left=' + winl + ',toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


// POPUP WINDOW - CENTERED (U.A. FÜR FAQs ...)

function popup_flexible(mypage, myname) {
var winh = screen.height - 300;
var winl = ((screen.width - 568) / 2) - 10;
var wint = ((screen.height - winh) / 2) - 15;
winprops = 'width=568,height=' + winh + ',top=' + wint + ',left=' + winl + ',toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


// POPUP WINDOW - CENTERED (FLASH CHAT)

function popup_flash_chat(mypage, myname) {
var winl = ((screen.width - 800) / 2) - 10;
var wint = ((screen.height - 700) / 2) - 15;
winprops = 'width=800,height=700,top=' + wint + ',left=' + winl + ',toolbar=1,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


// POPUP WINDOW - CENTERED (FOTO-VIEWS)

function popup_fotos(mypage, myname) {
var winh = screen.height - 260;
var winw = screen.width - 400;
var winl = ((screen.width - winw) / 2) - 10;
var wint = ((screen.height - winh) / 2) - 15;
winprops = 'width=' + winw + ',height=' + winh + ',top=' + wint + ',left=' + winl + ',toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


// POPUP WINDOW - CENTERED (ZANOX SHOP)

function popup_zanox(mypage, myname) {
var winh = screen.height - 260;
var winl = ((screen.width - 840) / 2) - 10;
var wint = ((screen.height - winh) / 2) -15;
winprops = 'width=840,height=' + winh + ',top=' + wint + ',left=' + winl + ',toolbar=1,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


// POPUP WINDOW - CENTERED (NET-PUBLICS.DE SHOP)

function popup_nepu(mypage, myname) {
var winl = ((screen.width - 852) / 2) - 10;
var wint = ((screen.height - 738) / 2) - 15;
winprops = 'width=852,height=738,top=' + wint + ',left=' + winl + ',toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


// POPUP WINDOW - CENTERED (DETAILANSICHT)

function popup_details1(mypage, myname) {
var winl = ((screen.width - 800) / 2) - 10;
var wint = ((screen.height - 590) / 2) - 15;
winprops = 'width=800,height=590,top=' + wint + ',left=' + winl + ',toolbar=1,location=0,directories=1,menuBar=1,scrollbars=1,resizable=1'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


// POPUP WINDOW - CENTERED (SPECIAL-FEATURES)

function popup_specialfeatures(mypage, myname) {
var winl = ((screen.width - 790) / 2) - 10;
var wint = ((screen.height - 570) / 2) - 15;
winprops = 'width=790,height=570,top=' + wint + ',left=' + winl + ',toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


// POPUP WINDOW - CENTERED (CMS-ADVERTS)

function popup_cms_adverts(mypage, myname) {
var winh = screen.height - 200;
var winl = ((screen.width - 850) / 2) - 10;
var wint = ((screen.height - winh) / 2) - 15;
winprops = 'width=850,height=' + winh + ',top=' + wint + ',left=' + winl + ',toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=1'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


// URL CHECKER

function url_checker(feld) {

	var url = encodeURI(feld);
	var w = 800;
	var h = 600;
	var winl = ((screen.width - w) / 2) - 10;
	var wint = ((screen.height - h) / 2) - 15;
	winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + ',toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=0'
	win = window.open(url, 'url', winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }

}


// POPUP WINDOW - KONTOR

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


// POPUP-RESIZER

function moveandsize(popup_w, popup_h) {

var x = ((screen.width - popup_w) / 2) - 10;
var y = ((screen.height - popup_h) / 2) - 15;

window.resizeTo(popup_w,popup_h);
window.moveTo (x,y);

}

//#################################################################################################################################


//#################################################################################################################################
// SICHERHEITS-ABFRAGEN (Z.B. BEI LÖSCHUNG VON EINTRÄGEN ...) #####################################################################
//#################################################################################################################################

// ALERT DELETES

function confirmLink(theLink) {

	if (confirmMsg == '' || typeof(window.opera) != 'undefined') { return true; }

	var is_confirmed = confirm(confirmMsg);

	if (is_confirmed) { theLink.href; }

	return is_confirmed;

}


// ALERT EDITS

function confirmLink2(theLink) {

	if (confirmMsg2 == '' || typeof(window.opera) != 'undefined') { return true; }

	var is_confirmed = confirm(confirmMsg2);

	if (is_confirmed) { theLink.href; }

	return is_confirmed;

}


// ALERT PSEARCH

function confirmPromobasisSearch(theLink) {

	if (confirmMsg2 == '' || typeof(window.opera) != 'undefined') { return true; }

	var is_confirmed = confirm(confirmMsg2);

	if (is_confirmed) { theLink.href; }

	return is_confirmed;

}


// ALERT AUTO-LOGIN

function confirmAutoLogin(theLink) {

	if (confirmMsgAutoLogin == '' || typeof(window.opera) != 'undefined') { return true; }

	var is_confirmed = confirm(confirmMsgAutoLogin);

	if (is_confirmed) { theLink.href; }

	return is_confirmed;

}

//#################################################################################################################################


//#################################################################################################################################
// SOCIAL BOOKMARKING FUNKTIONEN ##################################################################################################
//#################################################################################################################################

function load_social() {

	var d=document; if (d.images) {

		if (!d.Social) d.Social=new Array();

		var i,j=d.Social.length,a=load_social.arguments;

		for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0) { d.Social[j]=new Image; d.Social[j++].src=a[i]; }

	}
}

// --

function SocialMouseOut() {

	var i,x,a=document.MM_sr;	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}

// --

function SocialSwitchImage(n, d) {

  var p,i,x; if (!d) d=document;

  if ((p=n.indexOf("?"))>0&&parent.frames.length) {

  	d=parent.frames[n.substring(p+ 1)].document; n=n.substring(0,p);

  }

  if (!(x=d[n])&&d.all) x=d.all[n];

  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=SocialSwitchImage(n,d.layers[i].document);

  if (!x && d.getElementById) x=d.getElementById(n); return x;

}

// --

function SocialMouseOver() {

  var i,j=0,x,a=SocialMouseOver.arguments; document.MM_sr=new Array;

  for(i=0;i<(a.length-2);i+=3)

  if ((x=SocialSwitchImage(a[i]))!=null) {

  	document.MM_sr[j++]=x; if (!x.oSrc) x.oSrc=x.src; x.src=a[i+ 2];

  }
}

//#################################################################################################################################
