
					//document.getElementById('rechts').style.height = (window.innerHeight-175)+'px';
					//document.getElementById('rechts');
						//document.getElementById(elementContainer).innerHTML = 	url;

//frames - Tablica obiektów reprezentujących ramki w oknie, ułożonych z kolejności występowania w kodzie źródłowym
//name - Wyświetla nazwę określonego obiektu
//length - Wyświetla liczbę ramek potomnych dla danej ramki
//parent - Synonim dla okna lub ramki zawierającej dany układ ramek
//self - Synonim dla bieżącej ramki lub okna
//window - The top level for an object
//Metody: clearTimeout i setTimeout



//window.XMLHttpRequest
//tre = window.theHttpRequest.responseText;	 
//parseInt(cur_disp); 
//cur_disp = new Object();

//setVar = cur_disp;  
//var cur_disp = ''+cur_disp + 'KKK'; 
					
//document.getElementById('OK').innerHTML = cur_disp; 
//parent.
//parent.document.getElementById('OKI').innerHTML = 'OKI JEST<script type=\"text/javascript\" language=\"JavaScript\"> var cur_disp='+cur_disp+';   window.onload = left_menu(); </script>	'; 

//var cur_tabml = parent.document.getElementById('cur_tabml').title;  
//var cur_disp = parent.document.getElementById('cur_disp').title; 


//parent.document.getElementById('main_menu_left').innerHTML = '<script type=\"text/javascript\" language=\"JavaScript\"> var cur_disp='+cur_disp+';   window.onload = left_menu(cur_tabml); </script>	'; 						
						
							
						
				


//object detection to return the correct object depending upon broswer type. Used by the getAXHA(); function.
//object detection to return the correct object depending upon broswer type. Used by the getAXHA(); function.
function getNewHttpObject() {
       var xmlhttp;

        /** Special IE only code ... */
        /*@cc_on
          @if (@_jscript_version >= 5)
              try
              {
                  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
              }
              catch (e)
              {
                  try
                  {
                      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                  }
                  catch (E)
                  {
                      xmlhttp = false;
                  }
             }
          @else
             xmlhttp = false;
        @end @*/

        /** Every other browser on the planet */
        if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
        {
            try
            {
                xmlhttp = new XMLHttpRequest();
            }
            catch (e)
            {
                xmlhttp = false;
            }
        }

        return xmlhttp;

}



function getAXAH_(url,elementContainer,title,pageid,extra,dofunction){
	if (typeof extra == "undefined") {
		extra = false;
	}
	if (typeof dofunction == "undefined") {
		dofunction = false;
	}

	//document.getElementById(elementContainer).innerHTML = '<blink class="redtxt">Loading...<\/blink>';

	var theHttpRequest = getNewHttpObject(); 
	theHttpRequest.onreadystatechange = function() {processAXAH(elementContainer,title,pageid,extra,dofunction);};  
	theHttpRequest.open('GET', url, true); 
	theHttpRequest.send(true);

		function processAXAH(elementContainer,title,pageid,extra,dofunction)
		{
			

			
			if (theHttpRequest.readyState == 4) 
			{
			//document.getElementById(elementContainer).innerHTML = '';
				if (theHttpRequest.status == 200) 
				{
					
					
					document.getElementById(elementContainer).innerHTML = theHttpRequest.responseText; 
					var tre = theHttpRequest.responseText; 
					if(extra)
					{
						//update(title,pageid);
						//run(pageid);
					}
					if(dofunction)
					{
						//setTimeout(dofunction,0);
					}
					//var cur_disp = parent.document.getElementById('cur_disp').title; 					
				} 
				else 
				{
					document.getElementById(elementContainer).innerHTML="<p><span class='redtxt'>Error!<\/span> HTTP request return the following status message:&nbsp;" + theHttpRequest.statusText +" " + url +"<\/p>";
				}
			}
			else
			{
			//document.getElementById(elementContainer).innerHTML = theHttpRequest.readyState;			
			}	
		}
}
 


