var xmlHttp

function showSuboffers(str1,str2,str3,str4,str5,str6)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	var url="ajax_getsuboffer.php"
	url=url+"?q1="+str1
	url=url+"&q2="+str2
	url=url+"&q3="+str3
	url=url+"&q4="+str4
	url=url+"&q5="+str5
	url=url+"&q6="+str6
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=function() {
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
			document.getElementById("subofferspane").innerHTML=xmlHttp.responseText 
		} 
	} 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function delRestriction(offers_id, suboffers_id) { 
	xmlHttp=GetXmlHttpObject()
	
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request")
		return
	} 
	
	var url="offers_checkhot.php"
	url=url+"?ajax_offers_id="+offers_id
	url=url+"&ajax_suboffers_id="+suboffers_id
	url=url+"&ajax_hot=0"
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=function() {
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
			document.getElementById("txtHint_"+suboffers_id).innerHTML=xmlHttp.responseText 
		} 
	} 
	
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function addRestriction(offers_id, suboffers_id) { 
	xmlHttp=GetXmlHttpObject()
	
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request")
		return
	} 
	
	var url="offers_checkhot.php"
	url=url+"?ajax_offers_id="+offers_id
	url=url+"&ajax_suboffers_id="+suboffers_id
	url=url+"&ajax_hot=1"
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=function() {
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
			document.getElementById("txtHint_"+suboffers_id).innerHTML=xmlHttp.responseText 
		} 
	} 
	
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function addForMail(offers_id, suboffers_id) { 
	xmlHttp=GetXmlHttpObject()
	
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request")
		return
	} 
	
	var url="offers_checkmails.php"
	url=url+"?ajax_offers_id="+offers_id
	url=url+"&ajax_suboffers_id="+suboffers_id
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=function() {
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
			document.getElementById("RightfloatLayer").innerHTML=xmlHttp.responseText 
		} 
	} 
	
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function delFromMail(offers_id, suboffers_id) { 
	xmlHttp=GetXmlHttpObject()
	
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request")
		return
	} 
	
	var url="offers_checkmails.php"
	url=url+"?ajax_offers_id="+offers_id
	url=url+"&ajax_suboffers_id="+suboffers_id
	url=url+"&ajax_del_mail=1"
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=function() {
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
			document.getElementById("RightfloatLayer").innerHTML=xmlHttp.responseText 
		} 
	} 
	
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}


function delAllOffers(usersc_id) { 
	xmlHttp=GetXmlHttpObject()
	
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request")
		return
	} 
	
	var url="offers_checkmails.php"
	url=url+"?ajax_usersc_id="+usersc_id
	url=url+"&ajax_del_all=1"
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=function() {
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
			document.getElementById("RightfloatLayer").innerHTML=xmlHttp.responseText 
		} 
	}
	
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function ShowOffers(usersc_id, pid) { 
	xmlHttp=GetXmlHttpObject()
	
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request")
		return
	} 
	
	var url="offers_checkmails.php"
	url=url+"?ajax_usersc_id="+usersc_id
	url=url+"&pid="+pid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=function() {
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
			document.getElementById("RightfloatLayer").innerHTML=xmlHttp.responseText 
		} 
	}
	
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}


function cancelChanges(usersc_id) { 
	xmlHttp=GetXmlHttpObject()
	
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request")
		return
	} 
	
	var url="offers_checkmails.php"
	url=url+"?ajax_usersc_id="+usersc_id
	url=url+"&ajax_cancel_changes=1"
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=function() {
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
			document.getElementById("RightfloatLayer").innerHTML=xmlHttp.responseText 
		} 
	}
	
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateChanged() {
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
		document.getElementById("txtHint").innerHTML=xmlHttp.responseText 
	} 
}

function stateChanged2() {
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
		document.getElementById("txtHint2").innerHTML=xmlHttp.responseText 
	} 
}

function GetXmlHttpObject() {
	var xmlHttp=null;
	try	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	
	catch (e) {
		//Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}
