// Global functions...

function imposeMaxLength(Object, MaxLen)
{
  return (Object.value.length <= MaxLen);
}


function ajax_translation_link(obj){
	if( obj ){
		obj.style.display = 'none';
		
		queue.add(obj.href+'&ajax');
	}
	return false;
}

function get_xmlhttp(){
	var xmlhttp=null;
	
	try{
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
	}catch(e){
		try{
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}catch(e){
			xmlhttp=new XMLHttpRequest();
		}
	}
	return xmlhttp;
}

function chr(code){
	return String.fromCharCode(code);
}

function glue(str,add,glue){
	if(!glue){
			glue='&';
	}
	
	if(str!='' && str!=null && add!='' && add!=null){
		str += glue;
	}

	return str + add;
}






function in_array(array, string){
	
	for(index in array){	
		if(array[index] == string){
			return true;
		}
	}
	return false;	
}


function escape_string( string_to_escape ){
  var encodeded_string = replace_all_occurence( string_to_escape, '+', '*plus_encoded' );
  return escape( encodeded_string );  
}

function unescape_string( string_to_unescape ){  
  return unescape(string_to_unescape);
}