//Function used to update page content with new xhtml fragments by using a javascript object, the dom, and http.
function getAXAH(url,elementContainer,title,pageid,extra,dofunction)
{
	if (typeof extra == "undefined") 		{ 	extra = false; }
	if (typeof dofunction == "undefined") 	{ 	dofunction = false; }


	var theHttpRequest = getNewHttpObject();
	theHttpRequest.onreadystatechange = function() {processAXAH(elementContainer,title,pageid,extra,dofunction);};
	theHttpRequest.open('GET', url, true);
	theHttpRequest.send(true);

		function processAXAH(elementContainer,title,pageid,extra,dofunction)
		{
			if (theHttpRequest.readyState == 4) 
			{
				if (theHttpRequest.status == 200) 
				{
					//parent.document.getElementById(elementContainer).innerHTML = theHttpRequest.responseText;
					document.getElementById(elementContainer).innerHTML = theHttpRequest.responseText;
					//if(extra){ update(title,pageid); run(pageid); }
					//if(dofunction){ setTimeout(dofunction,0); }
					//document.getElementById('rechts').style.height = (window.innerHeight-175)+'px'; 
					
					
					
					
					window.onload = new_data(); 
				} 
				else 
				{
					document.getElementById(elementContainer).innerHTML="<p><span class='redtxt'>Error!<\/span> HTTP request return the following status message:&nbsp;" + theHttpRequest.statusText +"<\/p>";
				}
			}
			else
			{
			document.getElementById(elementContainer).innerHTML = theHttpRequest.readyState;			
			}			
		}
}



//Some things that should be run when a page is started
function run(page){
	switch(page){
		case "fleet2":
			
			break;
		
	}
}

//Mr box
function mrbox(url,width,margintop,title,method){
	var oldtitle = document.title;
	if (typeof title == "undefined") {
		title = oldtitle;
	}
	document.title = "Loading";
	document.getElementById('mrbox').style.display = 'block';

	if (typeof width != "undefined") {
		document.getElementById('mrbox_content').style.width = width+'px';
	}
	if (typeof margintop != "undefined") {
		document.getElementById('mrbox_content').style.marginTop = margintop+'px';
	}
	if(method == 'div'){
		document.getElementById('mrbox_content').innerHTML = document.getElementById(url).innerHTML;
		document.title = "title";
	}else{
		getAXAH(url,'mrbox_content',title,document.body.id,true);
	}
}
function mrbox_close(title){
	if (typeof title != "undefined") { document.title = title; }
	document.getElementById('mrbox').style.display = 'none';
	document.getElementById('mrbox_content').innerHTML = '';
}

//Simple laod page function
function loadpage(url,title,id,func){
	
	link = url+'&axah=true'; 
	if(!title) var title = '\''+link+'\''; 
	if(!pageid) var pageid = '\''+link+'\''; 	
	if(!id) var id='axah';
	func=false;
	getAXAH(link,id,title,'',false,func);
}

//And finaly the bit we've been waiting for, the ajax.
function ajax(url,elementContainer,timeout,dofunction){
	getAXAH(url,elementContainer,'','',false,dofunction);
	t=setTimeout("ajax('"+url+"','"+elementContainer+"',"+timeout+",'"+dofunction+"')",timeout);
}

//For forms
function form2get(formid) {
	//Start the string

        var str = document.getElementById(formid).action; 

         
	//Get elements int he form
	var elem = document.getElementById(formid).elements;
	//Foreach item in the form
	for(var i = 0; i < elem.length; i++){
		//if the item has a name and vlue andit not prefixed js_
		if(elem[i].name && elem[i].value && elem[i].name.substr(0,3) != 'js_'){
			//For input items
			if(elem[i].tagName.toLowerCase() == "input"){
				//If its a text item then we can jsut say the name-value
				if (elem[i].type.toLowerCase() == "text" || elem[i].type.toLowerCase() == "password" || elem[i].type.toLowerCase() == "hidden") {
					str += "&" + elem[i].name + "=" + elem[i].value;
				}
				//If its a checkbox or radio, it should only have that value if its checked.
				else if (elem[i].type.toLowerCase() == "checkbox" || elem[i].type.toLowerCase() == "radio") {
					if(elem[i].checked){
						str += "&" + elem[i].name + "=" + elem[i].value;
					}
				}
				//Otherwise just send its value
				else {
					str += "&" + elem[i].name + "=" + elem[i].value;
				}
			}
			//For select options
			else if(elem[i].tagName.toLowerCase() == "select"){
				//We need to get the value of the selected item
				str += "&" + elem[i].name + "=" + elem[i].options[elem[i].options.selectedIndex].value;
			}
			//For text boxes
			else if(elem[i].tagName.toLowerCase() == "textarea"){
				//We need to get the value of the selected item
				str += "&" + elem[i].name + "=" + elem[i].value;
			}
			
		}
	}
	return str;
}

