
var home_url = 'http://www.hosting24coupon.net';
var home_dir = '';


dochref = document.location.href.substr(document.location.href.search('/')+2, 1000);
if(dochref.search('/') == -1){
	$thisurl = document.location.href.substr(0,document.location.href.search('/')+2) + dochref;
} else {
	$thisurl = document.location.href.substr(0,document.location.href.search('/')+2) + dochref.substr(0, dochref.search('/'));
}
$thisurl = $thisurl + '';

var xmlhttp
/*@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 @*/

if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
{
  try {
	xmlhttp = new XMLHttpRequest ();
  }
  catch (e) {
  xmlhttp = false}
}

function myXMLHttpRequest ()
{
  var xmlhttplocal;
  try {
  	xmlhttplocal = new ActiveXObject ("Msxml2.XMLHTTP")}
  catch (e) {
	try {
	xmlhttplocal = new ActiveXObject ("Microsoft.XMLHTTP")}
	catch (E) {
	  xmlhttplocal = false;
	}
  }

  if (!xmlhttplocal && typeof XMLHttpRequest != 'undefined') {
	try {
	  var xmlhttplocal = new XMLHttpRequest ();
	}
	catch (e) {
	  var xmlhttplocal = false;
	}
  }
  return (xmlhttplocal);
}

var mnmxmlhttp = Array ();
var xvotesString = Array ();
var mnmPrevColor = Array ();
var responsestring = Array ();
var myxmlhttp = Array ();
var responseString = new String;

function ActionConfirm(url)
{
	if (confirm('Are you sure you want to do this action?'))
		window.location.href= url;
}

function ApproveReview(id)
{
	if (xmlhttp)
	{
		url =  "../admin_comments.php";
		content = "id=" + id + "&action=approve";
		target = document.getElementById("adminlinks-"+id);
		target.innerHTML = "wait...";
		
		mnmxmlhttp[0] = new myXMLHttpRequest ();
		if (mnmxmlhttp)
		{
			mnmxmlhttp[0].open ("POST", url, true);
			mnmxmlhttp[0].setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded');
			mnmxmlhttp[0].send(content);
			mnmxmlhttp[0].onreadystatechange = function ()
			{
				if (mnmxmlhttp[0].readyState == 4)
				{
					result = mnmxmlhttp[0].responseText;
					target.innerHTML = result;
				}
			}
		}
	}
}

function RemoveReview(id)
{
	if (xmlhttp)
	{
		url =  "../admin_comments.php";
		content = "id=" + id + "&action=remove";
		target = document.getElementById("adminlinks-"+id);
		target.innerHTML = "wait...";
		
		mnmxmlhttp[0] = new myXMLHttpRequest ();
		if (mnmxmlhttp)
		{
			mnmxmlhttp[0].open ("POST", url, true);
			mnmxmlhttp[0].setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded');
			mnmxmlhttp[0].send(content);
			mnmxmlhttp[0].onreadystatechange = function ()
			{
				if (mnmxmlhttp[0].readyState == 4)
				{
					result = mnmxmlhttp[0].responseText;
					target.innerHTML = result;
				}
			}
		}
	}
}

function RemoveCoupon(id)
{
	if (xmlhttp)
	{
		url =  "../admin_coupons.php";
		content = "id=" + id + "&action=remove";
		target = document.getElementById("adminlinks-"+id);
		target.innerHTML = "wait...";
		
		mnmxmlhttp[0] = new myXMLHttpRequest ();
		if (mnmxmlhttp)
		{
			mnmxmlhttp[0].open ("POST", url, true);
			mnmxmlhttp[0].setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded');
			mnmxmlhttp[0].send(content);
			mnmxmlhttp[0].onreadystatechange = function ()
			{
				if (mnmxmlhttp[0].readyState == 4)
				{
					result = mnmxmlhttp[0].responseText;
					target.innerHTML = result;
				}
			}
		}
	}
}

function ApproveCoupon(id)
{
	if (xmlhttp)
	{
		url =  "../admin_coupons.php";
		content = "id=" + id + "&action=approve";
		target = document.getElementById("approvecoupon-"+id);
		target.innerHTML = "wait...";
		
		mnmxmlhttp[0] = new myXMLHttpRequest ();
		if (mnmxmlhttp)
		{
			mnmxmlhttp[0].open ("POST", url, true);
			mnmxmlhttp[0].setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded');
			mnmxmlhttp[0].send(content);
			mnmxmlhttp[0].onreadystatechange = function ()
			{
				if (mnmxmlhttp[0].readyState == 4)
				{
					result = mnmxmlhttp[0].responseText;
					target.innerHTML = result;
				}
			}
		}
	}
}

function RateCoupon(id, value)
{
	if (xmlhttp)
	{
		url =  "../rate_coupon.php";
		content = "id=" + id + "&value=" + value;
		target = document.getElementById("ratecoupon-"+id);
		target.innerHTML = "wait...";
		
		mnmxmlhttp[0] = new myXMLHttpRequest ();
		if (mnmxmlhttp)
		{
			mnmxmlhttp[0].open ("POST", url, true);
			mnmxmlhttp[0].setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded');
			mnmxmlhttp[0].send(content);
			mnmxmlhttp[0].onreadystatechange = function ()
			{
				if (mnmxmlhttp[0].readyState == 4)
				{
					result = mnmxmlhttp[0].responseText;
					target.innerHTML = result;
				}
			}
		}
	}
}

function Notify(code)
{
	if (xmlhttp)
	{
		url =  "../notify.php";
		content = "code=" + code;
		
		mnmxmlhttp[0] = new myXMLHttpRequest ();
		if (mnmxmlhttp)
		{
			mnmxmlhttp[0].open ("POST", url, true);
			mnmxmlhttp[0].setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded');
			mnmxmlhttp[0].send(content);
			mnmxmlhttp[0].onreadystatechange = function ()
			{
				if (mnmxmlhttp[0].readyState == 4)
				{
					result = mnmxmlhttp[0].responseText;
					//target.innerHTML = result;
				}
			}
		}
	}
}
