

//*****************************************************************************************************
//*******************************************-----------------------*************************************************************************
//*******************************************-----------------------*************************************************************************

function reset_request_arrays_p()
{
	xmlHttp4.splice(0,xmlHttp4.length);

}
var global_dynamic_id;


var xmlHttp4 = new Array();

var grc_aj = -1;
var gb_urlPostpath;
function ajaxPost(url_path,id,str1,str2,str3,str4,str5,str6,str7,str8,str9,str10)
{
	var postdata=new Array();
	langvar='';
	//if (id=='wrapexternal') langvar="&lang="+str1;
	postdata="q1="+str1+"&q2="+str2+"&q3="+str3+"&q4="+str4+"&q5="+str5+"&q6="+str6+"&q7="+str7+"&q8="+str8+"&q9="+str9+"&q10="+str10+langvar;

	grc_aj++;
	var rc = grc_aj;

	global_dynamic_id=id;
	gb_urlPostpath=url_path;
	show_loading(true);
		
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
		xmlHttp4[rc]=new XMLHttpRequest()
		 if (xmlHttp4[rc].overrideMimeType) 
               xmlHttp4[rc].overrideMimeType('text/xml'); 
	}
	else if (window.ActiveXObject)
	{
		xmlHttp4[rc]=new ActiveXObject("Microsoft.XMLHTTP")
	}
		//return objXMLHttp
		//xmlHttp4[rc]=GetXmlHttpObject()
	if (xmlHttp4[rc]==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	xmlHttp4[rc].onreadystatechange = alertContents; 
    xmlHttp4[rc].open('POST', gb_urlPostpath, true); 
    xmlHttp4[rc].setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 
    xmlHttp4[rc].setRequestHeader('Content-length', postdata.length); 
    xmlHttp4[rc].send(postdata);

	function alertContents() 
	{ 
       if (xmlHttp4[rc].readyState == 4|| xmlHttp4[rc].readyState=="complete") 
	   { 

		document.getElementById(id).innerHTML=xmlHttp4[rc].responseText 

		if (id=='addtosession1')
		{
			show_loading(false);
			theswin1=dhtmlwindow.open("thes1box", "iframe", "thespopup.jsp?type=geo"  , " ", "width=350px,height=400px,center=1,resize=1,scrolling=1"); 		
			theswin1.onclose=function(){
				//document.getElementById('geoproc').innerHTML='1';		//flag oti to exoume epxergastei
				if ( (document.getElementById('topic').value!='') && (document.getElementById('topicproc').innerHTML=='0') ) {
					ajaxPost('./addtosession.jsp','addtosession2','searchtekmiriaquery', document.getElementById('topic').value );
					theswin2=dhtmlwindow.open("thes2box", "iframe", "thespopup.jsp?type=topic", " ", "width=350px,height=400px,center=1,resize=1,scrolling=1");
					theswin2.onclose=function(){
						//document.getElementById('topicproc').innerHTML='1';		//flag oti to exoume epexergastei
						return true;
					}
				}
				return true;
			}
		}

		if (id=='addtosession2')
		{
			show_loading(false);
			theswin2=dhtmlwindow.open("thes2box", "iframe", "thespopup.jsp?type=topic", " ", "width=350px,height=400px,center=1,resize=1,scrolling=1"); 
			theswin2.onclose=function(){
				//document.getElementById('topicproc').innerHTML='1';		//flag oti to exoume epexergastei
				return true;
			}
		}

		if (url_path=='./form-showcontent.jsp')
		{				
			window.location='formthesaurus.jsp?action=showcontent&menuid='+str1+'&menustate='+str1+'&lang='+str2 ;
			show_loading(false);
		}


		if (url_path=='./form-showcontent2.jsp')
		{	
						
			if ( str1=='6' || str1=='9' || str1=='29' || str1=='30' || str1=='34' || str1=='35' || str1=='36' || str1=='39' || str1=='25' || str1=='26' || str1=='27' || str1=='40' || str1=='41' || str1=='42'|| str1=='43' || str1=='44' || str1=='47' ||  str1=='48'|| str1=='49' || str1=='61' || str1=='50' || str1=='63'  )
			{
				document.getElementById('flashdiv').style.display="none";
				document.getElementById('staticcontent').style.width="97%";
			}

			AC_FL_RunContent(
				'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
				'width', '350', //550
				'height', '260', //400
				'src', 'kms',
				'quality', 'high',
				'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
				'FlashVars','xmlfile=http://85.72.48.250:80/images'+str1+'_'+str2+'.xml',			//85.72.48.250
				'align', 'middle',
				'play', 'true',
				'loop', 'true',
				'scale', 'showall',
				'wmode', 'window',
				'devicefont', 'false',
				'id', 'kms',
				'bgcolor', '#ffffff',
				'name', 'kms',
				'menu', 'true',
				'allowFullScreen', 'true',
				'allowScriptAccess','sameDomain',
				'movie', 'kms',
				'salign', ''
				); //end AC code
			//updateDynamic2(str1);			//IP 85.72.48.250
			show_loading(false);
		}

		if (url_path=='./form-shownavigation.jsp')
		{
			show_loading(false);
			document.getElementById('menustate').innerHTML=str1;
			//show_loading(false);
		}

		if (id=='wrapexternal')
		{
			show_loading(false);
			mnid=document.getElementById('menustate').innerHTML;
			/*if ( mnid=='56' || mnid=='33' )
			{
				mnid='1';
				show_loading(true);

			}*/
			window.location='formthesaurus.jsp?lang='+str1+'&menustate='+mnid+'&menuid='+mnid ;  //&menuid=
			show_loading(true);
		}

		if (url_path=='./form-addtolightbox.jsp')
		{
			show_loading(false);
			//document.getElementById('menustate').innerHTML=str1;
			//show_loading(false);
		}

		if (url_path=='./form-showimagearea.jsp')
		{
			show_loading(false);
		}


        }
     } 
}
//******************************************------------------**************************************************************************
//******************************************------------------**************************************************************************
//******************************************************************************************************
function show_loading(state)
{	
	if(state)
		document.getElementById("loading_").style.display="";
	else
		document.getElementById("loading_").style.display="none";
}