//Sombit a form using form2get and loadpage
function submitform(formid,title,pageid,func){
	loadpage(form2get(formid),title,pageid,func);
}

//Make an alery box
function mr_alert(text,title,link){
	if (typeof title == "undefined") { title = "Alert"; }
	
	if (typeof link == "undefined") {
		link = "document.getElementById('notifyTB').style.display = 'none';";
	}else{
		link = "document.getElementById('notifyTB').style.display = 'none'; loadpage("+link+");";
	}
	
	document.getElementById('notifyTB_button').href = '#';
	document.getElementById('notifyTB_button').onclick = function(){ eval(link); };
	document.getElementById('errorBoxNotifyHead').innerHTML = title;
	document.getElementById('errorBoxNotifyContent').innerHTML = text;
	document.getElementById('notifyTB').style.display = 'block';
}

//Question box
function mr_qu(text,title,link1,link2){
	if (typeof title == "undefined") { title = "Alert"; }
	
	if (typeof link1 == "undefined") {
		link1 = "document.getElementById('decisionTB').style.display = 'none';";
	}else{
		link1 = "document.getElementById('decisionTB').style.display = 'none'; loadpage("+link1+");";
	}
	if (typeof link2 == "undefined") {
		link2 = "document.getElementById('decisionTB').style.display = 'none';";
	}else{
		link2 = "document.getElementById('decisionTB').style.display = 'none'; loadpage("+link2+");";
	}
	
	document.getElementById('decisionTB_button1').href = '#';
	document.getElementById('decisionTB_button1').onclick = function(){ eval(link1); };
	document.getElementById('decisionTB_button2').href = '#';
	document.getElementById('decisionTB_button2').onclick = function(){ eval(link2); };
	document.getElementById('errorBoxDecisionHead').innerHTML = title;
	document.getElementById('errorBoxDecisionContent').innerHTML = text;
	document.getElementById('decisionTB').style.display = 'block';
}



////////////////////////

//object detection to return the correct object depending upon broswer type. Used by the getAXHA(); function.
function getNewHttpObject___________________() {
	 var objType = false;
	 try {
		  objType = new ActiveXObject('Msxml2.XMLHTTP');
	 } catch(e) {
		  try {
				objType = new ActiveXObject('Microsoft.XMLHTTP');
		  } catch(e) {
				objType = new XMLHttpRequest();
		  }
	 }
	 return objType;
}

//Function used to update page content with new xhtml fragments by using a javascript object, the dom, and http.
function getAXAH_________________(url,elementContainer,title,pageid,extra,dofunction){
	if (typeof extra == "undefined") {
		extra = false;
	}
	if (typeof dofunction == "undefined") {
		dofunction = false;
	}

	//document.getElementById(elementContainer).innerHTML = '<blink class="redtxt">Loading...<\/blink>';
	var theHttpRequest = getNewHttpObject();
	theHttpRequest.onreadystatechange = function() {processAXAH(elementContainer,title,pageid,extra,dofunction);};
	theHttpRequest.open("GET", url);
	theHttpRequest.send(false);

		function processAXAH(elementContainer,title,pageid,extra,dofunction){
			if (theHttpRequest.readyState == 4) {
				if (theHttpRequest.status == 200) {
					document.getElementById(elementContainer).innerHTML = theHttpRequest.responseText;
					if(extra){
						update(title,pageid);
						run(pageid);
					}
					if(dofunction){
						setTimeout(dofunction,0);
					}
					document.getElementById('rechts').style.height = (window.innerHeight-175)+'px';
				} else {
					document.getElementById(elementContainer).innerHTML="<p><span class='redtxt'>Error!<\/span> HTTP request return the following status message:&nbsp;" + theHttpRequest.statusText +"<\/p>";
				}
			}
		}

}


//Some things that should be run when a page is started
function run_________(page){
	switch(page){
		case "fleet2":
			
			break;
		
	}
}

//Mr box
function mrbox___________(url,width,margintop,title,method){
	var oldtitle = document.title;
	if (typeof title == "undefined") {
		title = oldtitle;
	}
	document.title = "Loading";
	document.getElementById('mrbox').style.display = 'block';

	if (typeof width != "undefined") {
		document.getElementById('mrbox_content').style.width = width+'px';
	}
	if (typeof margintop != "undefined") {
		document.getElementById('mrbox_content').style.marginTop = margintop+'px';
	}
	if(method == 'div'){
		document.getElementById('mrbox_content').innerHTML = document.getElementById(url).innerHTML;
		document.title = "title";
	}else{
		getAXAH(url,'mrbox_content',title,document.body.id,true);
	}
}
function mrbox_close___________(title){
	if (typeof title != "undefined") { document.title = title; }
	document.getElementById('mrbox').style.display = 'none';
	document.getElementById('mrbox_content').innerHTML = '';
}

