function NoEnter(Field)
{
var key;
if(window.event)
{
key = window.event.keyCode;
}
else
{
key = e.which;
}
if (key == 13)
{
document.getElementById('pointBal').focus();
}
}
function CheckEnter(ButtonName, e)
{
var key;
if(window.event)
{
key = window.event.keyCode;
}
else
{
key = e.which;
}
if (key == 13)
{
//Get the button the user wants to have clicked
var btn = document.getElementById(ButtonName);
if (btn != null)
{
// If we find the button click it
btn.click();
try
{
event.keyCode = 0;
}
catch (e)
{ }
}
}
}
function MailSameChange()
{
if (document.getElementById('MailSame').checked)
{
document.getElementById('MailAddr1').value = document.getElementById('LocAddr1').value;
document.getElementById('MailAddr2').value = document.getElementById('LocAddr2').value;
document.getElementById('MailCity').value = document.getElementById('LocCity').value;
document.getElementById('MailState').selectedIndex = document.getElementById('LocState').selectedIndex;
document.getElementById('MailZip').value = document.getElementById('LocZip').value;
document.getElementById('MailCtry').selectedIndex = document.getElementById('LocCountry').selectedIndex;
document.getElementById('mailsame_show').style.visibility='hidden';
document.getElementById('mailsame_show').style.display='none';
}
else
{
document.getElementById('MailAddr1').value = '';
document.getElementById('MailAddr2').value = '';
document.getElementById('MailCity').value = '';
document.getElementById('MailState').selectedIndex = 0;
document.getElementById('MailZip').value = '';
document.getElementById('MailCtry').selectedIndex = 0;
document.getElementById('mailsame_show').style.display='inline';
document.getElementById('mailsame_show').style.visibility='visible';
}
}
function ResetMailSame()
{
document.getElementById('MailSame').checked = false;
}
function SetupConnection()
{
var req = false;
// For Safari, Firefox, and other non-MS browsers
if (window.XMLHttpRequest)
{
try
{
req = new XMLHttpRequest();
}
catch (e)
{
req = false;
}
}
else if (window.ActiveXObject)
{
// For Internet Explorer on Windows
try
{
req = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
req = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
req = false;
}
}
}
return req;
}
function ClearFilters()
{
try
{
document.getElementById('RewType').selectedIndex = 0;
}
catch(e)
{ }
try
{
document.getElementById('Fulfill').selectedIndex = 0;
}
catch(e)
{ }
try
{
document.getElementById('SearchText').value = "";
}
catch(e)
{ }
ShowRewards();
}
var CurRewType = '';
var CurFulfill = '';
function ShowRewards(OrderBy, Direction)
{
document.getElementById('WaitScreenMsg').innerHTML = "Loading Rewards, Please Wait . . .";
document.getElementById('Grayout').style.display = "block";
document.getElementById('WaitScreen').style.display = "block";
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
document.getElementById('RewardsTable').innerHTML = HTML;
}
else
{
document.getElementById('RewardsTable').innerHTML = "";
}
}
document.getElementById('Grayout').style.display = "none";
document.getElementById('WaitScreen').style.display = "none";
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var RewType = '';
var Fulfill = '';
var SearchText = '';
try
{
RewType = document.getElementById('RewType').options[document.getElementById('RewType').selectedIndex].value;
}
catch (e)
{ }
try
{
Fulfill = document.getElementById('Fulfill').options[document.getElementById('Fulfill').selectedIndex].value;
}
catch (e)
{ }
try
{
SearchText = document.getElementById('SearchText').value;
}
catch (e)
{ }
if (CurRewType != RewType && RewType == "All")
{
Fulfill = "All";
SearchText = "";
}
CurRewType = RewType;
CurFulfill = Fulfill;
if (RewType == "All") RewType = "";
if (Fulfill == "All") Fulfill = "";
RewType = encodeURIComponent(RewType);
Fulfill = encodeURIComponent(Fulfill);
SearchText = encodeURIComponent(SearchText);
var Data = 'ShowRewards=1';
Data = Data + '&OrderBy=' + OrderBy + '&Direction=' + Direction + '&RewType=' + RewType + '&Fulfill=' + Fulfill + '&SearchText=' + SearchText;
Show.send(Data);
}
var UpdatingQty = false;
function UpdateQty(Data, ID, Points)
{
UpdatingQty = true;
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
var PointBal = Send.responseText;
if (PointBal)
{
document.getElementById('pointBal').value = PointBal;
}
UpdatingQty = false;
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'UpdateQty=1&ID=' + ID + '&Qty=' + Data.value + '&Points=' + Points;
Send.send(Data);
}
function ClearOrder()
{
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
var PointBal = Send.responseText;
if (PointBal)
{
document.getElementById('pointBal').value = PointBal;
}
}
ShowRewards();
ClearFilters();
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ClearOrder=1';
Send.send(Data);
}
function PayForPoints()
{
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
document.getElementById('ReviewTable').innerHTML = HTML;
}
}
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'PayForPoints=1';
Show.send(Data);
}
function ProcessPayment()
{
if (location.href.indexOf("KPSSredeemRewards") < 0)
{
var Mode = "Live";
}
else
{
var Mode = "Test";
}
var CCType = document.getElementById('CCType').options[document.getElementById('CCType').selectedIndex].value;
var CCNumber = document.getElementById('CCNumber').value;
var CCExpire = document.getElementById('CCExpire').value;
var FName = document.getElementById('FName').value;
var LName = document.getElementById('LName').value;
var Address = document.getElementById('Address').value;
var City = document.getElementById('City').value;
var State = document.getElementById('State').value;
var Zip = document.getElementById('Zip').value;
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
var HTML = Send.responseText;
if (HTML)
{
document.getElementById('ReviewTable').innerHTML = HTML;
}
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ProcessPayment=1&Mode=' + encodeURIComponent(Mode) + '&CCType=' + encodeURIComponent(CCType) + '&CCNumber=' + encodeURIComponent(CCNumber) + '&CCExpire=' + encodeURIComponent(CCExpire) + '&FName=' + encodeURIComponent(FName) + '&LName=' + encodeURIComponent(LName) + '&Address=' + encodeURIComponent(Address) + '&City=' + encodeURIComponent(City) + '&State=' + encodeURIComponent(State) + '&Zip=' + encodeURIComponent(Zip);
Send.send(Data);
}
function ReviewOrder()
{
if (UpdatingQty == true)
{
setTimeout("ReviewOrder()", 250);
}
else
{
if (document.getElementById('pointBal').value < 0)
{
var PointBal = document.getElementById('pointBal').value;
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
document.getElementById('ReviewTable').innerHTML = HTML;
document.getElementById('RewardsDiv').style.display = "none";
document.getElementById('ReviewDiv').style.display = "block";
}
else
{
alert("Not Enough Points");
}
}
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ReviewOrder=1&PointBal=' + encodeURIComponent(PointBal);
Show.send(Data);
}
else
{
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
document.getElementById('ReviewTable').innerHTML = HTML;
document.getElementById('RewardsDiv').style.display = "none";
document.getElementById('ReviewDiv').style.display = "block";
}
else
{
alert("No Items Selected");
}
}
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ReviewOrder=1';
Show.send(Data);
}
}
}
function BackToRewards()
{
document.getElementById('ReviewDiv').style.display = "none";
document.getElementById('RewardsDiv').style.display = "block";
}
function FinalizeOrder()
{
var SalEmail = document.getElementById('SalEmail').value;
var PointBal = document.getElementById('pointBal').value;
var ReservPts = document.getElementById('reservPts').value;
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
document.getElementById('ReviewTable').innerHTML = HTML;
}
else
{
document.getElementById('ReviewTable').innerHTML = "Error!";
}
}
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'FinalizeOrder=1&SalEmail=' + encodeURIComponent(SalEmail) + '&PointBal=' + encodeURIComponent(PointBal) + '&ReservPts=' + encodeURIComponent(ReservPts);
Show.send(Data);
}
function CancelOrder()
{
ClearOrder()
document.getElementById('ReviewDiv').style.display = "none";
document.getElementById('RewardsDiv').style.display = "block";
ShowRewards();
}
function ViewBrochure(RewID, W, H)
{
var url = "http://thesalonalliance.com/View.php?RewID=" + encodeURIComponent(RewID);
var BrochurePopup = '';
try
{
if (!W && !H)
{
BrochurePopup=window.open(url,'PopUpBrochure','resizable=1,status=0,menubar=0,toolbar=0,scrollbars=1,location=0,directories=0,dependent=1, fullscreen=yes');
}
else
{
BrochurePopup=window.open(url,'PopUpBrochure','width=' + W + ',height=' + H + ',Top=20,Left=30,resizable=1,status=0,menubar=0,toolbar=0,scrollbars=1,location=0,directories=0,dependent=1');
}
BrochurePopup.focus();
BrochurePopup.opener = self;
}
catch(e)
{
if (BrochurePopup.location.href)
{
BrochurePopup.close();
ViewBrochure(RewID, W, H);
}
}
}
function FetchUsers(OrderBy, Direction)
{
var SearchText = document.getElementById('SearchUsers').value;
var Fetch = SetupConnection();
Fetch.onreadystatechange=function()
{
if (Fetch.readyState == 4)
{
if (Fetch.status == 200)
{
if (Fetch.responseText == "LOCKED") location.href=location.href;
ShowUsers(0);
}
}
};
Fetch.open("POST", "http://thesalonalliance.com/ajax.php", true);
Fetch.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'FetchUsers=1&SearchText=' + encodeURIComponent(SearchText) + '&OrderBy=' + encodeURIComponent(OrderBy) + '&Direction=' + encodeURIComponent(Direction);
Fetch.send(Data);
}
function ShowUsers(Start)
{
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
document.getElementById('UsersTable').innerHTML = HTML;
document.getElementById('SearchUsersDiv').style.display = "block";
}
else
{
document.getElementById('UsersTable').innerHTML = "
No Users Found
";
}
}
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ShowUsers=1&Start=' + Start;
Show.send(Data);
}
function EditUser(UID)
{
var Edit = SetupConnection();
Edit.onreadystatechange=function()
{
if (Edit.readyState == 4)
{
if (Edit.status == 200)
{
if (Edit.responseText == "LOCKED") location.href=location.href;
var HTML = Edit.responseText;
if (HTML)
{
document.getElementById('UsersTable').innerHTML = HTML;
document.getElementById('SearchUsersDiv').style.display = "none";
}
else
{
document.getElementById('UsersTable').innerHTML = "User Not Found
";
}
}
}
};
Edit.open("POST", "http://thesalonalliance.com/ajax.php", true);
Edit.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'EditUser=1&UID=' + encodeURIComponent(UID);
Edit.send(Data);
}
function UpdateUser(UID, Obj)
{
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'UpdateUser=1&UID=' + encodeURIComponent(UID) + '&Field=' + encodeURIComponent(Obj.name) + '&Value=' + encodeURIComponent(Obj.value);
Send.send(Data);
}
function EditPermissions(UID)
{
var Edit = SetupConnection();
Edit.onreadystatechange=function()
{
if (Edit.readyState == 4)
{
if (Edit.status == 200)
{
if (Edit.responseText == "LOCKED") location.href=location.href;
var HTML = Edit.responseText;
if (HTML)
{
document.getElementById('UsersTable').innerHTML = HTML;
}
else
{
document.getElementById('UsersTable').innerHTML = "User Not Found
";
}
}
}
};
Edit.open("POST", "http://thesalonalliance.com/ajax.php", true);
Edit.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'EditPermissions=1&UID=' + encodeURIComponent(UID);
Edit.send(Data);
}
function UpdatePermission(UID, Obj)
{
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'UpdatePermission=1&UID=' + encodeURIComponent(UID) + '&Permission=' + encodeURIComponent(Obj.name) + '&Value=' + encodeURIComponent(Obj.value);
Send.send(Data);
}
function SearchSalons(OrderBy, Direction)
{
try
{
var UserID = document.getElementById('UserID').value;
var DoSearch = true;
}
catch (e)
{
var DoSearch = false;
}
try
{
var SalonName = document.getElementById('SalonName').value;
var DoSearch = true;
}
catch (e)
{
var DoSearch = false;
}
try
{
var SalonPhone = document.getElementById('SalonPhone').value;
var DoSearch = true;
}
catch (e)
{
var DoSearch = false;
}
try
{
var LocZip = document.getElementById('LocZip').value;
var DoSearch = true;
}
catch (e)
{
var DoSearch = false;
}
try
{
var SalEmail = document.getElementById('SalEmail').value;
var DoSearch = true;
}
catch (e)
{
var DoSearch = false;
}
try
{
var SalAcct = document.getElementById('SalAcct').value;
var DoSearch = true;
}
catch (e)
{
var DoSearch = false;
}
var Fetch = SetupConnection();
Fetch.onreadystatechange=function()
{
if (Fetch.readyState == 4)
{
if (Fetch.status == 200)
{
if (Fetch.responseText == "LOCKED") location.href=location.href;
ShowMatchingSalons(0);
}
}
};
Fetch.open("POST", "http://thesalonalliance.com/ajax.php", true);
Fetch.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
if (DoSearch == true)
{
var Data = 'SearchSalons=1&DoSearch=1&UserID=' + encodeURIComponent(UserID) + '&SalonName=' + encodeURIComponent(SalonName) + '&SalonPhone=' + encodeURIComponent(SalonPhone) + '&LocZip=' + encodeURIComponent(LocZip) + '&SalEmail=' + encodeURIComponent(SalEmail) + '&SalAcct=' + encodeURIComponent(SalAcct);
}
else
{
var Data = 'SearchSalons=1';
}
Data = Data + '&OrderBy=' + encodeURIComponent(OrderBy) + '&Direction=' + encodeURIComponent(Direction);
Fetch.send(Data);
}
function ShowMatchingSalons(Start)
{
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
document.getElementById('SalonTable').innerHTML = HTML;
document.getElementById('SalonLookup').style.display = "none";
document.getElementById('SalonTable').style.display = "block";
accountStatusChange();
if (document.getElementById('MailSame').checked)
{
MailSameChange();
}
}
else
{
if (document.getElementById('SalonLookup').innerHTML.indexOf("No Matches Found") < 0)
{
document.getElementById('SalonLookup').innerHTML = "No Matches Found
" + document.getElementById('SalonLookup').innerHTML;
}
document.getElementById('SalonTable').style.display = "none";
document.getElementById('SalonLookup').style.display = "block";
}
}
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ShowMatchingSalons=1&Start=' + Start;
Show.send(Data);
}
function FetchDistributors(OrderBy, Direction)
{
var Fetch = SetupConnection();
Fetch.onreadystatechange=function()
{
if (Fetch.readyState == 4)
{
if (Fetch.status == 200)
{
if (Fetch.responseText == "LOCKED") location.href=location.href;
ShowDistributors(0);
}
}
};
Fetch.open("POST", "http://thesalonalliance.com/ajax.php", true);
Fetch.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'FetchDistributors=1&OrderBy=' + encodeURIComponent(OrderBy) + '&Direction=' + encodeURIComponent(Direction);
Fetch.send(Data);
}
function ShowDistributors(Start)
{
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
document.getElementById('DistributorsTable').innerHTML = HTML;
}
else
{
document.getElementById('DistributorsTable').innerHTML = "No Distributors Found
";
}
}
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ShowDistributors=1&Start=' + Start;
Show.send(Data);
}
function EditDistributor(DID)
{
var Edit = SetupConnection();
Edit.onreadystatechange=function()
{
if (Edit.readyState == 4)
{
if (Edit.status == 200)
{
if (Edit.responseText == "LOCKED") location.href=location.href;
var HTML = Edit.responseText;
if (HTML)
{
document.getElementById('DistributorsTable').innerHTML = HTML;
}
else
{
document.getElementById('DistributorsTable').innerHTML = "Distributor Not Found
";
}
}
}
};
Edit.open("POST", "http://thesalonalliance.com/ajax.php", true);
Edit.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'EditDistributor=1&DID=' + encodeURIComponent(DID);
Edit.send(Data);
}
var DID = null;
function UpdateDistributor(DID, NewDist)
{
var DistCode;
var Current;
var IsTerm;
var UpdtReas;
if (NewDist)
{
try
{
var DistCode = document.getElementById('DistCode').value;
if (document.getElementById('Current').checked) var Current = '1'; else var Current = '0';
if (document.getElementById('IsTerm').checked) var IsTerm = '1'; else var IsTerm = '0';
var UpdtReas = document.getElementById('UpdtReas').value;
}
catch(e)
{ }
}
var Username = document.getElementById('Username').value;
var ReportPass = document.getElementById('ReportPass').value;
var NewPassword = document.getElementById('NewPassword').value;
var ConfirmNewPassword = document.getElementById('ConfirmNewPassword').value;
if (document.getElementById('GldDist').checked) var GldDist = '1'; else var GldDist = '0';
if (document.getElementById('KMSDist').checked) var KMSDist = '1'; else var KMSDist = '0';
var Name = document.getElementById('Name').value;
var DistRptNam = document.getElementById('DistRptNam').value;
var Address1 = document.getElementById('Address1').value;
var Address2 = document.getElementById('Address2').value;
var City = document.getElementById('City').value;
var State = document.getElementById('State').value;
var Zip = document.getElementById('Zip').value;
var Country = document.getElementById('Country').value;
var DSCPrefix = document.getElementById('DSCPrefix').value;
if (document.getElementById('HoldMail').checked) var HoldMail = '1'; else var HoldMail = '0';
if (document.getElementById('NoMail').checked) var NoMail = '1'; else var NoMail = '0';
var RewEmail = document.getElementById('RewEmail').value;
var Contact = document.getElementById('Contact').value;
var ContTitle = document.getElementById('ContTitle').value;
var DistEmail = document.getElementById('DistEmail').value;
if (document.getElementById('DistOptIn').checked) var DistOptIn = '1'; else var DistOptIn = '0';
if (document.getElementById('DistBadEml').checked) var DistBadEml = '1'; else var DistBadEml = '0';
var DistPhone = document.getElementById('DistPhone').value;
var DistFax = document.getElementById('DistFax').value;
if (NewPassword == ConfirmNewPassword)
{
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
var Return = Send.responseText;
if (Return)
{
if (NewDist)
{
if (Return.indexOf("Dup") >= 0)
{
alert("Duplicate Distributor Found\nTaking You To That Record Now");
}
DID = Return;
}
var Edit = SetupConnection();
Edit.onreadystatechange=function()
{
if (Edit.readyState == 4)
{
if (Edit.status == 200)
{
if (Edit.responseText == "LOCKED") location.href=location.href;
var HTML = Edit.responseText;
if (HTML)
{
if (NewDist)
{
if (Return.indexOf("Dup") >= 0)
{
document.getElementById('DistributorsTable').innerHTML = "Found Duplicate Distributor. Make Your Changes To Update
" + HTML;
}
else
{
if (Return.indexOf("ExistingUsername") >= 0)
{
document.getElementById('DistributorsTable').innerHTML = "Distributor Added
Invalid Username
" + HTML;
}
else
{
document.getElementById('DistributorsTable').innerHTML = "Distributor Added
" + HTML;
}
}
}
else
{
if (Return.indexOf("ExistingUsername") >= 0)
{
document.getElementById('DistributorsTable').innerHTML = "Your Changes Have Been Saved
Invalid Username
" + HTML;
}
else
{
document.getElementById('DistributorsTable').innerHTML = "Your Changes Have Been Saved
" + HTML;
}
}
}
}
}
};
Edit.open("POST", "http://thesalonalliance.com/ajax.php", true);
Edit.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'EditDistributor=1&DID=' + encodeURIComponent(DID);
Edit.send(Data);
}
else
{
alert("Missing Required Fields");
}
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
if (NewDist)
{
var Data = 'UpdateDistributor=1&NewDist=1&Username=' + encodeURIComponent(Username) + '&ReportPass=' + encodeURIComponent(ReportPass) + '&NewPassword=' + encodeURIComponent(NewPassword) + '&DistCode=' + encodeURIComponent(DistCode) + '&Current=' + encodeURIComponent(Current) + '&IsTerm=' + encodeURIComponent(IsTerm) + '&UpdtReas=' + encodeURIComponent(UpdtReas) + '&GldDist=' + encodeURIComponent(GldDist) + '&KMSDist=' + encodeURIComponent(KMSDist) + '&Name=' + encodeURIComponent(Name) + '&DistRptNam=' + encodeURIComponent(DistRptNam) + '&Address1=' + encodeURIComponent(Address1) + '&Address2=' + encodeURIComponent(Address2) + '&City=' + encodeURIComponent(City) + '&State=' + encodeURIComponent(State) + '&Zip=' + encodeURIComponent(Zip) + '&Country=' + encodeURIComponent(Country) + '&DSCPrefix=' + encodeURIComponent(DSCPrefix) + '&HoldMail=' + encodeURIComponent(HoldMail) + '&NoMail=' + encodeURIComponent(NoMail) + '&RewEmail=' + encodeURIComponent(RewEmail) + '&Contact=' + encodeURIComponent(Contact) + '&ContTitle=' + encodeURIComponent(ContTitle) + '&DistEmail=' + encodeURIComponent(DistEmail) + '&DistOptIn=' + encodeURIComponent(DistOptIn) + '&DistBadEml=' + encodeURIComponent(DistBadEml) + '&DistPhone=' + encodeURIComponent(DistPhone) + '&DistFax=' + encodeURIComponent(DistFax);
}
else
{
var Data = 'UpdateDistributor=1&DID=' + encodeURIComponent(DID) + '&Username=' + encodeURIComponent(Username) + '&ReportPass=' + encodeURIComponent(ReportPass) + '&NewPassword=' + encodeURIComponent(NewPassword) + '&GldDist='+ encodeURIComponent(GldDist) + '&KMSDist=' + encodeURIComponent(KMSDist) + '&Name=' + encodeURIComponent(Name) + '&DistRptNam=' + encodeURIComponent(DistRptNam) + '&Address1=' + encodeURIComponent(Address1) + '&Address2=' + encodeURIComponent(Address2) + '&City=' + encodeURIComponent(City) + '&State=' + encodeURIComponent(State) + '&Zip=' + encodeURIComponent(Zip) + '&DSCPrefix=' + encodeURIComponent(DSCPrefix) + '&Country=' + encodeURIComponent(Country) + '&HoldMail=' + encodeURIComponent(HoldMail) + '&NoMail=' + encodeURIComponent(NoMail) + '&RewEmail=' + encodeURIComponent(RewEmail) + '&Contact=' + encodeURIComponent(Contact) + '&ContTitle=' + encodeURIComponent(ContTitle) + '&DistEmail=' + encodeURIComponent(DistEmail) + '&DistOptIn=' + encodeURIComponent(DistOptIn) + '&DistBadEml=' + encodeURIComponent(DistBadEml) + '&DistPhone=' + encodeURIComponent(DistPhone) + '&DistFax=' + encodeURIComponent(DistFax);
}
Send.send(Data);
}
else
{
alert("Passwords Do Not Match");
}
scroll(0,0);
}
function FetchSalons(OrderBy, Direction)
{
var SearchText = '';
try
{
SearchText = document.getElementById('SearchSalonText').value;
}
catch(e)
{ }
var Fetch = SetupConnection();
Fetch.onreadystatechange=function()
{
if (Fetch.readyState == 4)
{
if (Fetch.status == 200)
{
if (Fetch.responseText == "LOCKED") location.href=location.href;
ShowSalons(0);
}
}
};
Fetch.open("POST", "http://thesalonalliance.com/ajax.php", true);
Fetch.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'FetchSalons=1&SearchText=' + encodeURIComponent(SearchText) + '&OrderBy=' + encodeURIComponent(OrderBy) + '&Direction=' + encodeURIComponent(Direction);
Fetch.send(Data);
}
function ShowAllSalons(FunctionCall)
{
document.getElementById('SearchSalonText').value = '';
if (window[FunctionCall]) window[FunctionCall]();
}
function ShowSalons(Start)
{
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
document.getElementById('SalonTable').innerHTML = HTML;
}
else
{
document.getElementById('SalonTable').innerHTML = "No Salons Found
";
}
}
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ShowSalons=1&Start=' + Start;
Show.send(Data);
}
function EditSalon(SID)
{
var Edit = SetupConnection();
Edit.onreadystatechange=function()
{
if (Edit.readyState == 4)
{
if (Edit.status == 200)
{
if (Edit.responseText == "LOCKED") location.href=location.href;
var HTML = Edit.responseText;
if (HTML)
{
document.getElementById('SalonTable').innerHTML = HTML;
accountStatusChange();
if (document.getElementById('MailSame').checked)
{
MailSameChange();
}
}
else
{
document.getElementById('SalonTable').innerHTML = "Salon Not Found
";
}
}
}
};
Edit.open("POST", "http://thesalonalliance.com/ajax.php", true);
Edit.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'EditSalon=1&SID=' + encodeURIComponent(SID);
Edit.send(Data);
}
function ShowSalonDemo()
{
var Edit = SetupConnection();
Edit.onreadystatechange=function()
{
if (Edit.readyState == 4)
{
if (Edit.status == 200)
{
if (Edit.responseText == "LOCKED") location.href=location.href;
var HTML = Edit.responseText;
if (HTML)
{
document.getElementById('SalonTable').innerHTML = HTML;
accountStatusChange();
if (document.getElementById('MailSame').checked)
{
MailSameChange();
}
}
else
{
document.getElementById('SalonTable').innerHTML = "Salon Not Found
";
}
}
}
};
Edit.open("POST", "http://thesalonalliance.com/ajax.php", true);
Edit.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ShowSalonDemo=1';
Edit.send(Data);
}
function UpdateSalon(SID, NewSalon)
{
var GldDistID;
var KMSDistID;
if (NewSalon)
{
try
{
var GldDistID = document.getElementById('GldDistID').value;
var KMSDistID = document.getElementById('KMSDistID').value;
}
catch(e)
{ }
}
try
{
var GoldAcct = document.getElementById('GoldAcct').value;
var KMSAcct = document.getElementById('KMSAcct').value;
var SalRptName = '';//document.getElementById('SalRptName').value;
if (document.getElementById('NoMail').checked) var NoMail = '1'; else var NoMail = '0';
if (document.getElementById('MgrBadEml').checked) var MgrBadEml = '1'; else var MgrBadEml = '0';
if (document.getElementById('OwnrBadEml').checked) var OwnrBadEml = '1'; else var OwnrBadEml = '0';
if (document.getElementById('SalBadEml').checked) var SalBadEml = '1'; else var SalBadEml = '0';
var ChnLocCnt = document.getElementById('ChnLocCnt').value;
if (document.getElementById('TitanQual').checked) var TitanQual = '1'; else var TitanQual = '0';
if (document.getElementById('ChartQual').checked) var ChartQual = '1'; else var ChartQual = '0';
var RewCountry = document.getElementById('RewCountry').options[document.getElementById('RewCountry').selectedIndex].value;
if (document.getElementById('Current').checked) var Current = '1'; else var Current = '0';
if (document.getElementById('OnHold').checked) var OnHold = '1'; else var OnHold = '0';
if (document.getElementById('IsTerm').checked) var IsTerm = '1'; else var IsTerm = '0';
if (document.getElementById('AlwaysLocator').checked) var AlwaysLocator = '1'; else var AlwaysLocator = '0';
if (document.getElementById('NeverLocator').checked) var NeverLocator = '1'; else var NeverLocator = '0';
var Notes = document.getElementById('Notes').value;
var GoldEduc = document.getElementById('GoldEduc').value;
var EnrSubBy = document.getElementById('EnrSubBy').value;
var EnrSubEml = document.getElementById('EnrSubEml').value;
var SalConsult = document.getElementById('SalConsult').value;
var EnrComment = document.getElementById('EnrComment').value;
}
catch (e)
{ }
try
{
var Name = document.getElementById('Name').value;
var AcctStatus = document.getElementById('AcctStatus').options[document.getElementById('AcctStatus').selectedIndex].value;
var LocAddr1 = document.getElementById('LocAddr1').value;
var LocAddr2 = document.getElementById('LocAddr2').value;
var LocCity = document.getElementById('LocCity').value;
var LocState = document.getElementById('LocState').options[document.getElementById('LocState').selectedIndex].value;
var LocZip = document.getElementById('LocZip').value;
var LocCountry = document.getElementById('LocCountry').options[document.getElementById('LocCountry').selectedIndex].value;
if (document.getElementById('HoldMail').checked) var HoldMail = '1'; else var HoldMail = '0';
if (document.getElementById('MailSame').checked) var MailSame = '1'; else var MailSame = '0';
var MailAddr1 = document.getElementById('MailAddr1').value;
var MailAddr2 = document.getElementById('MailAddr2').value;
var MailCity = document.getElementById('MailCity').value;
var MailState = document.getElementById('MailState').options[document.getElementById('MailState').selectedIndex].value;
var MailZip = document.getElementById('MailZip').value;
var MailCtry = document.getElementById('MailCtry').options[document.getElementById('MailCtry').selectedIndex].value;
var SalWebSite = document.getElementById('SalWebSite').value;
var OwnrName = document.getElementById('OwnrName').value;
var OwnrEmail = document.getElementById('OwnrEmail').value;
if (document.getElementById('OwnrOptin').checked) var OwnrOptin = '1'; else var OwnrOptin = '0';
var MgrFName = document.getElementById('MgrFName').value;
var MgrLName = document.getElementById('MgrLName').value;
var MgrEmail = document.getElementById('MgrEmail').value;
if (document.getElementById('MgrOptin').checked) var MgrOptin = '1'; else var MgrOptin = '0';
var SalEmail = document.getElementById('SalEmail').value;
if (document.getElementById('SalOptIn').checked) var SalOptIn = '1'; else var SalOptIn = '0';
var SalPhone = document.getElementById('SalPhone').value;
var SalFax = document.getElementById('SalFax').value;
var ColorCnt = document.getElementById('ColorCnt').value;
var ChairCnt = document.getElementById('ChairCnt').value;
var Telesales = document.getElementById('Telesales').value;
}
catch (e)
{ }
try
{
var NumStation = document.getElementById('NumStation').value;
var NumStyle = document.getElementById('NumStyle').value;
var SingleColr = document.getElementById('SingleColr').value;
var HairBlow = document.getElementById('HairBlow').value;
var OtherComp = document.getElementById('OtherComp').value;
var StudentCnt = document.getElementById('StudentCnt').value;
var GradYear = document.getElementById('GradYear').value;
var EducateCnt = document.getElementById('EducateCnt').value;
var SchoolPr = document.getElementById('SchoolPr').value;
var SchoolCur = document.getElementById('SchoolCur').value;
var PresCEO = document.getElementById('PresCEO').value;
var PurchMgr = document.getElementById('PurchMgr').value;
var GWPDisc = document.getElementById('GWPDisc').value;
var GWRDisc = document.getElementById('GWRDisc').value;
var KMSDisc = document.getElementById('KMSDisc').value;
var OwnerType = document.getElementById('OwnerType').value;
var PrimColor = document.getElementById('PrimColor').value;
var PrimPerm = document.getElementById('PrimPerm').value;
var PrimRetail = document.getElementById('PrimRetail').value;
}
catch (e)
{ }
try
{
var SalesGroup = document.getElementById('SalesGroup').value;
}
catch (e)
{ }
var Update = SetupConnection();
Update.onreadystatechange=function()
{
if (Update.readyState == 4)
{
if (Update.status == 200)
{
if (Update.responseText == "LOCKED") location.href=location.href;
var HTML = Update.responseText;
if (HTML)
{
//jfh Need to refresh the menu and the banner, not just the salon
// table. Since everything has to be right now and there isn't time
// to do it properly, welcome to hack-land.
// if (window.location.href.indexOf(SID) == -1)
// {
// window.location = window.location.href + '&SalonID=' + SID;
// }
// else
// {
// window.location.reload(true);
// }
refreshBanner(SID);
refreshMenu();
document.getElementById('SalonTable').innerHTML = HTML;
accountStatusChange();
if (document.getElementById('MailSame').checked)
{
MailSameChange();
}
}
else
{
document.getElementById('SalonTable').innerHTML = "Error
";
}
}
}
};
Update.open("POST", "http://thesalonalliance.com/ajax.php", true);
Update.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
if (NewSalon)
{
var Data = 'UpdateSalon=1&NewSalon=1&GldDistID=' + encodeURIComponent(GldDistID) + '&KMSDistID=' + encodeURIComponent(KMSDistID) + '&GoldAcct=' + encodeURIComponent(GoldAcct) + '&KMSAcct=' + encodeURIComponent(KMSAcct) + '&Name=' + encodeURIComponent(Name) + '&SalRptName=' + encodeURIComponent(SalRptName) + '&AcctStatus=' + encodeURIComponent(AcctStatus) + '&LocAddr1=' + encodeURIComponent(LocAddr1) + '&LocAddr2=' + encodeURIComponent(LocAddr2) + '&LocCity=' + encodeURIComponent(LocCity) + '&LocState=' + encodeURIComponent(LocState) + '&LocZip=' + encodeURIComponent(LocZip) + '&LocCountry=' + encodeURIComponent(LocCountry) + '&HoldMail=' + encodeURIComponent(HoldMail) + '&NoMail=' + encodeURIComponent(NoMail) + '&MailSame=' + encodeURIComponent(MailSame) + '&MailAddr1=' + encodeURIComponent(MailAddr1) + '&MailAddr2=' + encodeURIComponent(MailAddr2) + '&MailCity=' + encodeURIComponent(MailCity) + '&MailState=' + encodeURIComponent(MailState) + '&MailZip=' + encodeURIComponent(MailZip) + '&MailCtry=' + encodeURIComponent(MailCtry) + '&SalWebSite=' + encodeURIComponent(SalWebSite) + '&OwnrName=' + encodeURIComponent(OwnrName) + '&OwnrEmail=' + encodeURIComponent(OwnrEmail) + '&OwnrOptin=' + encodeURIComponent(OwnrOptin) + '&OwnrBadEml=' + encodeURIComponent(OwnrBadEml) + '&MgrFName=' + encodeURIComponent(MgrFName) + '&MgrLName=' + encodeURIComponent(MgrLName) + '&MgrEmail=' + encodeURIComponent(MgrEmail) + '&MgrOptin=' + encodeURIComponent(MgrOptin) + '&MgrBadEml=' + encodeURIComponent(MgrBadEml) + '&SalEmail=' + encodeURIComponent(SalEmail) + '&SalOptIn=' + encodeURIComponent(SalOptIn) + '&SalBadEml=' + encodeURIComponent(SalBadEml) + '&SalPhone=' + encodeURIComponent(SalPhone) + '&SalFax=' + encodeURIComponent(SalFax) + '&ColorCnt=' + encodeURIComponent(ColorCnt) + '&ChairCnt=' + encodeURIComponent(ChairCnt) + '&ChnLocCnt=' + encodeURIComponent(ChnLocCnt) + '&TitanQual=' + encodeURIComponent(TitanQual) + '&ChartQual=' + encodeURIComponent(ChartQual) + '&RewCountry=' + encodeURIComponent(RewCountry) + '&Current=' + encodeURIComponent(Current) + '&OnHold=' + encodeURIComponent(OnHold) + '&IsTerm=' + encodeURIComponent(IsTerm) + '&AlwaysLocator=' + encodeURIComponent(AlwaysLocator) + '&NeverLocator=' + encodeURIComponent(NeverLocator) + '&Notes=' + encodeURIComponent(Notes) + '&GoldEduc=' + encodeURIComponent(GoldEduc) + '&EnrSubBy=' + encodeURIComponent(EnrSubBy) + '&EnrSubEml=' + encodeURIComponent(EnrSubEml) + '&SalConsult=' + encodeURIComponent(SalConsult) + '&EnrComment=' + encodeURIComponent(EnrComment) + '&NumStation=' + encodeURIComponent(NumStation) + '&NumStyle=' + encodeURIComponent(NumStyle) + '&SingleColr=' + encodeURIComponent(SingleColr) + '&HairBlow=' + encodeURIComponent(HairBlow) + '&OtherComp=' + encodeURIComponent(OtherComp) + '&StudentCnt=' + encodeURIComponent(StudentCnt) + '&GradYear=' + encodeURIComponent(GradYear) + '&EducateCnt=' + encodeURIComponent(EducateCnt) + '&SchoolPr=' + encodeURIComponent(SchoolPr) + '&SchoolCur=' + encodeURIComponent(SchoolCur) + '&PresCEO=' + encodeURIComponent(PresCEO) + '&PurchMgr=' + encodeURIComponent(PurchMgr) + '&GWPDisc=' + encodeURIComponent(GWPDisc) + '&GWRDisc=' + encodeURIComponent(GWRDisc) + '&KMSDisc=' + encodeURIComponent(KMSDisc) + '&OwnerType=' + encodeURIComponent(OwnerType) + '&PrimColor=' + encodeURIComponent(PrimColor) + '&PrimPerm=' + encodeURIComponent(PrimPerm) + '&PrimRetail=' + encodeURIComponent(PrimRetail) + '&SalesGroup=' + encodeURIComponent(SalesGroup) + '&Telesales=' + encodeURIComponent(Telesales);
}
else
{
var Data = 'UpdateSalon=1&SID=' + encodeURIComponent(SID) + '&GoldAcct=' + encodeURIComponent(GoldAcct) + '&KMSAcct=' + encodeURIComponent(KMSAcct) + '&Name=' + encodeURIComponent(Name) + '&SalRptName=' + encodeURIComponent(SalRptName) + '&AcctStatus=' + encodeURIComponent(AcctStatus) + '&LocAddr1=' + encodeURIComponent(LocAddr1) + '&LocAddr2=' + encodeURIComponent(LocAddr2) + '&LocCity=' + encodeURIComponent(LocCity) + '&LocState=' + encodeURIComponent(LocState) + '&LocZip=' + encodeURIComponent(LocZip) + '&LocCountry=' + encodeURIComponent(LocCountry) + '&HoldMail=' + encodeURIComponent(HoldMail) + '&NoMail=' + encodeURIComponent(NoMail) + '&MailSame=' + encodeURIComponent(MailSame) + '&MailAddr1=' + encodeURIComponent(MailAddr1) + '&MailAddr2=' + encodeURIComponent(MailAddr2) + '&MailCity=' + encodeURIComponent(MailCity) + '&MailState=' + encodeURIComponent(MailState) + '&MailZip=' + encodeURIComponent(MailZip) + '&MailCtry=' + encodeURIComponent(MailCtry) + '&SalWebSite=' + encodeURIComponent(SalWebSite) + '&OwnrName=' + encodeURIComponent(OwnrName) + '&OwnrEmail=' + encodeURIComponent(OwnrEmail) + '&OwnrOptin=' + encodeURIComponent(OwnrOptin) + '&OwnrBadEml=' + encodeURIComponent(OwnrBadEml) + '&MgrFName=' + encodeURIComponent(MgrFName) + '&MgrLName=' + encodeURIComponent(MgrLName) + '&MgrEmail=' + encodeURIComponent(MgrEmail) + '&SalEmail=' + encodeURIComponent(SalEmail) + '&SalOptIn=' + encodeURIComponent(SalOptIn) + '&SalBadEml=' + encodeURIComponent(SalBadEml) + '&MgrOptin=' + encodeURIComponent(MgrOptin) + '&MgrBadEml=' + encodeURIComponent(MgrBadEml) + '&SalPhone=' + encodeURIComponent(SalPhone) + '&SalFax=' + encodeURIComponent(SalFax) + '&ColorCnt=' + encodeURIComponent(ColorCnt) + '&ChairCnt=' + encodeURIComponent(ChairCnt) + '&ChnLocCnt=' + encodeURIComponent(ChnLocCnt) + '&TitanQual=' + encodeURIComponent(TitanQual) + '&ChartQual=' + encodeURIComponent(ChartQual) + '&RewCountry=' + encodeURIComponent(RewCountry) + '&Current=' + encodeURIComponent(Current) + '&OnHold=' + encodeURIComponent(OnHold) + '&IsTerm=' + encodeURIComponent(IsTerm) + '&AlwaysLocator=' + encodeURIComponent(AlwaysLocator) + '&NeverLocator=' + encodeURIComponent(NeverLocator) + '&Notes=' + encodeURIComponent(Notes) + '&GoldEduc=' + encodeURIComponent(GoldEduc) + '&EnrSubBy=' + encodeURIComponent(EnrSubBy) + '&EnrSubEml=' + encodeURIComponent(EnrSubEml) + '&SalConsult=' + encodeURIComponent(SalConsult) + '&EnrComment=' + encodeURIComponent(EnrComment) + '&NumStation=' + encodeURIComponent(NumStation) + '&NumStyle=' + encodeURIComponent(NumStyle) + '&SingleColr=' + encodeURIComponent(SingleColr) + '&HairBlow=' + encodeURIComponent(HairBlow) + '&OtherComp=' + encodeURIComponent(OtherComp) + '&StudentCnt=' + encodeURIComponent(StudentCnt) + '&GradYear=' + encodeURIComponent(GradYear) + '&EducateCnt=' + encodeURIComponent(EducateCnt) + '&SchoolPr=' + encodeURIComponent(SchoolPr) + '&SchoolCur=' + encodeURIComponent(SchoolCur) + '&PresCEO=' + encodeURIComponent(PresCEO) + '&PurchMgr=' + encodeURIComponent(PurchMgr) + '&GWPDisc=' + encodeURIComponent(GWPDisc) + '&GWRDisc=' + encodeURIComponent(GWRDisc) + '&KMSDisc=' + encodeURIComponent(KMSDisc) + '&OwnerType=' + encodeURIComponent(OwnerType) + '&PrimColor=' + encodeURIComponent(PrimColor) + '&PrimPerm=' + encodeURIComponent(PrimPerm) + '&PrimRetail=' + encodeURIComponent(PrimRetail) + '&SalesGroup=' + encodeURIComponent(SalesGroup) + '&Telesales=' + encodeURIComponent(Telesales);
}
//alert(Data);
Update.send(Data);
scroll(0,0);
}
function ClearMaintFilters()
{
try
{
document.getElementById('RewType').selectedIndex = 0;
}
catch(e)
{ }
try
{
document.getElementById('Fulfill').selectedIndex = 0;
}
catch(e)
{ }
try
{
document.getElementById('SearchText').value = "";
}
catch(e)
{ }
FetchRewardMaint();
}
function FetchRewardMaint(OrderBy, Direction)
{
var RewType = '';
var Fulfill = '';
var SearchText = '';
try
{
RewType = document.getElementById('RewType').options[document.getElementById('RewType').selectedIndex].value;
}
catch (e)
{ }
try
{
Fulfill = document.getElementById('Fulfill').options[document.getElementById('Fulfill').selectedIndex].value;
}
catch (e)
{ }
try
{
SearchText = document.getElementById('SearchText').value;
}
catch (e)
{ }
if (CurRewType != RewType && RewType == "All")
{
Fulfill = "All";
SearchText = "";
}
CurRewType = RewType;
CurFulfill = Fulfill;
if (RewType == "All") RewType = "";
if (Fulfill == "All") Fulfill = "";
RewType = encodeURIComponent(RewType);
Fulfill = encodeURIComponent(Fulfill);
SearchText = encodeURIComponent(SearchText);
var Fetch = SetupConnection();
Fetch.onreadystatechange=function()
{
if (Fetch.readyState == 4)
{
if (Fetch.status == 200)
{
if (Fetch.responseText == "LOCKED") location.href=location.href;
ShowRewardMaint(0);
}
}
};
Fetch.open("POST", "http://thesalonalliance.com/ajax.php", true);
Fetch.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'FetchRewardMaint=1&OrderBy=' + encodeURIComponent(OrderBy) + '&Direction=' + encodeURIComponent(Direction) + '&RewType=' + RewType + '&Fulfill=' + Fulfill + '&SearchText=' + SearchText;
Fetch.send(Data);
}
function ShowRewardMaint(Start)
{
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
document.getElementById('RewardMaintTable').innerHTML = HTML;
}
else
{
document.getElementById('RewardMaintTable').innerHTML = "No RewardMaint Found
";
}
}
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ShowRewardMaint=1&Start=' + Start;
Show.send(Data);
}
function ResetSalonPassword(SID)
{
var Confirm = confirm("This will reset the salon's password back to the first password and can NOT be undone.\nAre you sure?");
if (Confirm == true)
{
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
var Response = Send.responseText;
if (Response)
{
alert("Password Reset");
}
else
{
alert("Password Reset Failed");
}
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ResetSalonPassword=1&SID=' + encodeURIComponent(SID);
Send.send(Data);
}
}
function FetchPointsAdj(OrderBy, Direction)
{
var Fetch = SetupConnection();
Fetch.onreadystatechange=function()
{
if (Fetch.readyState == 4)
{
if (Fetch.status == 200)
{
if (Fetch.responseText == "LOCKED") location.href=location.href;
var Response = Fetch.responseText;
//document.getElementById('PointsAdjTable').innerHTML = Response;
ShowPointsAdj(0);
}
}
};
Fetch.open("POST", "http://thesalonalliance.com/ajax.php", true);
Fetch.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'FetchPointsAdj=1&OrderBy=' + encodeURIComponent(OrderBy) + '&Direction=' + encodeURIComponent(Direction);
Fetch.send(Data);
}
function ShowPointsAdj(Start)
{
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
document.getElementById('PointsAdjTable').innerHTML = HTML;
}
else
{
document.getElementById('PointsAdjTable').innerHTML = "No Adjustments Found
";
}
}
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ShowPointsAdj=1&Start=' + Start;
Show.send(Data);
}
function EditPointsAdj(ID)
{
var Edit = SetupConnection();
Edit.onreadystatechange=function()
{
if (Edit.readyState == 4)
{
if (Edit.status == 200)
{
if (Edit.responseText == "LOCKED") location.href=location.href;
var HTML = Edit.responseText;
if (HTML)
{
document.getElementById('PointsAdjTable').innerHTML = HTML;
}
else
{
document.getElementById('PointsAdjTable').innerHTML = "Error Loading Adjustment
";
}
}
}
};
Edit.open("POST", "http://thesalonalliance.com/ajax.php", true);
Edit.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'EditPointsAdj=1&ID=' + encodeURIComponent(ID);
Edit.send(Data);
}
function AwardCodeCheck(Obj)
{
if (Obj.value == "Bonus")
{
document.getElementById('BonusCode').disabled = false;
}
else
{
document.getElementById('BonusCode').disabled = true;
document.getElementById('BonusCode').value = "";
}
}
function UpdatePointsAdj(ID)
{
try
{
var AwardCode = document.getElementById('AwardCode').options[document.getElementById('AwardCode').selectedIndex].value;
var BonusCode = document.getElementById('BonusCode').value;
var AwardMonth = document.getElementById('AwardMonth').options[document.getElementById('AwardMonth').selectedIndex].value;
var AwardDay = document.getElementById('AwardDay').options[document.getElementById('AwardDay').selectedIndex].value;
var AwardYear = document.getElementById('AwardYear').options[document.getElementById('AwardYear').selectedIndex].value;
var AwardDesc = document.getElementById('AwardDesc').value;
var AwardPts = document.getElementById('AwardPts').value;
var AwardNotes = document.getElementById('AwardNotes').value;
var SubmittedBy = document.getElementById('SubmittedBy').value;
}
catch(e)
{ }
var Update = SetupConnection();
Update.onreadystatechange=function()
{
if (Update.readyState == 4)
{
if (Update.status == 200)
{
if (Update.responseText == "LOCKED") location.href=location.href;
var HTML = Update.responseText;
if (HTML)
{
document.getElementById('PointsAdjTable').innerHTML = HTML;
}
else
{
document.getElementById('PointsAdjTable').innerHTML = "Error Saving Adjustment
";
}
}
}
};
Update.open("POST", "http://thesalonalliance.com/ajax.php", true);
Update.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'UpdatePointsAdj=1&ID=' + encodeURIComponent(ID) + '&AwardCode=' + encodeURIComponent(AwardCode) + '&BonusCode=' + encodeURIComponent(BonusCode) + '&AwardMonth=' + encodeURIComponent(AwardMonth) + '&AwardDay=' + encodeURIComponent(AwardDay) + '&AwardYear=' + encodeURIComponent(AwardYear) + '&AwardDesc=' + encodeURIComponent(AwardDesc) + '&AwardPts=' + encodeURIComponent(AwardPts) + '&AwardNotes=' + encodeURIComponent(AwardNotes) + '&SubmittedBy=' + encodeURIComponent(SubmittedBy);
Update.send(Data);
scroll(0,0);
}
function FetchPointsHistory(OrderBy, Direction)
{
var Fetch = SetupConnection();
Fetch.onreadystatechange=function()
{
if (Fetch.readyState == 4)
{
if (Fetch.status == 200)
{
if (Fetch.responseText == "LOCKED") location.href=location.href;
ShowPointsHistory(0);
}
}
};
Fetch.open("POST", "http://thesalonalliance.com/ajax.php", true);
Fetch.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'FetchPointsHistory=1&OrderBy=' + encodeURIComponent(OrderBy) + '&Direction=' + encodeURIComponent(Direction);
Fetch.send(Data);
}
function ShowPointsHistory(Start)
{
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
document.getElementById('PointsHistoryTable').innerHTML = HTML;
}
else
{
document.getElementById('PointsHistoryTable').innerHTML = "No History Found
";
}
}
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ShowPointsHistory=1&Start=' + Start;
Show.send(Data);
}
function FetchRewardsHistory(OrderBy, Direction)
{
var Fetch = SetupConnection();
Fetch.onreadystatechange=function()
{
if (Fetch.readyState == 4)
{
if (Fetch.status == 200)
{
if (Fetch.responseText == "LOCKED") location.href=location.href;
ShowRewardsHistory(0);
}
}
};
Fetch.open("POST", "http://thesalonalliance.com/ajax.php", true);
Fetch.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'FetchRewardsHistory=1&OrderBy=' + encodeURIComponent(OrderBy) + '&Direction=' + encodeURIComponent(Direction);
Fetch.send(Data);
}
function ShowRewardsHistory(Start)
{
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
document.getElementById('RewardsHistoryTable').innerHTML = HTML;
}
else
{
document.getElementById('RewardsHistoryTable').innerHTML = "No History Found
";
}
}
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ShowRewardsHistory=1&Start=' + Start;
Show.send(Data);
}
function ShowSystemParameters()
{
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
document.getElementById('SystemParametersTable').innerHTML = HTML;
}
else
{
document.getElementById('SystemParametersTable').innerHTML = "No Parameters Found
";
}
}
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ShowSystemParameters=1';
Show.send(Data);
}
function UpdateSystemParameter(Obj)
{
var Parameter = Obj.id;
var Value = Obj.value;
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'UpdateSystemParameter=1&Parameter=' + encodeURIComponent(Parameter) + '&Value=' + encodeURIComponent(Value);
Send.send(Data);
}
function ShowPurchaseHistory(SalonID)
{
try
{
var SelectedYear = document.getElementById('SelectedYear').options[document.getElementById('SelectedYear').selectedIndex].value;
}
catch (e)
{ }
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
document.getElementById('PurchaseHistoryTable').innerHTML = HTML;
}
else
{
document.getElementById('PurchaseHistoryTable').innerHTML = "Error
";
}
}
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ShowPurchaseHistory=1&SalonID=' + SalonID + '&SelectedYear=' + SelectedYear;
Show.send(Data);
}
function FetchDistUsers(OrderBy, Direction)
{
var SearchText = document.getElementById('SearchDistUsers').value;
var Fetch = SetupConnection();
Fetch.onreadystatechange=function()
{
if (Fetch.readyState == 4)
{
if (Fetch.status == 200)
{
if (Fetch.responseText == "LOCKED") location.href=location.href;
ShowDistUsers(0);
}
}
};
Fetch.open("POST", "http://thesalonalliance.com/ajax.php", true);
Fetch.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'FetchDistUsers=1&SearchText=' + encodeURIComponent(SearchText) + '&OrderBy=' + encodeURIComponent(OrderBy) + '&Direction=' + encodeURIComponent(Direction);
Fetch.send(Data);
}
function ShowDistUsers(Start)
{
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
document.getElementById('DistUsersTable').innerHTML = HTML;
document.getElementById('SearchDistUsersDiv').style.display = "block";
}
else
{
document.getElementById('DistUsersTable').innerHTML = "No Users Found
";
}
}
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ShowDistUsers=1&Start=' + Start;
Show.send(Data);
}
function EditDistUser(UID)
{
var Edit = SetupConnection();
Edit.onreadystatechange=function()
{
if (Edit.readyState == 4)
{
if (Edit.status == 200)
{
if (Edit.responseText == "LOCKED") location.href=location.href;
var HTML = Edit.responseText;
if (HTML)
{
document.getElementById('DistUsersTable').innerHTML = HTML;
document.getElementById('SearchDistUsersDiv').style.display = "none";
}
else
{
document.getElementById('DistUsersTable').innerHTML = "User Not Found
";
}
}
}
};
Edit.open("POST", "http://thesalonalliance.com/ajax.php", true);
Edit.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'EditDistUser=1&UID=' + encodeURIComponent(UID);
Edit.send(Data);
}
function UpdateDistUser(Obj)
{
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'UpdateDistUser=1&Field=' + encodeURIComponent(Obj.name) + '&Value=' + encodeURIComponent(Obj.value);
Send.send(Data);
}
function FetchSalonsForSalonAccessDSC()
{
var SearchText = '';
try
{
SearchText = document.getElementById('SearchSalonText').value;
}
catch(e)
{ }
var Fetch = SetupConnection();
Fetch.onreadystatechange=function()
{
if (Fetch.readyState == 4)
{
if (Fetch.status == 200)
{
if (Fetch.responseText == "LOCKED") location.href=location.href;
ShowSalonsForSalonAccessDSC(0);
}
}
};
Fetch.open("POST", "http://thesalonalliance.com/ajax.php", true);
Fetch.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'FetchSalonsForSalonAccessDSC=1&SearchText=' + encodeURIComponent(SearchText);
Fetch.send(Data);
}
function ShowSalonsForSalonAccessDSC(Start)
{
var Edit = SetupConnection();
Edit.onreadystatechange=function()
{
if (Edit.readyState == 4)
{
if (Edit.status == 200)
{
if (Edit.responseText == "LOCKED") location.href=location.href;
var HTML = Edit.responseText;
if (HTML)
{
document.getElementById('DistUsersTable').innerHTML = HTML;
}
else
{
document.getElementById('DistUsersTable').innerHTML = "No Salons Found
";
}
}
}
};
Edit.open("POST", "http://thesalonalliance.com/ajax.php", true);
Edit.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ShowSalonsForSalonAccessDSC=1&Start=' + encodeURIComponent(Start);
Edit.send(Data);
}
function UpdateSalonAccessDSC(Obj)
{
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'UpdateSalonAccessDSC=1&SalonID=' + encodeURIComponent(Obj.value);
if (Obj.checked == false)
{
Data = Data + '&Action=Remove';
}
if (Obj.checked == true)
{
Data = Data + '&Action=Add';
}
Send.send(Data);
}
function AddDSCToSalon(ReturnTo)
{
var Obj = document.getElementById('AllDSCs');
var DSCList = "";
for (var i=0; i <= Obj.length; i++)
{
try
{
if (Obj[i].selected == true)
{
DSCList = DSCList + ':' + Obj[i].value;
}
}
catch(e)
{ }
}
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
if (ReturnTo == "SalonDemo")
{
ShowSalonDemo();
}
else
{
EditSalon('Current');
}
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'UpdateDSCAccess=1&Action=Add&DSCList=' + encodeURIComponent(DSCList);
Send.send(Data);
}
function RemoveDSCFromSalon(ReturnTo)
{
var Obj = document.getElementById('CurrentDSCs');
var DSCList = "";
for (var i=0; i <= Obj.length; i++)
{
try
{
if (Obj[i].selected == true)
{
DSCList = DSCList + ':' + Obj[i].value;
}
}
catch(e)
{ }
}
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
if (ReturnTo == "SalonDemo")
{
ShowSalonDemo();
}
else
{
EditSalon('Current');
}
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'UpdateDSCAccess=1&Action=Remove&DSCList=' + encodeURIComponent(DSCList);
Send.send(Data);
}
function ResetDistUserPass()
{
var Confirm = confirm("This will reset this user's password back to the first password and can NOT be undone.\nAre you sure?");
if (Confirm == true)
{
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
var Response = Send.responseText;
if (Response)
{
alert("Password Reset");
}
else
{
alert("Password Reset Failed");
}
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ResetDistUserPass=1';
Send.send(Data);
}
}
function NewDSCUser()
{
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
var HTML = Send.responseText;
if (HTML)
{
document.getElementById('DistUsersTable').innerHTML = HTML;
document.getElementById('SearchDistUsersDiv').style.display = "none";
}
else
{
document.getElementById('DistUsersTable').innerHTML = "Error
";
document.getElementById('SearchDistUsersDiv').style.display = "none";
}
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'NewDSCUser=1';
Send.send(Data);
}
function UpdateDSCPrefix()
{
try
{
var DistID = document.getElementById('DistID').options[document.getElementById('DistID').selectedIndex].value;
}
catch (e)
{
var DistID = document.getElementById('DistID').value;
}
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED")
{
location.href=location.href;
}
else
{
document.getElementById('DSCPrefix').value = Send.responseText;
}
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'UpdateDSCPrefix=1&DistID=' + encodeURIComponent(DistID);
Send.send(Data);
}
function SaveNewDistUser()
{
try
{
var DistID = document.getElementById('DistID').options[document.getElementById('DistID').selectedIndex].value;
}
catch (e)
{
var DistID = document.getElementById('DistID').value;
}
var UserID = document.getElementById('UserID').value;
var FirstName = document.getElementById('FirstName').value;
var LastName = document.getElementById('LastName').value;
var Email = document.getElementById('Email').value;
var Phone = document.getElementById('Phone').value;
var TerrCode = document.getElementById('TerrCode').value;
var TerrMgr = document.getElementById('TerrMgr').value;
if (DistID.length > 0 && UserID.length > 0 && FirstName.length > 0 && LastName.length > 0 && Email.length > 0 && Phone.length > 0 && TerrCode.length > 0 && TerrMgr.length > 0)
{
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED")
{
location.href=location.href;
}
else if (Send.responseText.indexOf("Error: ") >= 0)
{
alert(Send.responseText);
}
else
{
var UID = Send.responseText;
EditDistUser(UID);
}
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'SaveNewDistUser=1&DistID=' + encodeURIComponent(DistID) + '&UserID=' + encodeURIComponent(UserID) + '&FirstName=' + encodeURIComponent(FirstName) + '&LastName=' + encodeURIComponent(LastName) + '&Email=' + encodeURIComponent(Email) + '&Phone=' + encodeURIComponent(Phone) + '&TerrCode=' + encodeURIComponent(TerrCode) + '&TerrMgr=' + encodeURIComponent(TerrMgr);
Send.send(Data);
}
else
{
alert("Missing Fields\nPlease Fill In All The Fields");
}
}
function DeleteDSC(ID)
{
var Confirm = confirm("This will delete this DSC and can NOT be undone.\nAre you sure?");
if (Confirm == true)
{
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
FetchDistUsers();
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'DeleteDSC=1';
Send.send(Data);
}
}
function RemovedAssignedSalonsDSC()
{
SalonList = "";
Obj = document.getElementById('AssignedSalonsDSC');
for (var i=0; i <= Obj.length; i++)
{
try
{
if (Obj.options[i].selected == true)
{
SalonList = SalonList + ":" + Obj.options[i].value;
}
}
catch (e)
{ }
}
if (SalonList.length > 0)
{
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
EditDistUser("Current");
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'RemoveAssignedSalonsDSC=1&SalonList=' + encodeURIComponent(SalonList);
Send.send(Data);
}
}
function FetchRepUsers(OrderBy, Direction)
{
var SearchText = document.getElementById('SearchRepUsers').value;
var Fetch = SetupConnection();
Fetch.onreadystatechange=function()
{
if (Fetch.readyState == 4)
{
if (Fetch.status == 200)
{
if (Fetch.responseText == "LOCKED") location.href=location.href;
ShowRepUsers(0);
}
}
};
Fetch.open("POST", "http://thesalonalliance.com/ajax.php", true);
Fetch.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'FetchRepUsers=1&SearchText=' + encodeURIComponent(SearchText) + '&OrderBy=' + encodeURIComponent(OrderBy) + '&Direction=' + encodeURIComponent(Direction);
Fetch.send(Data);
}
function ShowRepUsers(Start)
{
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
document.getElementById('RepUsersTable').innerHTML = HTML;
document.getElementById('SearchRepUsersDiv').style.display = "block";
}
else
{
document.getElementById('RepUsersTable').innerHTML = "No Users Found
";
}
}
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ShowRepUsers=1&Start=' + Start;
Show.send(Data);
}
function EditRepUser(UID, SortBy, SalonsSelected)
{
if (SortBy==null || typeof(SortBy)=="undefined") {
SortBy="DisplayName";
}
if (SalonsSelected==null || typeof(SalonsSelected)=="undefined") {
SalonsSelected="None";
}
var Edit = SetupConnection();
Edit.onreadystatechange=function()
{
if (Edit.readyState == 4)
{
if (Edit.status == 200)
{
if (Edit.responseText == "LOCKED") location.href=location.href;
var HTML = Edit.responseText;
if (HTML)
{
document.getElementById('RepUsersTable').innerHTML = HTML;
document.getElementById('SearchRepUsersDiv').style.display = "none";
}
else
{
document.getElementById('RepUsersTable').innerHTML = "User Not Found
";
}
}
}
};
Edit.open("POST", "http://thesalonalliance.com/ajax.php", true);
Edit.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'EditRepUser=1&UID=' + encodeURIComponent(UID) + '&SortBy=' + encodeURIComponent(SortBy) + '&SalonsSelected=' + encodeURIComponent(SalonsSelected);
Edit.send(Data);
}
function UpdateRepUser(Obj)
{
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'UpdateRepUser=1&Field=' + encodeURIComponent(Obj.name) + '&Value=' + encodeURIComponent(Obj.value);
Send.send(Data);
}
function FetchSalonsForSalonAccessKPSS()
{
var SearchText = '';
var SearchDist = '';
try
{
SearchText = document.getElementById('SearchSalonText').value;
SearchDist = document.getElementById('DistList').value;
}
catch(e)
{ }
var Fetch = SetupConnection();
Fetch.onreadystatechange=function()
{
if (Fetch.readyState == 4)
{
if (Fetch.status == 200)
{
if (Fetch.responseText == "LOCKED") location.href=location.href;
ShowSalonsForSalonAccessKPSS(0);
}
}
};
Fetch.open("POST", "http://thesalonalliance.com/ajax.php", true);
Fetch.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'FetchSalonsForSalonAccessKPSS=1&SearchText=' + encodeURIComponent(SearchText) + '&SearchDist=' + encodeURIComponent(SearchDist);
Fetch.send(Data);
}
function ShowSalonsForSalonAccessKPSS(Start)
{
var Edit = SetupConnection();
Edit.onreadystatechange=function()
{
if (Edit.readyState == 4)
{
if (Edit.status == 200)
{
if (Edit.responseText == "LOCKED") location.href=location.href;
var HTML = Edit.responseText;
if (HTML)
{
document.getElementById('RepUsersTable').innerHTML = HTML;
}
else
{
document.getElementById('RepUsersTable').innerHTML = "No Salons Found
";
}
}
}
};
Edit.open("POST", "http://thesalonalliance.com/ajax.php", true);
Edit.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ShowSalonsForSalonAccessKPSS=1&Start=' + encodeURIComponent(Start);
Edit.send(Data);
}
function UpdateSalonAccessKPSS(Obj)
{
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'UpdateSalonAccessKPSS=1&SalonID=' + encodeURIComponent(Obj.value);
if (Obj.checked == false)
{
Data = Data + '&Action=Remove';
}
if (Obj.checked == true)
{
Data = Data + '&Action=Add';
}
Send.send(Data);
}
function AddRepToSalon(ReturnTo)
{
var Obj = document.getElementById('AllReps');
var RepList = "";
for (var i=0; i <= Obj.length; i++)
{
try
{
if (Obj[i].selected == true)
{
RepList = RepList + ':' + Obj[i].value;
}
}
catch(e)
{ }
}
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
if (ReturnTo == "SalonDemo")
{
ShowSalonDemo();
}
else
{
EditSalon('Current');
}
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'UpdateRepAccess=1&Action=Add&RepList=' + encodeURIComponent(RepList);
Send.send(Data);
}
function RemoveRepFromSalon(ReturnTo)
{
var Obj = document.getElementById('CurrentReps');
var RepList = "";
for (var i=0; i <= Obj.length; i++)
{
try
{
if (Obj[i].selected == true)
{
RepList = RepList + ':' + Obj[i].value;
}
}
catch(e)
{ }
}
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
if (ReturnTo == "SalonDemo")
{
ShowSalonDemo();
}
else
{
EditSalon('Current');
}
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'UpdateRepAccess=1&Action=Remove&RepList=' + encodeURIComponent(RepList);
Send.send(Data);
}
function ResetRepUserPass()
{
var Confirm = confirm("This will reset this user's password back to the first password and can NOT be undone.\nAre you sure?");
if (Confirm == true)
{
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
var Response = Send.responseText;
if (Response)
{
alert("Password Reset");
}
else
{
alert("Password Reset Failed");
}
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ResetRepUserPass=1';
Send.send(Data);
}
}
function NewRepUser()
{
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
var HTML = Send.responseText;
if (HTML)
{
document.getElementById('RepUsersTable').innerHTML = HTML;
document.getElementById('SearchRepUsersDiv').style.display = "none";
}
else
{
document.getElementById('RepUsersTable').innerHTML = "Error
";
document.getElementById('SearchRepUsersDiv').style.display = "none";
}
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'NewRepUser=1';
Send.send(Data);
}
function SaveNewRepUser()
{
var UserID = document.getElementById('UserID').value;
var FirstName = document.getElementById('FirstName').value;
var LastName = document.getElementById('LastName').value;
var Email = document.getElementById('Email').value;
var Phone = document.getElementById('Phone').value;
var TerrCode = document.getElementById('TerrCode').value;
var TerrMgr = document.getElementById('TerrMgr').value;
if (UserID.length > 0 && FirstName.length > 0 && LastName.length > 0 && Email.length > 0 && Phone.length > 0 && TerrCode.length > 0 && TerrMgr.length > 0)
{
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED")
{
location.href=location.href;
}
else if (Send.responseText.indexOf("Error: ") >= 0)
{
alert(Send.responseText);
}
else
{
var UID = Send.responseText;
EditRepUser(UID);
}
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'SaveNewRepUser=1&UserID=' + encodeURIComponent(UserID) + '&FirstName=' + encodeURIComponent(FirstName) + '&LastName=' + encodeURIComponent(LastName) + '&Email=' + encodeURIComponent(Email) + '&Phone=' + encodeURIComponent(Phone) + '&TerrCode=' + encodeURIComponent(TerrCode) + '&TerrMgr=' + encodeURIComponent(TerrMgr);
Send.send(Data);
}
else
{
alert("Missing Fields\nPlease Fill In All The Fields");
}
}
function DeleteRep(ID)
{
var Confirm = confirm("This will delete this Rep and can NOT be undone.\nAre you sure?");
if (Confirm == true)
{
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
FetchRepUsers()
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'DeleteRep=1';
Send.send(Data);
}
}
function RemovedAssignedSalonsKPSS()
{
SalonList = "";
Obj = document.getElementById('AssignedSalonsKPSS');
for (var i=0; i <= Obj.length; i++)
{
try
{
if (Obj.options[i].selected == true)
{
SalonList = SalonList + ":" + Obj.options[i].value;
}
}
catch (e)
{ }
}
if (SalonList.length > 0)
{
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText == "LOCKED") location.href=location.href;
EditRepUser("Current");
}
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'RemoveAssignedSalonsKPSS=1&SalonList=' + encodeURIComponent(SalonList);
Send.send(Data);
}
}
function SortAssignedSalonsKPSS(sortBy, SelectedSalons)
{
EditRepUser("Current", sortBy, SelectedSalons);
// var Sort = SetupConnection();
// Sort.onreadystatechange=function()
// {
// if (Sort.readyState == 4)
// {
// if (Sort.status == 200)
// {
// if (Sort.responseText == "LOCKED") location.href=location.href;
// EditRepUser("Current");
// }
// }
// };
// Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
// Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
// var Data = 'SortAssignedSalonsKPSS=1&SalonList=' + encodeURIComponent(SalonList) + '&SortBy=' + encodeURIComponent(sortBy);
// Send.send(Data);
}
function AssignedSalonsKPSSSelectChange(sortBy, SelectedSalons)
{
EditRepUser("Current", sortBy, SelectedSalons)
}
function ShowMassChangeDSC()
{
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
document.getElementById('MassChangeDiv').innerHTML = HTML;
}
}
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ShowMassChangeDSC=1';
Show.send(Data);
}
function ShowSalonsForMassChangeDSC()
{
var Source = "";
try
{
Source = document.getElementById('Source').options[document.getElementById('Source').selectedIndex].value;
}
catch (e)
{ }
if (Source != "")
{
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
if (Show.responseText)
{
document.getElementById('SalonList').innerHTML = Show.responseText;
document.getElementById('SalonList').style.display = "block";
}
else
{
document.getElementById('SalonList').innerHTML = "No Salons";
document.getElementById('SalonList').style.display = "block";
}
document.getElementById('Grayout').style.display = "none";
document.getElementById('WaitScreen').style.display = "none";
}
}
else
{
document.getElementById('WaitScreenMsg').innerHTML = "Loading Salons, Please Wait . . .";
document.getElementById('Grayout').style.display = "block";
document.getElementById('WaitScreen').style.display = "block";
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ShowSalonsForMassChangeDSC=1&Source=' + encodeURIComponent(Source);
Show.send(Data);
}
else
{
document.getElementById('SalonList').style.display = "none";
}
}
function ExecuteMassChangeDSC()
{
try
{
var Source = document.getElementById('Source').options[document.getElementById('Source').selectedIndex].value;
var Target = document.getElementById('Target').options[document.getElementById('Target').selectedIndex].value;
var Type = document.getElementById('Type').options[document.getElementById('Type').selectedIndex].value;
var SalonList = "";
Obj = document.getElementById('Salons');
while (Obj.selectedIndex != -1)
{
SalonList = SalonList + ":" + Obj.options[Obj.selectedIndex].value;
Obj.options[Obj.selectedIndex].selected = false;
}
}
catch (e)
{ }
if (Source.length > 0 && Target.length > 0 && Type.length > 0 && SalonList.length > 0)
{
if (Type == "Copy")
{
if (Source == "Unassigned" || Target == "Unassigned")
{
if (Source == "Unassigned")
{
var Msg = "Can Not Copy From Unassigned\nUse Move Instead?";
}
else if (Target == "Unassigned")
{
var Msg = "Can Not Copy To Unassigned\nUse Move Instead?";
}
var Confirm = confirm(Msg);
if (Confirm == true)
{
Type = "Move";
document.getElementById('Type').selectedIndex = 0;
}
else
{
return;
}
}
}
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText)
{
if (Send.responseText == "LOCKED")
{
location.href=location.href;
}
else
{
alert(Send.responseText);
}
}
else
{
ShowSalonsForMassChangeDSC();
document.getElementById('Target').selectedIndex = 0;
}
}
}
else
{
document.getElementById('WaitScreenMsg').innerHTML = "Processing, Please Wait . . .";
document.getElementById('Grayout').style.display = "block";
document.getElementById('WaitScreen').style.display = "block";
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ExecuteMassChangeDSC=1&Source=' + encodeURIComponent(Source) + '&Target=' + encodeURIComponent(Target) + '&Type=' + encodeURIComponent(Type) + '&SalonList=' + encodeURIComponent(SalonList);
Send.send(Data);
}
else
{
alert("Please Fill In All Options");
}
}
function ShowMassChangeKPSS()
{
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
document.getElementById('MassChangeDiv').innerHTML = HTML;
}
}
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ShowMassChangeKPSS=1';
Show.send(Data);
}
function ShowSalonsForMassChangeKPSS()
{
var Source = "";
try
{
Source = document.getElementById('Source').options[document.getElementById('Source').selectedIndex].value;
}
catch (e)
{ }
var StateSelected = "";
try
{
StateSelected = document.getElementById('SalonsStateSelect').options[document.getElementById('SalonsStateSelect').selectedIndex].value;
}
catch (e)
{ }
var DistribSelected = "";
try
{
DistribSelected = document.getElementById('SalonsDistribSelect').options[document.getElementById('SalonsDistribSelect').selectedIndex].value;
}
catch (e)
{ }
var OtherSelected = "";
try
{
OtherSelected = document.getElementById('SalonsOtherSelect').options[document.getElementById('SalonsOtherSelect').selectedIndex].value;
}
catch (e)
{ }
if (Source != "")
{
var Show = SetupConnection();
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
if (Show.responseText)
{
document.getElementById('SalonList').innerHTML = Show.responseText;
document.getElementById('SalonList').style.display = "block";
document.getElementById('MassChangeAction').style.display = "block";
}
else
{
document.getElementById('SalonList').innerHTML = "No Salons";
document.getElementById('SalonList').style.display = "block";
document.getElementById('MassChangeAction').style.display = "none";
}
document.getElementById('Grayout').style.display = "none";
document.getElementById('WaitScreen').style.display = "none";
}
}
else
{
document.getElementById('WaitScreenMsg').innerHTML = "Loading Salons, Please Wait . . .";
document.getElementById('Grayout').style.display = "block";
document.getElementById('WaitScreen').style.display = "block";
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ShowSalonsForMassChangeKPSS=1&Source=' + encodeURIComponent(Source) + '&StateSelected='+encodeURIComponent(StateSelected) + '&DistribSelected='+encodeURIComponent(DistribSelected) + '&OtherSelected='+encodeURIComponent(OtherSelected);
Show.send(Data);
}
else
{
document.getElementById('SalonList').style.display = "none";
}
}
function ExecuteMassChangeKPSS()
{
try
{
var Source = document.getElementById('Source').options[document.getElementById('Source').selectedIndex].value;
var Target = document.getElementById('Target').options[document.getElementById('Target').selectedIndex].value;
var Type = document.getElementById('Type').options[document.getElementById('Type').selectedIndex].value;
var SalonList = "";
Obj = document.getElementById('Salons');
while (Obj.selectedIndex != -1)
{
SalonList = SalonList + ":" + Obj.options[Obj.selectedIndex].value;
Obj.options[Obj.selectedIndex].selected = false;
}
}
catch (e)
{ }
if (Source.length > 0 && Target.length > 0 && Type.length > 0 && SalonList.length > 0)
{
if (Type == "Copy")
{
if (Source == "Unassigned" || Target == "Unassigned")
{
if (Source == "Unassigned")
{
var Msg = "Can Not Copy From Unassigned\nUse Move Instead?";
}
else if (Target == "Unassigned")
{
var Msg = "Can Not Copy To Unassigned\nUse Move Instead?";
}
var Confirm = confirm(Msg);
if (Confirm == true)
{
Type = "Move";
document.getElementById('Type').selectedIndex = 0;
}
else
{
return;
}
}
}
var Send = SetupConnection();
Send.onreadystatechange=function()
{
if (Send.readyState == 4)
{
if (Send.status == 200)
{
if (Send.responseText)
{
if (Send.responseText == "LOCKED")
{
location.href=location.href;
}
else
{
alert(Send.responseText);
}
}
else
{
ShowSalonsForMassChangeKPSS();
document.getElementById('Target').selectedIndex = 0;
}
}
}
else
{
document.getElementById('WaitScreenMsg').innerHTML = "Processing, Please Wait . . .";
document.getElementById('Grayout').style.display = "block";
document.getElementById('WaitScreen').style.display = "block";
}
};
Send.open("POST", "http://thesalonalliance.com/ajax.php", true);
Send.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'ExecuteMassChangeKPSS=1&Source=' + encodeURIComponent(Source) + '&Target=' + encodeURIComponent(Target) + '&Type=' + encodeURIComponent(Type) + '&SalonList=' + encodeURIComponent(SalonList);
Send.send(Data);
}
else
{
alert("Please Fill In All Options");
}
}
function accountStatusChange(SID)
{
val=document.getElementById('AcctStatus').value;
$('.NoBoothRenterDisplay').show();
$('.OnlyBoothRenterDisplay').hide();
$('.OnlySalonAllianceDisplay').hide();
$('.NoSalonAllianceDisplay').show();
$('#school_show').hide();
$('#keyaccount_regional_show').hide();
$('#keyaccount_regional_school_show').hide();
$('#points_show').hide();
$('#karp_show').hide();
switch(val)
{
case 'School':
// document.getElementById('karp_show').style.display='inline';
// document.getElementById('karp_show').style.visibility='visible';
$('#karp_show').show();
// document.getElementById('school_show').style.display='inline';
// document.getElementById('school_show').style.visibility='visible';
$('#school_show').show();
// document.getElementById('keyaccount_regional_school_show').style.display='inline';
// document.getElementById('keyaccount_regional_school_show').style.visibility='visible';
$('#keyaccount_regional_school_show').show();
break;
case 'Regional Chain':
// document.getElementById('karp_show').style.display='inline';
// document.getElementById('karp_show').style.visibility='visible';
$('#karp_show').show();
// document.getElementById('keyaccount_regional_show').style.display='inline';
// document.getElementById('keyaccount_regional_show').style.visibility='visible';
$('#keyaccount_regional_show').show();
// document.getElementById('keyaccount_regional_school_show').style.display='inline';
// document.getElementById('keyaccount_regional_school_show').style.visibility='visible';
$('#keyaccount_regional_school_show').show();
break;
case 'Key Account':
// document.getElementById('karp_show').style.display='inline';
// document.getElementById('karp_show').style.visibility='visible';
$('#karp_show').show();
// document.getElementById('keyaccount_regional_show').style.display='inline';
// document.getElementById('keyaccount_regional_show').style.visibility='visible';
$('#keyaccount_regional_show').show();
// document.getElementById('keyaccount_regional_school_show').style.display='inline';
// document.getElementById('keyaccount_regional_school_show').style.visibility='visible';
$('#keyaccount_regional_school_show').show();
break;
case 'Booth Renter':
$('.NoBoothRenterDisplay').hide();
$('.OnlyBoothRenterDisplay').show();
$('#points_show').show();
break;
case 'Salon Alliance':
$('.NoSalonAllianceDisplay').hide();
$('.OnlySalonAllianceDisplay').show();
break;
default:
// document.getElementById('points_show').style.display='inline';
// document.getElementById('points_show').style.visibility='visible';
$('#points_show').show();
break;
}
}
function refreshBanner(SID)
{
var Show = SetupConnection();
//ajaxLoading('Banner');
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
HTML = HTML.replace("", "");
HTML = HTML.substring(0, HTML.lastIndexOf("
")-1);
document.getElementById('Banner').innerHTML = HTML;
}
}
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'RefreshBanner=1&SID=' + encodeURIComponent(SID);
Show.send(Data);
}
function refreshMenu()
{
var Show = SetupConnection();
//ajaxLoading('Menu');
Show.onreadystatechange=function()
{
if (Show.readyState == 4)
{
if (Show.status == 200)
{
if (Show.responseText == "LOCKED") location.href=location.href;
var HTML = Show.responseText;
if (HTML)
{
document.getElementById('Menu').innerHTML = HTML;
}
}
}
};
Show.open("POST", "http://thesalonalliance.com/ajax.php", true);
Show.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var Data = 'RefreshMenu=1';
Show.send(Data);
}
function ajaxLoading(element, message)
{
//return false;
var HTML = "";
if (element)
{
if (message)
{
HTML = HTML + "" + message + "
";
}
HTML = HTML + '
';
document.getElementById(element).innerHTML = HTML;
}
}
function checkIfAuthOnlyEmailAlreadyExists(emailAddress)
{
// if (emailAddress.length > 0) {
// var ajaxConn = SetupConnection();
// ajaxConn.onreadystatechange=function()
// {
// alert('readystate = ' + ajaxConn.readyState)
// if (ajaxConn.readyState == 4)
// {
// alert('status = ' + ajaxConn.status)
// if (ajaxConn.status == 200)
// {
// var HTML = ajaxConn.responseText;
// alert(HTML);
// if (HTML)
// {
// alert('HTML');
// return HTML;
// }
// }
// }
// }
// ajaxConn.open("POST", "http://thesalonalliance.com/ajax.php", true);
// ajaxConn.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
// var Data = 'checkIfAuthOnlyEmailAlreadyExists=1&email='+encodeURIComponent(emailAddress);
// ajaxConn.send(Data);
// alert(Data);
//}
// var aoUrl = 'http://thesalonalliance.com/ajax.php';
// var aoData = 'checkIfAuthOnlyEmailAlreadyExists=1&email=' + encodeURIComponent($("#aoEmailAddress").val());
$.ajax({
type: "POST",
url: 'http://thesalonalliance.com/ajax.php',
data: 'checkIfAuthOnlyEmailAlreadyExists=1&email=' + encodeURIComponent($("#aoEmailAddress").val()),
dataType: 'text',
async: false,
success: function(data) {
if (data) {
$("#aoEmailAddressError").append("This email address is already in use by user: " + data);
} else {
$("#aoEmailAddressError").text('');
}
}
})
}