// Tabfade
if ((navigator.appVersion.indexOf("Mac") != -1) || (navigator.appVersion.indexOf("Win") != -1)) { }
else document.write("<link rel=\"stylesheet\" href=\"/css/linux_overload.css\" type=\"text/css\" />"); 

function hl(trID) {
	if(trID) {
		document.getElementById('m-block0').style.background = "none";
		document.getElementById('m-block1').style.background = "none";
		document.getElementById('m-block2').style.background = "none";
		document.getElementById('m-block3').style.background = "none";

		/*
		// buggy - to be fixed... hide hilite at once
		var leftbar = document.getElementById('leftbar')
		var leftbarLength = leftbar.getElementsByTagName('a').length
              for (inc = 0; inc < leftbarLength; inc++) {
                      if(leftbar.getElementsByTagName('a')[inc] != document.getElementById(trID)) {
						var o = leftbar.getElementsByTagName('a')[inc];
                             	o.style.background = "none";
						var o = leftbar.getElementsByTagName('a')[inc].firstChild;
                              if(o.nodeName == "IMG" && o.width == 6 && o.height == 11){
                                      o.style.visibility = "hidden";
                              }
                      }
              }
		*/

        var o = document.getElementById(trID);
		if(o) o.style.background = "#7E9CA7";
        var o = document.getElementById('imgcur'+trID);
		if(o) o.style.visibility = "visible";
		
        	switch(trID) {
				case 'w0':
				case 'w1':
				case 'w2':
				case 'w3':
					document.getElementById('m-block0').style.background = "#DBE0E3";
				break;
				case 'w10':
				case 'w11':
				case 'w12':
					document.getElementById('m-block1').style.background = "#DBE0E3";
				break;
				case 'w20':
				case 'w21':
				case 'w22':
				case 'w23':
				case 'w24':
				case 'w25':
				case 'w26':
				case 'w27':
				case 'w28':
				case 'w29':
				case 'w211':
				case 'w281':
					document.getElementById('m-block2').style.background = "#DBE0E3";
				break;
				case 'w30':
				case 'w31':
				case 'w32':
				case 'w33':
				case 'w34':
					document.getElementById('m-block3').style.background = "#DBE0E3";
				case 'w50':
					document.getElementById('m-block5').style.background = "#DBE0E3";
				break;
		}
	}
}


function globalTabOver(tabNumber) {
    if (document.body.className != 'navscheme' + (tabNumber + 1)) {
        document.getElementById('globaltab'+tabNumber).className = 'on';
    }
}

function globalTabOut(tabNumber) {							   
    if (document.body.className != 'navscheme' + (tabNumber + 1)) {
        document.getElementById('globaltab'+tabNumber).className = '';
    }
}

function ToggleNext(el){
	if(!el)return false;
	var orgEl = el;
	while(el && (el=el.nextSibling) ) if( el.nodeType==1 ) break;
	if(!el||!el.style)return false;
	var bActive = el.style.display!="block";
	el.style.display = bActive ? "block" : "none";
	orgEl.className = bActive ? "active" : "";
	return false
}

function autologinSubmit(f){
	var p = f.autologin.checked == true ? 'x' : ''
	f.redirect.value = f.redirect.value.split('[AUTO]').join(p);
	f.redir_fail.value = f.redir_fail.value.split('[AUTO]').join(p);
	
	var browser=navigator.appName
	if (browser.indexOf("Microsoft")!=-1) {
 		document.charset="ISO-8859-1";
 	}
}

function popIt(w,h,u,o){	
	winProp = "width="+w+",height="+h+",scrollbars=yes";
	if(o) { winProp = winProp+","+o; }
	window.open(u,"popwin",winProp);
}

