	function symbolsToEntities(sText) {
		var sNewText = "";
		var iLen = sText.length;
		for (i=0; i<iLen; i++) {
			iCode = sText.charCodeAt(i);
			sNewText += (iCode > 256? "&#" + iCode + ";": sText.charAt(i));
		}
		return sNewText;
	}


	// script for filling goods-basket
	// mod = table
	// tbl_type = shop
	
	function show_continent(WHICH, WHAT){
		
		if(WHAT == 'none')
			document.getElementById('worldmap').src 		=  'filefactory/content/pictures/weltkarte.gif';
		else
			document.getElementById('worldmap').src 		=  'filefactory/content/pictures/worldmap_' + WHICH + '.gif';
		
	}
	
	function fill (PAGE_ID, TBL_ID, TD_ID) {
		
		var quantity = document.getElementById('qua' + TD_ID).value;
		
		document.location.href = 'index.php?page_id=' + PAGE_ID + '&action=filltd&tbl_id=' + TBL_ID + '&td_id=' + TD_ID + '&quantity=' + quantity;
	
	}
	
	function del (PAGE_ID, TBL_ID, TD_ID) {
			
		var quantity = document.getElementById('qua' + TD_ID).value;
		
		document.location.href = 'index.php?page_id=' + PAGE_ID + '&action=deltd&tbl_id=' + TBL_ID + '&td_id=' + TD_ID + '&quantity=' + quantity;
	
	}
	
	function cookie_save() {
		
		if (!document.tbl_order)
			return;
		
		var FORM	 = document.tbl_order;
		
		for (var num = 0; num < FORM.length; num++)
			document.cookie = FORM[num].name + "=" + FORM[num].value + ";";
		
	}
	
	function cookie_load() {
		
  	var COOKIE = document.cookie.split(";");
  	
  	for (var cn = 0; cn < COOKIE.length; cn++) {
  		
  		var TEMP 				= COOKIE[cn].split("=");
  		var TEMP_COOKIE = TEMP[0].replace(/ /, "");
  		
  		if (document.getElementById(TEMP_COOKIE) && TEMP[1] && document.getElementById(TEMP_COOKIE).type != 'hidden')
  			eval('document.tbl_order.' + TEMP_COOKIE + '.value = "' + TEMP[1] + '";');
  	
  	}
  }
	
	function browse(DIRECTION) {
		
		document.browse_form.action.value = 'browse' + DIRECTION + 'td';
		document.browse_form.submit();
		
	}
	
	function browse_link(UP, DOWN) {
	
		document.getElementById('bup').style.display 		= (UP == 1) ? 'inline' : 'none' ;
		document.getElementById('bdown').style.display 	= (DOWN == 1) ? 'inline' : 'none' ;
		
	}
	
  var IE = false;
  var IE_Version = 0;
	
	Browser();
		
	/*
		fix browser ie 6 (png-transparency)
	*/
	function PNG_alpha() {
		
		if (!IE)
			return;
			
		if (IE_Version == 7)
			return;
		
		imgs = document.getElementsByTagName('img');
		
		for (var c = 0; c < imgs.length; c++) {
			
			var png = imgs[c].src.match(/\.png/);
      if (!png)
				continue;
			
  		imgs[c].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imgs[c].src + "')";
      imgs[c].src = './filefactory/system/pictures/spacer.gif';
			
		}
	}
	
  function Browser() {
	
    var appVersion = navigator.appVersion;
		
    if (
			(appVersion.indexOf("MSIE") != -1) &&
      (appVersion.indexOf("Macintosh") == -1)
		) {
			
      IE_Version = parseFloat(appVersion.split("MSIE")[1]);
      IE = true;
    }
  }	
	