function GetIEversion()
{
  var ua = window.navigator.userAgent;
  var msie = ua.indexOf ("MSIE");

  if ( msie > 0 )      // If Internet Explorer, return version number
     return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )));
  else                 // If another browser, return 0
     return 0;
}
function GetPNG(png_path)
{
	if (GetIEversion()<7 && GetIEversion()>5)
		return "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', src='"+png_path+"');";
	else
		return "background-image:url('"+png_path+"');";
}




function getXMLHTTP()
{
	try	
	{
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch(ex)
	{
		var notIECompatibleXMLHTTP=true;
	}
	
	if(notIECompatibleXMLHTTP==true)
	{
		try
		{
			request_o = new XMLHttpRequest();
		}
		catch(ex)
		{
			request_o = false;
		}
	}
	return request_o;
}
var delim="|";		//delimiter
var XMLHTTP_Func=null;		//current function in process

//init async object
var XMLHTTP_o=null;
if(XMLHTTP_o=getXMLHTTP())
{
	//ok
}
else
{
	alert('The internet browser program you are using is\nnot compatible with some functions of this site...');
}

//async call
function AKP_XMLHTTP(func,url,vars,method)
{
	if (method=="GET")
		url=url+"&nocache="+Math.random();
	XMLHTTP_Func=func;
	XMLHTTP_o.open(method,url,"true");
	if (method=="POST")
		XMLHTTP_o.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
	XMLHTTP_o.onreadystatechange = AKP_CallBack;
	if (method=="POST")
		XMLHTTP_o.send(vars+"&nocache="+Math.random());
	else
		XMLHTTP_o.send(null);
}



function setCookie(c_name,value,expiredays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+	((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
function getCookie(c_name)
{
	if (document.cookie.length>0)
	{
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1)
		{ 
			c_start=c_start + c_name.length+1; 
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
				return unescape(document.cookie.substring(c_start,c_end));
		} 
	}
	return "";
}