function NoLoginFunction() {
	
}
NoLoginFunction.prototype = new DXMLHttpRequestShell();
NoLoginFunction.constructor = NoLoginFunction;
NoLoginFunction.prototype.onLoad = function() {
    if (this.getResponseText() == "OK") {
		if(action == "mail") {
			window.location = BASE_URL + dataProvider.vendorId + "/newmail.html"
		} else if (action == "favorite") {
			this.fastGetUrl(BASE_URL + dataProvider.vendorId + "/addfavorites.html");
			window.location = BASE_URL + "favorites-vendors/" + dataProvider.categoryId + ".html"
		} else if(action == "note") {
			window.location = BASE_URL + dataProvider.vendorId + "/addnote.html"		
		} else {
			window.location = BASE_URL + "login-vendors.html";
		} 
    } else {
    	this.ErrorMessage('Invalid username or password!');
    }
}
NoLoginFunction.prototype.send = function() {
    this.init();

    uname = document.getElementById("idname").value;
    passwd =  document.getElementById("idpass").value;

    if( uname == "" || passwd == "") {
    	this.clear();
		document.getElementById("trname").style.color="#DA1347";
		document.getElementById("trpasswd").style.color="#DA1347";
		document.getElementById("aMsg").innerHTML = 'All fields are required!';
    	return;
    } else {
    	document.getElementById("trname").style.color="";
    	document.getElementById("trpasswd").style.color="";
   		this.fastPostUrl("nologin.html", "username=" + uname + "&pass=" + passwd);
   	}
}
NoLoginFunction.prototype.clear = function() {
    	document.getElementById("idname").value = "";
    	document.getElementById("idpass").value = "";
}
NoLoginFunction.prototype.clearClose = function(msg) {
		document.getElementById("flashPlayer").style.visibility = "visible";
		if (document.getElementById("vendorsGalleryPane").style.height != "460px") {
			document.getElementById("Zoom").style.visibility = "visible";
		}
		document.getElementById("loginRequired").style.display = "none";
		document.getElementById("trname").style.color="";
		document.getElementById("trpasswd").style.color="";
		document.getElementById("upload").style.display = "none";
		document.getElementById("aMsg").innerHTML = "";
		document.getElementById("message").value = "I found this while doing some wedding research.  Check it out:";
		resizeHandler.openWindow = false;
		this.clear();
}
NoLoginFunction.prototype.ErrorMessage = function(msg) {
	document.getElementById("aMsg").innerHTML = msg;
	this.clear();
}
NoLoginFunction.prototype.CloseShareWin = function() {
	shareWin.close();
	resizeHandler.openWindow = false;
	document.getElementById("flashPlayer").style.visibility = "visible";
	if (document.getElementById("vendorsGalleryPane").style.height != "460px") {
		document.getElementById("Zoom").style.visibility = "visible";
	}
	document.getElementById("sMsg").innerHTML = "";
	document.getElementById("upload").style.display = "none";
	document.getElementById("message").value = "I found this while doing some wedding research.  Check it out:";
}
function alertMessage(whoMessage) {
	resizeHandler.openWindow = true;
   	document.getElementById("upload").style.display = "inline";
   	document.getElementById("Zoom").style.visibility = "hidden";
   	resizeHandler.setNewTransparentCoordinate();
   	if(whoMessage == 1) {
   		loginRequiredWin.open();
   		resizeHandler.selectWindow = 1;
   	} else if(whoMessage == 2) {
   		shareWin.open();
   		resizeHandler.selectWindow = 2;
   	}
   	resizeHandler.setNewWindowCoordinates();
}
