
//<div id="text" style="position:absolute;visibility:hidden" >This is some text       mm</div>
//<input type="button" onclick="getWidth()" value="Go" />
//<script type="text/javascript" >
//    function getWidth() {
//        var width = document.getElementById("text").clientWidth;
//        alert(" Width :"+  width);
//    }
//</script>


//*********************************************************************************************
function getWindowWidth(win) {   
  if (win == undefined) win = window;   
  if (win.innerWidth) {   
    return win.innerWidth;   
  } else {   
    if (win.document.documentElement &&   
      win.document.documentElement.clientWidth) {
         
      return win.document.documentElement.clientWidth;   
    }   
    return win.document.body.offsetWidth;   
  }   
}   
//*********************************************************************************************
function getWindowHeight(win) {   
  if (win == undefined) win = window;   
  if (win.innerHeight) {   
    return (win.innerHeight);   
  } else {   
    if (win.document.documentElement && win.document.documentElement.clientHeight) {   
      return (win.document.documentElement.clientHeight);   
    }   
    return (win.document.body.offsetHeight);   
  }   
}  
//*********************************************************************************************
function getScreenWidth(win) {
  return screen.width;
}
//*********************************************************************************************
function getScreenHeight(win) {
  return screen.height;
}
//*********************************************************************************************
//function alertSize() {
//  window.alert( 'NEW SC Width = ' + myScreenWidth  + '  SC Height = ' + myScreenHeight  + '  Width = '  + myWindowWidth  + '  Height = ' + myWindowHeight );
//}
//function alertChangeSize() {
//  window.alert( 'NEW SC Width = ' + myScreenWidth  + '  SC Height = ' + myScreenHeight  + '  Width = '  + myWindowWidth  + '  Height = ' + myWindowHeight +
//              '\nOLD SC Width = ' + oldScreenWidth + '  SC Height = ' + oldScreenHeight + '  Width = ' + oldWindowWidth + '  Height = ' + oldWindowHeight );
//}
//function alertOldSize() {
//  window.alert( 'OLD SC Width = ' + oldScreenWidth + '  SC Height = ' + oldScreenHeight + 'Width = ' + oldWindowWidth + '  Height = ' + oldWindowHeight );
//}
//*********************************************************************************************
function alertURL() {
  window.alert( 'Diese Datei: ' + document.URL);
}
//*********************************************************************************************
function goBack()
{
  window.history.back()
}
//*********************************************************************************************
function blaettern()
{
  gesamt=history.length;
  history.go(-gesamt+1);

  for ( i = 0; i < gesamt; i++) {
    history.forward();
  }
}
//*********************************************************************************************
function openHC(image) {
  var popup = window.open("", "", "width=250,height=360,status=no,toolbar=no,menubar=no");
  popup.document.open();
  popup.document.write("<html><head></head><body onclick='window.close();'>");
  popup.document.write('<a href="java script:self.close();">');
  popup.document.write('<img SRC="image" border=0></A>');
  popup.document.close();
  return;
}   
//*********************************************************************************************
function get_GET_params() {
   var GET = new Array();
   if(location.search.length > 0) {
      var get_param_str = location.search.substring(1, location.search.length);
      var get_params = get_param_str.split("&");
      for(i = 0; i < get_params.length; i++) {
         var key_value = get_params[i].split("=");
         if(key_value.length == 2) {
            var key = key_value[0];
            var value = key_value[1];
            GET[key] = value;
         }
      }
   }
   return(GET);
}
//*********************************************************************************************
function get_GET_param(key) {
   var get_params = get_GET_params();
   if(get_params[key])
      return(get_params[key]);
   else
      return false;
}
//*********************************************************************************************
function urldecode( str ) {
    // Decodes URL-encoded string  

    var hash_map = {}, ret = str.toString(), unicodeStr='', hexEscStr='';
    
    var replacer = function(search, replace, str) {
        var tmp_arr = [];
        tmp_arr = str.split(search);
        return tmp_arr.join(replace);
    };
    
    // The hash_map is identical to the one in urlencode.
    hash_map["'"]   = '%27';
    hash_map['(']   = '%28';
    hash_map[')']   = '%29';
    hash_map['*']   = '%2A';
    hash_map['~']   = '%7E';
    hash_map['!']   = '%21';
    hash_map['%20'] = '+';
    hash_map['\u00DC'] = '%DC';
    hash_map['\u00FC'] = '%FC';
    hash_map['\u00C4'] = '%D4';
    hash_map['\u00E4'] = '%E4';
    hash_map['\u00D6'] = '%D6';
    hash_map['\u00F6'] = '%F6';
    hash_map['\u00DF'] = '%DF';
    hash_map['\u20AC'] = '%80';
    hash_map['\u0081'] = '%81';
    hash_map['\u201A'] = '%82';
    hash_map['\u0192'] = '%83';
    hash_map['\u201E'] = '%84';
    hash_map['\u2026'] = '%85';
    hash_map['\u2020'] = '%86';
    hash_map['\u2021'] = '%87';
    hash_map['\u02C6'] = '%88';
    hash_map['\u2030'] = '%89';
    hash_map['\u0160'] = '%8A';
    hash_map['\u2039'] = '%8B';
    hash_map['\u0152'] = '%8C';
    hash_map['\u008D'] = '%8D';
    hash_map['\u017D'] = '%8E';
    hash_map['\u008F'] = '%8F';
    hash_map['\u0090'] = '%90';
    hash_map['\u2018'] = '%91';
    hash_map['\u2019'] = '%92';
    hash_map['\u201C'] = '%93';
    hash_map['\u201D'] = '%94';
    hash_map['\u2022'] = '%95';
    hash_map['\u2013'] = '%96';
    hash_map['\u2014'] = '%97';
    hash_map['\u02DC'] = '%98';
    hash_map['\u2122'] = '%99';
    hash_map['\u0161'] = '%9A';
    hash_map['\u203A'] = '%9B';
    hash_map['\u0153'] = '%9C';
    hash_map['\u009D'] = '%9D';
    hash_map['\u017E'] = '%9E';
    hash_map['\u0178'] = '%9F';
	// on decodeURIComponent failure.
	hash_map['<'] 	   = '%3C';
	hash_map['>'] 	   = '%3E';
	hash_map['/'] 	   = '%2F';
	hash_map['@']	   = '%40'; 
	hash_map['e']	   = '%E9';	
	hash_map[' ']	   = '%20';
	

    for (unicodeStr in hash_map) {
        hexEscStr = hash_map[unicodeStr]; // Switch order when decoding
        ret = replacer(hexEscStr, unicodeStr, ret); // Custom replace. No regexing
    }
    
    // End with decodeURIComponent, which most resembles PHP's encoding functions
    ret = decodeURIComponent(ret);

    return ret;
}




