function Sw(pid) {
var b=document.getElementById(pid).value;
GetUrl('/act/customers.php?q='+b,'includearea');
}

function GetUrl(url,obj_id) {
var xmlhttp=false;

// connecting
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }

if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp=false;
}
}
if (!xmlhttp && window.createRequest) {
try {
xmlhttp = window.createRequest();
} catch (e) {
xmlhttp=false;
}
}

 xmlhttp.open("GET", url,true);
 xmlhttp.onreadystatechange=function() {
  if (xmlhttp.readyState==4) {
	  document.getElementById(obj_id).innerHTML=xmlhttp.responseText;
  }
 }
 xmlhttp.send(null);


}


var xmlhttp;
function loadXMLDoc(url)
{
xmlhttp=null
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest()
  }
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
if (xmlhttp!=null)
  {
  xmlhttp.onreadystatechange=state_Change
  xmlhttp.open("GET",url,true)
  xmlhttp.send(null);
  }
else
  {
  alert ("Your browser does not support XMLHTTP.")
  }
}

function PostUrl(url,dati) {
xmlhttp=null
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest()
  }
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  }

if (xmlhttp!=null) {
  
  xmlhttp.onreadystatechange = state_Change_noscript
  xmlhttp.open( 'POST', url, true )
  xmlhttp.setRequestHeader( 'Content-type','application/x-www-form-urlencoded' )
  xmlhttp.setRequestHeader( 'Content-length',dati.length )
  xmlhttp.setRequestHeader( 'Connection', 'close')
  xmlhttp.send( dati )

} else {
  alert ("Your browser does not support XMLHTTP");
}

}



function state_Change()
{
if (xmlhttp.readyState==4)
  {
  if (xmlhttp.status==200)
    {
	var respTxt = xmlhttp.responseText;
	if (respTxt) {
		alert (xmlhttp.responseText);
	}
	if ( window.RefLink ) {
		reflinks = RefLink();
		GetUrl(reflinks,'shopm2');
	}

    }
  else
    {
    alert ("Problem retrieving XML data");
    }
  }
}

function state_Change_noscript()
{
if (xmlhttp.readyState==4)
  {
  if (xmlhttp.status==200)
    {
	var respTxt = xmlhttp.responseText;
	if (respTxt) {
		alert (xmlhttp.responseText);
	}
    }
  else
    {
    alert ("Problem retrieving XML data");
    }
  }
}


function URLEncode(plaintext){
	// The Javascript escape and unescape functions do not correspond
	// with what browsers actually do...
	var SAFECHARS = "0123456789" +					// Numeric
					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetic
					"abcdefghijklmnopqrstuvwxyz" +
					"-_.!~*'()";					// RFC2396 Mark characters
	var HEX = "0123456789ABCDEF";

	var encoded = "";
	for (var i = 0; i < plaintext.length; i++ ) {
		var ch = plaintext.charAt(i);
	    if (ch == " ") {
		    encoded += "+";
		} else if (SAFECHARS.indexOf(ch) != -1) {
		    encoded += ch;
		} else {
		    var charCode = ch.charCodeAt(0);
			if (charCode > 255) {
				encoded += ch;
			} else {
				encoded += "%";
				encoded += HEX.charAt((charCode >> 4) & 0xF);
				encoded += HEX.charAt(charCode & 0xF);
			}
		}
	} // for

	return encoded;
}


function ChkMsg2() {
var xmlhttp=false;
url='/chkmsg.php?o=';
// connecting
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }

if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) { xmlhttp=false; }
}
if (!xmlhttp && window.createRequest) {
try { xmlhttp = window.createRequest(); } catch (e) { xmlhttp=false; }
}
 
 xmlhttp.open("GET",url,true);
 xmlhttp.onreadystatechange=function() {
  if (xmlhttp.readyState==4) {
	  if (xmlhttp.status==200) {
		var respTxt = xmlhttp.responseText;
		if (respTxt) {
			openWin("/newmsg.php?cnt="+respTxt,'usrmsgcnt',150,80);
		}
	  }
  }
 }
 xmlhttp.send(null);


}



var xmlhttp;
function loadXMLDoc2(url)
{
xmlhttp=null
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest()
  }
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
if (xmlhttp!=null)
  {
  xmlhttp.onreadystatechange=state_Change2
  xmlhttp.open("GET",url,true)
  xmlhttp.send(null);
  }
else
  {
  alert ("Your browser does not support XMLHTTP.")
  }
}

function state_Change2()
{
if (xmlhttp.readyState==4)
  {
  if (xmlhttp.status==200)
    {
	var respTxt = xmlhttp.responseText;
	if (respTxt) {
		alert (xmlhttp.responseText);
	}
    }
  else
    {
    alert ("Problem retrieving XML data");
    }
  }
}



function PostEval(url,dati) {
xmlhttp=null
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest()
  }
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  }

if (xmlhttp!=null) {
  
  xmlhttp.onreadystatechange = state_eval
  xmlhttp.open( 'POST', url, true )
  xmlhttp.setRequestHeader( 'Content-type','application/x-www-form-urlencoded' )
  xmlhttp.setRequestHeader( 'Content-length',dati.length )
  xmlhttp.setRequestHeader( 'Connection', 'close')
  xmlhttp.send( dati )

} else {
  alert ("Your browser does not support XMLHTTP");
}

}



function state_eval()
{
if (xmlhttp.readyState==4)
  {
  if (xmlhttp.status==200)
    {
	var respTxt = xmlhttp.responseText;
	if (respTxt) {
		eval(respTxt);
	}

    }
  else
    {
    alert ("Problem retrieving XML data");
    }
  }
}


function ReplaceSpecialChars(v) {
	v = v.replace(/\&/g,"%26");
	v = v.replace(/\+/g,"%2B");
	v = v.replace(/\?/g,"%3F");
	a = v;
	return a;
}

function UrlEnc(data) {
data=data.replace(/\+/i, "%2B");
data=data.replace(/ /gi, "%20");
return data;
}