//Simple laod page function
function loadpage___________(url,title,pageid,func){
	document.title = "Loading";
	document.getElementById('cur_page').value = url;
	link = url+'&axah=true';
	getAXAH(link,'axah',title,pageid,true,func);
}

//And finaly the bit we've been waiting for, the ajax.
function ajax________________(url,elementContainer,timeout,dofunction){
	getAXAH(url,elementContainer,'','',false,dofunction);
	t=setTimeout("ajax('"+url+"','"+elementContainer+"',"+timeout+",'"+dofunction+"')",timeout);
}

//For forms
function form2get________________(formid) {
	//Start the string
	var str = document.getElementById(formid).action;
	//Get elements int he form
	var elem = document.getElementById(formid).elements;
	//Foreach item in the form
	for(var i = 0; i < elem.length; i++){
		//if the item has a name and vlue andit not prefixed js_
		if(elem[i].name && elem[i].value && elem[i].name.substr(0,3) != 'js_'){
			//For input items
			if(elem[i].tagName.toLowerCase() == "input"){
				//If its a text item then we can jsut say the name-value
				if (elem[i].type.toLowerCase() == "text" || elem[i].type.toLowerCase() == "password" || elem[i].type.toLowerCase() == "hidden") {
					str += "&" + elem[i].name + "=" + elem[i].value;
				}
				//If its a checkbox or radio, it should only have that value if its checked.
				else if (elem[i].type.toLowerCase() == "checkbox" || elem[i].type.toLowerCase() == "radio") {
					if(elem[i].checked){
						str += "&" + elem[i].name + "=" + elem[i].value;
					}
				}
				//Otherwise just send its value
				else {
					str += "&" + elem[i].name + "=" + elem[i].value;
				}
			}
			//For select options
			else if(elem[i].tagName.toLowerCase() == "select"){
				//We need to get the value of the selected item
				str += "&" + elem[i].name + "=" + elem[i].options[elem[i].options.selectedIndex].value;
			}
			//For text boxes
			else if(elem[i].tagName.toLowerCase() == "textarea"){
				//We need to get the value of the selected item
				str += "&" + elem[i].name + "=" + elem[i].value;
			}
			
		}
	}
	return str;
}

//Sombit a form using form2get and loadpage
function submitform________________(formid,title,pageid,func){
	loadpage(form2get(formid),title,pageid,func);
}

//Make an alery box
function mr_alert______________(text,title,link){
	if (typeof title == "undefined") { title = "Alert"; }
	
	if (typeof link == "undefined") {
		link = "document.getElementById('notifyTB').style.display = 'none';";
	}else{
		link = "document.getElementById('notifyTB').style.display = 'none'; loadpage("+link+");";
	}
	
	document.getElementById('notifyTB_button').href = '#';
	document.getElementById('notifyTB_button').onclick = function(){ eval(link); };
	document.getElementById('errorBoxNotifyHead').innerHTML = title;
	document.getElementById('errorBoxNotifyContent').innerHTML = text;
	document.getElementById('notifyTB').style.display = 'block';
}

//Question box
function mr_qu______(text,title,link1,link2){
	if (typeof title == "undefined") { title = "Alert"; }
	
	if (typeof link1 == "undefined") {
		link1 = "document.getElementById('decisionTB').style.display = 'none';";
	}else{
		link1 = "document.getElementById('decisionTB').style.display = 'none'; loadpage("+link1+");";
	}
	if (typeof link2 == "undefined") {
		link2 = "document.getElementById('decisionTB').style.display = 'none';";
	}else{
		link2 = "document.getElementById('decisionTB').style.display = 'none'; loadpage("+link2+");";
	}
	
	document.getElementById('decisionTB_button1').href = '#';
	document.getElementById('decisionTB_button1').onclick = function(){ eval(link1); };
	document.getElementById('decisionTB_button2').href = '#';
	document.getElementById('decisionTB_button2').onclick = function(){ eval(link2); };
	document.getElementById('errorBoxDecisionHead').innerHTML = title;
	document.getElementById('errorBoxDecisionContent').innerHTML = text;
	document.getElementById('decisionTB').style.display = 'block';
}