//function urldecode (str) {
//    // Decodes URL-encoded string      
//    return decodeURIComponent(str.replace(/\+/g, '%20'));
//}
//*********************************************************************************************
function urlencode (str) {
    // URL-encodes string  
    str = (str+'').toString();
    // Tilde should be allowed unescaped in future versions of PHP (as reflected below), but if you want to reflect current
    // PHP behavior, you would need to add ".replace(/~/g, '%7E');" to the following.
    return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').
                                                                    replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+');
}
/*
(function(){

    var s = window.location.search.substring(1).split('&');

    if(!s.length) return;

    var c = {};

    for(var i  = 0; i < s.length; i++)  {

        var parts = s[i].split('=');

        c[unescape(parts[0])] = unescape(parts[1]);

    }

    window.$_GET = function(name){return name ? c[name] : c;}

}())

*/

/*
(function(){

    var s = window.location.search.substring(1).split('&');

    if(!s.length) return;

    window.$_GET = {};

    for(var i  = 0; i < s.length; i++) {

        var parts = s[i].split('=');

        window.$_GET[unescape(parts[0])] = unescape(parts[1]);

    }

}())
*/

/*
 var exit=true;
 function fenster()
 { if (exit)
 open("popup.html","new_window","width=250,height=150");}


*/

/*
<html><head><title>Test</title>
</head><body>
<a href="javascript:location.reload()">Reload</a>
</body></html>

*/

/*
window.opener = top;
opener.location.reload();
self.close();
*/


/*
			
	function changeURL () {
	if (window.location.href == 'www.ddd.de/index.php?id=45');
	document.write("<a href="www.ddd.de/index.php?id=45&L=1">Link</a>");
	linkset[0]+='<a href="www.delta-h.de">English</a>';

document.write("<a href=http:" + "//" + "localhost:8503/index.php?id=45&L=1">English</a>");

http://www.w3schools.com/js/js_ex_dom.asp

document.domain
*/

/*
<!--
// Create variable is_input to see if there is a ? in the url
var is_input = document.URL.indexOf('?');

// Check the position of the ? in the url
if (is_input != -1) { 
// Create variable from ? in the url to the end of the string
addr_str = document.URL.substring(is_input+1, document.URL.length);

// Loop through the url and write out values found
// or a line break to seperate values by the &
for (count = 0; count < addr_str.length; count++) 
{

if (addr_str.charAt(count) == "&") 
// Write a line break for each & found
{document.write ("<br>");}

else 
// Write the part of the url 
{document.write (addr_str.charAt(count));}

}}

// If there is no ? in the url state no values found
else
{document.write("No values detected");}

-->
*/

 
