  function checkForm(form)
	  {
	  var querystring = form;

openWindow ("popup.php?"+querystring);
	  }
	  
	  

	 function openWindow (url,width,height)
	 {
	  var ns4up = (document.layers) ? 1 : 0
var ie4up = (document.all) ? 1 : 0
var xsize = screen.width
var ysize = screen.height
var breite=width
var hoehe=height
var xpos=(xsize-breite)/2
var ypos=(ysize-hoehe)/2

	//  $(newsletter).serialize();
	  //alert(querystring);
	//  window.open("popup.php?"+querystring+"", "", "");
	  window.open(url,"","scrollbars=no,status=yes,toolbar=no,location=no,directories=no,resizable=yes,menubar=no,width="+breite+",height="+hoehe+",screenX="+xpos+",screenY="+ypos+",top="+ypos+",left="+xpos)

	 }
	  
	function toggle_str(id,source, target ) 
	{
		var elm = document.getElementById(id);
		//alert(elm.title);
	 
	 if(elm.title == 'more')
	 {
		  elm.innerHTML = target;
		  elm.title = 'less';
		  return;
		  
	 }
	 else
	 {
		   elm.innerHTML = source;
		  elm.title = 'more';
		  return; 
	 }
	
	}
	  

    function toggle_visibility(id) {
       var e = document.getElementById(id);
       var cookiename = id;
	   if(e.style.display == 'block') {
          e.style.display = 'none';
		  var status = 0;
      } else {
          e.style.display = 'block';
		  var status = 1;
		  }
	Set_Cookie( cookiename, status, '', '/', '', '' );
	 }
	 
	 
	 function set_visibility(id,status) {
	 //	alert(id + status);
		 var e = document.getElementById(id);
	 	 e.style.display = status;
	 }
	
	    function hide_element(id) {
       var e = document.getElementById(id);
      e.style.display = 'none';
    }
	
	
	
	
	
function Set_Cookie( name, value, expires, path, domain, secure ) 
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct 
expires time, the current script below will set 
it for x number of days, to make it for hours, 
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}

	
// this fixes an issue with the old method, ambiguous values 
// with this test document.cookie.indexOf( name + "=" );
function Get_Cookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f
	
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );
		
		
		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
	
		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}		
	
function stripSlashes(str)
{
	
return str.replace(/\\/g, ''); 
}


function hileAllLangContent() 
{
var fr = document.getElementById('content_fr');
fr.style.display = 'none';
var de = document.getElementById('content_de');
de.style.display = 'none';
var it = document.getElementById('content_it');
it.style.display = 'none';
var rm = document.getElementById('content_rm');
rm.style.display = 'none';


}
  
function displayLangContent(str) 
{
var langid = 'content_'+str;
var e = document.getElementById(langid);
 e.style.display = 'block';

}

function encode_utf8( s )
{
  return unescape( encodeURIComponent( s ) );
} 

function decode_utf8( s )
{
  return decodeURIComponent( escape( s ) );
}

function parseUri (str) {
	var	o   = parseUri.options,
		m   = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
		uri = {},
		i   = 14;

	while (i--) uri[o.key[i]] = m[i] || "";

	uri[o.q.name] = {};
	uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {
		if ($1) uri[o.q.name][$1] = $2;
	});

	return uri;
};

parseUri.options = {
	strictMode: false,
	key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],
	q:   {
		name:   "queryKey",
		parser: /(?:^|&)([^&=]*)=?([^&]*)/g
	},
	parser: {
		strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
		loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
	}
};

