﻿	/*	
	 * File:	ajax.js
	 * Author: 	Kotecki Robert
	 * Version: 1.0.0
	 * Data:	21.10.2006 r.
	 * 
	 * Funkcje odpowiedzialne za komunikacje serwer-klient za pomoca protokolu http
	 */
	 
	/* HTMLHttp - funkcje inicjajace polaczenie z serwerem w trybie html */
	function HTMLHttp() 
	{
		var con = false; 
		
		if (window.XMLHttpRequest) 
		{
			con = new XMLHttpRequest();
		} 
		else 
		{
			if (window.ActiveXObject) 
			{
				isIE = true;
				
				try 
				{
				   con = new ActiveXObject("Msxml2.XMLHTTP");
				} 
				catch (e) 
				{
					try 
					{
					   con = new ActiveXObject("Microsoft.XMLHTTP");
					} 
					catch (e) 				
					{
						alert('Twoja przeglądarka nie spełnia wymagań');
					}
				}			
			}
		}

		return con;
	}
	
	/* HTMLHttp - funkcje inicjajace polaczenie z serwerem w trybie xml	 */
	function XMLHttp() 
	{
		var con = null; 
		
		if (window.XMLHttpRequest) 
		{
			con = new XMLHttpRequest();
			if (con.overrideMimeType) 
			{
				con.overrideMimeType('text/xml');
			}
		} 
		else 
		{
			if (window.ActiveXObject) 
			{
				isIE = true;
				
				try 
				{
				   con = new ActiveXObject("Msxml2.XMLHTTP");
				} 
				catch (e) 
				{
					try 
					{
						con = new ActiveXObject("Microsoft.XMLHTTP");
					} 
					catch (e) 				
					{
						alert('Twoja przeglądarka nie spełnia wymagań');
					}
				}			
			}
		}

		return con;
	}