/* image popups START */
PositionX = 500;
PositionY = 200;
defaultWidth  = 600;
defaultHeight = 400;
var AutoClose = true;
function popImage(imageURL,imageTitle){
	var imgWin = window.open('','_blank','scrollbars=no,resizable=1,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY);
	if( !imgWin ) { return true; }
	imgWin.document.write('<html><head><title>'+imageTitle+'<\/title><script type="text\/javascript">\n'+
		'function resizeWinTo() {\n'+
		'if( !document.images.length ) { document.images[0] = document.layers[0].images[0]; }'+
		'var oH = document.images[0].height + 20, oW = document.images[0].width + 20;\n'+
		'if( !oH || window.doneAlready ) { return; }\n'+
		'window.doneAlready = true;\n'+
		'var x = window; x.resizeTo( oW + 200, oH + 200 );\n'+
		'var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;\n'+
		'if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }\n'+
		'else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }\n'+
		'else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }\n'+
		'if( window.opera && !document.childNodes ) { myW += 16; }\n'+
		'x.resizeTo( oW = oW + ( ( oW + 200 ) - myW ), oH = oH + ( (oH + 200 ) - myH ) );\n'+
		'var scW = screen.availWidth ? screen.availWidth : screen.width;\n'+
		'var scH = screen.availHeight ? screen.availHeight : screen.height;\n'+
		'if( !window.opera ) { x.moveTo(Math.round((scW-oW)/2),Math.round((scH-oH)/2)); }\n'+
		'}\n'+
		'<\/script>'+
		'<\/head><body onload="resizeWinTo();"'+(AutoClose?' onblur="self.close();"':'')+'>'+
		(document.layers?('<layer left="0" top="0">'):('<div style="position:absolute;left:0px;top:0px;display:table;">'))+
		'<img style="margin: 10px 0 0 10px" src="'+imageURL+'" alt="Loading image ..." title="'+imageTitle+'" onload="resizeWinTo();">'+
		(document.layers?'<\/layer>':'<\/div>')+'<\/body><\/html>');
	imgWin.document.close();
	if( imgWin.focus ) { imgWin.focus(); }
	return false;
}

/* image popups END */
/* user input counter START */ 
var prmsg;	
var tempct;	
function countPrivMsg(messageobj, counterid, mh) {
    var maxchars = mh+1;	   
    	    
    var divo = document.getElementById(counterid);
    
    if(!tempct) {
        tempct = messageobj.value.length;
    }
       	    
	if( messageobj.value.length < maxchars) {		    
	        		        
	      if(messageobj.value.length >= (tempct+10)  || messageobj.value.length  <= (tempct-10) || messageobj.value.length >= (maxchars-20) ) {
	          		        		        
	       divo.firstChild.nodeValue  = 	maxchars - messageobj.value.length-1;
	       tempct = messageobj.value.length;	
	       	       
	      }	 
	
           prmsg = messageobj.value;
           
	}
	else {		   
	    messageobj.value  = prmsg;
	    messageobj.scrollTop = messageobj.scrollHeight; // #2370
	}
}		

/* user input counter END */ 
function openGuidedTour(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function addCommonTag(tag, toggle){
	var e = $('tags');
	e.value = trim(e.value);
	var found = false;
	var existing = e.value.split(',');
	var ok;
	existing.each(function(entry,i){
		existing[i] = trim(existing[i]);
		if(tag == existing[i]){
			if(toggle) existing[i] = '';
			found = true;
		}
	});
	if(!found){
		if(e.value.substr(-1) != ',') e.value += ',';
		e.value += tag + ',';
		ok = true;
	}
	else if(toggle){
		e.value = existing.join(',');
		e.value = e.value.split(',,').join(',');
		ok = false;
	}
	if(e.value.substr(0, 1) == ',') e.value = e.value.substring(1);
	e.value=e.value.replace(',,',',');
	if(typeof(qaAskUnsetInputBoxError)!='undefined') qaAskUnsetInputBoxError(3)
	return ok;
}

function trim(str){
	var char_ptr = 0;
	var rstring = str;
	var tmpstring = str;
	if(str != ''){
		while(rstring.charAt(char_ptr) == ' '){
			char_ptr ++;
		}
		tmpstring = rstring.substring(char_ptr, rstring.length);
		rstring = tmpstring;
		char_ptr = rstring.length - 1;
		while(rstring.charAt(char_ptr) == ' '){
			char_ptr--;
		}
		tmpstring = rstring.substring(0, char_ptr + 1)
		rstring = tmpstring;
		return rstring;
	}
	return str;
}

function clone(old){
	var n = new Array();
	old.each(function(tmp,i){
		n[i] = old[i];
	});
	return n;
}

var theToolBar = null;
function ToolBarInit(tb){
	// called by installed toolbar
	theToolBar = tb;
}
function hasToolBar(){
	if(theToolBar == null) return false;
	return true;
}
function reloadToolBar(){
	if(hasToolBar()) theToolBar.reload();
}

function isValidUrl(url){
    var v = new RegExp();
    v.compile("^[A-Za-z]+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$");
    if(!v.test(url)) return false;
	else return true;
}

function objStorage(){
	this.objects = new Array();
	this.register = function(key, obj){
		if(this.objects[key] == undefined){
			this.objects[key] = obj;
			return true;
		}
		else return false;
	}
	this.getByKey = function(key){
		return this.objects[key];
	}
}
var theObjRef = new objStorage();

function changeTab(id){
	if(id=="close"){
		Effect.BlindUp('qatabbox');
	}else{
		$("linkbox").style.display = "none";
		$("imagebox").style.display = "none";
		$("videobox").style.display = "none";
		$("linkboxlink").className = "";
		if(typeof($("imageboxlink"))!="undefined") $("imageboxlink").className = ""; // possibly deactivated
		$("videoboxlink").className = "";
		switch (id) {
			case "link":
				$("linkbox").style.display = "";
				$("linkboxlink").className = "active";
				if ($("qatabbox").style.display == "none") { Effect.BlindDown('qatabbox'); }
				break;
			case "image":
				$("imagebox").style.display = "";
				$("imageboxlink").className = "active";
				if ($("qatabbox").style.display == "none") { Effect.BlindDown('qatabbox'); }
				break;
			case "video":
				$("videobox").style.display = "";
				$("videoboxlink").className = "active";
				if ($("qatabbox").style.display == "none")  {  Effect.BlindDown('qatabbox'); }
				break;
			default:
				$("linkbox").style.display = "";
				$("linkboxlink").className = "active";
				if ($("qatabbox").style.display == "none")  {  Effect.BlindDown('qatabbox'); }
				break;
		}
	}
}
var uploads_in_progress = 0;
var sids = {};
var pattern = {};

function beginUpload(ul,sid,mime) {
	if(typeof(mime)=='undefined') var mime = '';
	// Killing old errorMsgs
	if($('uploadError'+mime).innerHTML != "") $('uploadError'+mime).update("");
	// Disabling submit-buttons
	if(typeof($('DisplayQA:do_it').show_answer_preview)!="undefined" && $('DisplayQA:do_it').show_answer_preview != null) $('DisplayQA:do_it').show_answer_preview.disabled = true;
	if(typeof($('DisplayQA:do_it').add_answer)!="undefined" && $('DisplayQA:do_it').add_answer != null) $('DisplayQA:do_it').add_answer.disabled = true;
	if(typeof($('DisplayQA:do_it').show_answer_amendment_preview && $('DisplayQA:do_it').show_answer_amendment_preview != null)!="undefined") $('DisplayQA:do_it').show_answer_amendment_preview.disabled = true;
	if(typeof($('DisplayQA:do_it').add_answer_amendment && $('DisplayQA:do_it').add_answer_amendment != null)!="undefined") $('DisplayQA:do_it').add_answer_amendment.disabled = true;

	var uploadForm = $('uploadForm'+mime);
	if(!window.pattern[mime]){
		pattern[mime] = uploadForm.file.cloneNode(true);
	}
	var clone = pattern[mime].cloneNode(true);
	uploadForm.replaceChild(ul,uploadForm.file);
	$('fileForm'+mime).appendChild(clone);
	uploadForm.submit();

	sids[ul.name] = sid;
	uploads_in_progress = uploads_in_progress + 1;
	var pb = $("file_progress"+mime);
	Effect.BlindUp('fileForm'+mime);
	Effect.BlindDown('progressbox'+mime);
	// start progress after 2 seconds
	startProgress = function(){
		updateProcess = new Ajax.PeriodicalUpdater(false,'/ajaxProxy.php?sid=' + sid + '&service=percent',{'decay': 2,'frequency' : 1,'method': 'post','parameters': 'sid=' + sid,'onSuccess' : function(request){updateProgress(pb,request,sid,mime)},'onFailure':function(request){updateFailure(pb,request,sid)}});
	}
	setTimeout("startProgress()",2000);
}

function updateProgress(pb,req,sid,mime) {
	var percent = parseInt(req.responseText);
	if(!percent) percent = 0;
	if(percent >= 100){
		updateProcess.stop();
		Effect.BlindUp('progressbox'+mime);
		if(percent == 100){
			// Get media-type
			mimetypeRequest = new Ajax.Request('/ajaxProxy.php?sid=' + sid + '&service=mimetype', {asynchronous:false});
			mimetype = mimetypeRequest.transport.responseText;
			// Write in hidden fields
			hidden = document.createElement('input');
			hidden.setAttribute("type","hidden");
			hidden.setAttribute("name","files["+mimetype+"]");
			hidden.setAttribute("value",sid);
			$('DisplayQA:do_it').appendChild(hidden);
			var inp_id = pb.id.replace("_progress","");
			if(sids[inp_id]) {
				uploads_in_progress = uploads_in_progress - 1;
				var inp = $(inp_id);
				if(inp) {
					inp.value = sids[inp_id];
				}
			}
			Effect.BlindDown('MessageBox'+mime);
			sids[inp_id] = false;
		}else{
			msg = getErrorMsg(percent);
			$('uploadError'+mime).update(msg);
			//Effect.Shake('uploadError'+mime,1);
			Effect.BlindDown('fileForm'+mime);
		}
		// Reenabling submit-buttons
		if(typeof($('DisplayQA:do_it').show_answer_preview)!="undefined" && $('DisplayQA:do_it').show_answer_preview != null) $('DisplayQA:do_it').show_answer_preview.disabled = false;
		if(typeof($('DisplayQA:do_it').add_answer)!="undefined" && $('DisplayQA:do_it').add_answer != null) $('DisplayQA:do_it').add_answer.disabled = false;
		if(typeof($('DisplayQA:do_it').show_answer_amendment_preview)!="undefined" && $('DisplayQA:do_it').show_answer_amendment_preview != null) $('DisplayQA:do_it').show_answer_amendment_preview.disabled = false;
		if(typeof($('DisplayQA:do_it').add_answer_amendment)!="undefined" && $('DisplayQA:do_it').add_answer_amendment != null) $('DisplayQA:do_it').add_answer_amendment.disabled = false;
	}
	if(percent <= 100){
		pb.style.width = percent + "%";
		$('percentagenum'+mime).update(String(percent) + "%");
	}
}

function updateFailure(pb,req,sid) {
	var mes = req.responseText;
	pb.style.width=0;
	alert(mes);
	uploads_in_progress = uploads_in_progress - 1;
}

function submitUpload(frm) {
	if(uploads_in_progress > 0) {
		alert("File upload in progress. Please wait until upload finishes and try again.");
	} else {
		frm.submit();
	}
}

// [IB]
var avaShown = [];
function showAvatarHover(id){
	var e = $('avatarHover' + id);
	if(e.className == 'avaHoverPanelOn') return true;
	var id2;
	while(id2 = avaShown.pop()) hideAvatarHover(id2);
	avaShown.push(id);
	e.className = 'avaHoverPanelOn';
    e.innerHTML = e.innerHTML; // fix for bug in IE6
	return false; // if JS do not follow link
}
function hideAvatarHover(id){
	var e = $('avatarHover' + id);
	e.className = 'avaHoverPanelOff';
    e.innerHTML = e.innerHTML; // fix for bug in IE6
	return false; // if JS do not follow link
}

// Greeting Box
/**
 * Collapse/open welcome Box
 */
function boxWelcome_collapse() {
    
    var duration = 0.3;
    
	if( document.getElementById( 'boxWelcomeBody' ).style.display == document.getElementById( 'titleCollapsed' ).style.display ) return false;
	var expires = new Date();
	expires.setTime( expires.getTime() + 315360000 );
	if( document.getElementById( 'boxWelcomeBody' ).style.display != 'none' ) {
		Effect.BlindUp( 'boxWelcomeBody', {duration:duration} );
		Effect.BlindDown( 'titleCollapsed', {duration:duration} );
		document.cookie = "welcomeBoxCollapsed=1; expires=" + expires.toGMTString();
	}
	else {
		Effect.BlindDown( 'boxWelcomeBody', {duration:duration} );
		Effect.BlindUp( 'titleCollapsed', {duration:duration} );
		document.cookie = "welcomeBoxCollapsed=0; expires=" + expires.toGMTString();
	}
	return false;
}
/**
 * Display/Hide Message in input field
 * @param {String} hint Message to display in input
 * @param {Boolean} click Clicked or blured?
 */
function boxWelcome_inputHint( hint, click ) {
	var input = document.getElementById( 'frgtext' );
	if( input.value == hint && click ) input.value = "";
	else if( input.value == "" && ! click ) input.value = hint;
}


function checkCommentLength(comId,comMaxLength){
	var comStr=document.getElementById(comId).value;	
	if(comStr.length >= comMaxLength){
		document.getElementById(comId).value = comStr.substring(0,comMaxLength);
	}
}

// Confirmation Dialogue
function iqconfirm_hideBox(){
    Effect.Fade('iqconfirm_box_background', {duration: 0.1});
}
		
function iqconfirm_showBox(config){	
	iqconfirm_initBox( config );
	Effect.Appear('iqconfirm_box_background', {duration: 0.1});
}

function iqconfirm_initBox(config) {
	body = document.getElementsByTagName('body')[0];
    if( $( 'iqconfirm_box_background' ) ) $( 'iqconfirm_box_background' ).remove();
	var overlay = new Element('div', { 'id': 'iqconfirm_box_background' });
	var append = "";
	
	append += 					'<div id="iqconfirm_box">';
	if(config.title) {
		append += 				'<div id="iqconfirm_box_head_title"><p id="iqconfirm_box_title">'+config.title+'<img id="iqconfirm_box_exitbutton" onclick="iqconfirm_hideBox()" src="/i/btn_close.gif" /></p></div>';
	} else {
		append += 				'<div id="iqconfirm_box_head"></div>';
	}
	append += 					'<div id="iqconfirm_box_body">';
	append += 					'<div id="iqconfirm_box_pic"><img id="iqconfirm_box_img" src="'+config.image+'" /></div>';
	append += 					'<div id="iqconfirm_box_description">'+config.description+'</div>';
	if( config.additionalDescription ) append += 					'<div id="iqconfirm_box_description_additional">'+config.additionalDescription+'</div>';
	append += 					'<hr id="iqconfirm_box_hr" />';
	append += 					'<div id="iqconfirm_box_buttons" align="center">';
	var numButtons = config.buttons.length;
	for(i = 0; i < numButtons; i++) {
		append += 				'<a class="iqconfirm_button" ';
		//if(config.buttons[i].select == true) {
			//append += 			'id="iqconfirm_preselect" ';
		//}
		append += 				' onclick="'+config.buttons[i].func+'" ><span>'+config.buttons[i].label+'</span></a>';
	}
	append += 					'</div>';
	append += 					'</div>';
	append += 					'<div id="iqconfirm_box_footer"></div>';
	append += 					'</div>';
	
	overlay.update(append);
	$(document.body).appendChild(overlay);
	//IE6 Selectbox-Hack
     if (navigator.appVersion.indexOf('MSIE 6.0') != -1){
          bubbleChildIframe = document.createElement('iframe');
          bubbleChildIframe.style.backgroundColor = 'transparent';
          bubbleChildIframe.style.border = '0';          
          bubbleChildIframe.style.width = '500px';
          bubbleChildIframe.style.height = '250px';
          bubbleChildIframe.style.position = 'absolute';
          bubbleChildIframe.style.zIndex = '-1';
          bubbleChildIframe.style.bottom = '0px';
          bubbleChildIframe.style.left = '0px';
          bubbleChildIframe.style.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';
          document.getElementById('iqconfirm_box').appendChild(bubbleChildIframe);
     }
}

/* COOKIE FUNCTIONS
 To use, simple do: Get_Cookie('cookie_name'); 
 replace cookie_name with the real cookie name, '' are required
*/
function getCookie( 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;
	}
}

/*
only the first 2 parameters are required, the cookie name, the cookie
value. Cookie time is in milliseconds, so the below expires will make the 
number you pass in the Set_Cookie function call the number of days the cookie
lasts.
Don't worry about domain, path or secure for most applications
so unless you need that, leave those parameters blank in the function call.
*/
function setCookie( 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() : "" ) + //expires.toGMTString()
		( ( path ) ? ";path=" + path : "" ) + 
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );
}

