function AddFavorites(){
    this.mode = null;
}
AddFavorites.prototype = new DXMLHttpRequestShell();
AddFavorites.constructor = AddFavorites;
AddFavorites.prototype.sendQuery = function(url, id) {
    this.mode = "add";
    this.init();
    try{
        this.fastGetUrl(url + id + "/addfavorites.html");
    }
    catch(e)
    {
        this.fastGetUrl(url + id + "/addfavorites.html");
    }
}
AddFavorites.prototype.sendQueryRemove = function(url, id) {
    this.mode = "remove";
    this.init();
    
    try{
        this.fastGetUrl(url + id + "/removefavorites.html");
    }
    catch(e)
    {
        this.fastGetUrl(url + id + "/removefavorites.html");
    }
}
AddFavorites.prototype.onLoad = function() {
    if (this.mode == "add") {
		if(this.getResponseText() == "no") {
			showMessageWindow("onFav");
		} else {
			showMessageWindow("okFav");
		}
	} else if (this.mode == "remove") {
		showMessageWindow("delFav");
	   //handleCategorySelect(document.getElementById("vendorCategories").options[document.getElementById("vendorCategories").selectedIndex].value);
	}
}


function AddCustomerFavorites(currentControl){
    this.mode = null;
    this.control = currentControl;
}
AddCustomerFavorites.prototype = new DXMLHttpRequestShell();
AddCustomerFavorites.constructor = AddFavorites;
AddCustomerFavorites.prototype.sendQuery = function(url, id) {
	
    this.mode = "add";
    this.init();
    
    try{
        this.fastGetUrl(url + id + "/addcustomerfavorites.html");
    }
    catch(e)
    {
        this.fastGetUrl(url + id + "/addcustomerfavorites.html");
    }
}
AddCustomerFavorites.prototype.sendQueryRemove = function(url, id) {
    this.mode = "remove";
    this.init();
    
    try {
        this.fastGetUrl(url + id + "/removecustomerfavorites.html");
    } catch(e) {
        this.fastGetUrl(url + id + "/removecustomerfavorites.html");
    }
}
AddCustomerFavorites.prototype.onLoad = function() {
    if (this.mode == "add") {
		if(this.getResponseText() == "no") {
			showMessageWindow("onFav", this.control);
		} else {
			showMessageWindow("okFav", this.control);
		}
	} else if (this.mode == "remove") {
		showMessageWindow("delFav", this.control);
	}
}

function AddCustomVendor(){
}
AddCustomVendor.prototype = new DXMLHttpRequestShell();
AddCustomVendor.costrutcor = AddCustomVendor();
AddCustomVendor.prototype.Send = function (url, name) {
	this.init();
    try {
        this.fastGetUrl(url + "addcustomvendor/" + name);
    }
    catch(e) {
        this.fastGetUrl(url + "addcustomvendor/" + name);
    }
}
AddCustomVendor.prototype.onLoad = function() {
	alert("OK");
}

function UserReport(){
    this.mode = null;
}
UserReport.prototype = new DXMLHttpRequestShell();
UserReport.constructor = UserReport;
UserReport.prototype.sendQuery = function(url, id) {
    this.mode = "add";
    this.init();
    try{
        this.fastGetUrl(url + id + "/userreport.html");
    }
    catch(e)
    {
        this.fastGetUrl(url + id + "/userreport.html");
    }
}
UserReport.prototype.onLoad = function() {
	
    if (this.mode == "add") {
		if(this.getResponseText() == "no") {
			alert("Вече сте докладвали този потребител.");
		} else {
			alert("Благодарим Ви за съобщенито. \n Възможно най-скоро ще бъде разгледано от администратор.");
		}
	} else if (this.mode == "remove") {
	   handleCategorySelect(document.getElementById("vendorCategories").options[document.getElementById("vendorCategories").selectedIndex].value);
	}
}


function ChangeMailStatus(){
}
ChangeMailStatus.prototype = new DXMLHttpRequestShell();
ChangeMailStatus.constructor = ChangeMailStatus;
ChangeMailStatus.prototype.sendStatus = function(mailID) {
    this.init();
    try{
	this.fastGetUrl("http://10.10.10.100/bulki/changemailstatus/" + mailID);
    }
    catch(e)
    {
	this.fastGetUrl("http://www.10.10.10.100/bulki/changemailstatus/" + mailID);
    }
}
ChangeMailStatus.prototype.onLoad = function() {
	//
}

function CheckUser() {
}
CheckUser.prototype = new DXMLHttpRequestShell();
CheckUser.constructor = CheckUser;
CheckUser.prototype.onLoad = function() {
	if(this.getResponseText() == "yes" || this.getResponseText() == "\nyes")
		sleep(0);
	else
		sleep(1);
}
CheckUser.prototype.CheckLogin = function(username, password) {
this.init();
this.fastGetUrl("checkloginuser/" + username + "/" + password);
}
// *************************
// DXMLHttpRequest Class end
// *************************