// this deletes the cookie when called
function deleteCookie( name, path, domain ) {
	if ( getCookie( name ) ) document.cookie = name + "=" +
			( ( path ) ? ";path=" + path : "") +
			( ( domain ) ? ";domain=" + domain : "" ) +
			";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

// Human Only Link
function hol() {
   var url = "";
   for (i = arguments.length - 1; i >=0 ; i--)
   {
      url = url + arguments[i];
   }
   document.location.href = url;
}

/**
* detecting if a user comes from a SE
*/
function seGreetBox(ajax_temp_hash, bouncerUrl) {
	var currentReferrer = document.referrer;		
    var http_post_request = false;
    var url = '/html/snippet/greetingBoxSer';
    
    if(ajax_temp_hash && currentReferrer) {   
	    var parameters = "&h=" + ajax_temp_hash+"&r="+escape(currentReferrer);   	   
	    if (window.XMLHttpRequest) { // Mozilla, Safari,...
	       http_post_request = new XMLHttpRequest();
	       if (http_post_request.overrideMimeType) {
	          // set type accordingly to anticipated content type
	          http_post_request.overrideMimeType('text/html');
	       }
	    } else if (window.ActiveXObject) { // IE
	       try {
	          http_post_request = new ActiveXObject("Msxml2.XMLHTTP");
	       } catch (e) {
	          try {d
	             http_post_request = new ActiveXObject("Microsoft.XMLHTTP");
	          } catch (e) {}
	       }
	    }
	    if (!http_post_request) {
	       alert('Cannot create XMLHTTP instance');
	       return false;
	    }      
	    http_post_request.onreadystatechange = function() {//Call a function when the state changes.	    	
			if(http_post_request.readyState == 4 && http_post_request.status == 200) {
				/**
				*	do nothing because the response will not be used
				*   http_post_request.responseText
				*/																		
				var returnedText = http_post_request.responseText;
				if(returnedText != '403') {
					var endFoundPosition = returnedText.search('<br clear="all" /><hr /><pre style="display:block">')
					if(endFoundPosition > 0) {
						returnedText 	 = returnedText.substring(0,endFoundPosition);				
					} 
					$('searchBoxS').update(returnedText + $('searchBoxS').innerHTML);			
					$('searchBoxS').show();
					$( 'searchBox' ).hide();
					xmlhttpSHInit(document.ask, $('frgtext'), false, ajax_temp_hash, null, bouncerUrl);	
				}							
			}
		}	
	    http_post_request.open('POST', url, true);
	    http_post_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	    http_post_request.setRequestHeader("Content-length", parameters.length);
	    http_post_request.setRequestHeader("Connection", "close");
	    http_post_request.send(parameters);   
	}
}