///////////////////////////////////////////////////////////////////////////////
//
txtFeldArr = ["txtName", "txtVorname", "txtStrasse", "txtOrt", "txtTel", "txtFax", "txtEmail", "txtWeb", "txtMessage"];
txtLabelArr = ["Name", "Vorname", "Straße", "PLZ/Ort", "Telefon", "Fax", "Email", "Website", "Nachricht"];
//
///////////////////////////////////////////////////////////////////////////////
//
fncClear = function (obj1, index) {
obj1.text = txtLabelArr[index];
};
//----------------------------------------------------------------------------
fncOldStyle = function (obj2) {
obj2.textColor = "0x777777";
obj2.borderColor = "0xAAAAAA";
obj2.backgroundColor = "0xFFFFFF";
};
//----------------------------------------------------------------------------
fncNewStyle = function (obj3) {
obj3.textColor = "0x0066FF";
obj3.borderColor = "0x003366";
obj3.backgroundColor = "0xF5F5F5";
};
//----------------------------------------------------------------------------
fncCheckContent = function (obj4) {
if (obj4.text == txtLabelArr[obj4.i]) {
obj4.text = "";
} else if ((obj4.text == "")) {
fncClear(obj4, obj4.i);
}
};
//
///////////////////////////////////////////////////////////////////////////////
//
fncInit = function () {
for (i=0; i<txtFeldArr.length; i++) {
currentTxtFeld = 0;
prevtTxtFeld = 0;
// --------------------------------------------------------------------
mcFormular[txtFeldArr[i]].i = i;
// --------------------------------------------------------------------
fncClear(mcFormular[txtFeldArr[i]], mcFormular[txtFeldArr[i]].i);
fncOldStyle(mcFormular[txtFeldArr[i]]);
// --------------------------------------------------------------------
mcFormular[txtFeldArr[i]].onSetFocus = function() {
prevtTxtFeld = currentTxtFeld;
currentTxtFeld = this;
// ----------------------------------------------------------------
fncNewStyle(currentTxtFeld);
fncOldStyle(prevtTxtFeld);
// ----------------------------------------------------------------
fncCheckContent(currentTxtFeld);
fncCheckContent(prevtTxtFeld);
};
}
};
//
///////////////////////////////////////////////////////////////////////////////
//
fncSend = function () {
felderVoll = false;
emailRichtig = false;
for (i=0; i<txtFeldArr.length; i++) {
if ((mcFormular[txtFeldArr[i]].text == "") || (mcFormular[txtFeldArr[i]].text == txtLabelArr[i])) {
mcFormular[txtFeldArr[i]].textColor = "0xFF0000";
mcFormular.txtStatus.text = "Alle Felder korrekt ausfüllen";
felderVoll = false;
} else {
felderVoll = true;
}
// --------------------------------------------------------------------
if ((mcFormular.varEmail.indexOf("@")<2) || (mcFormular.varEmail.indexOf(".")<5)) {
mcFormular.txtEmail.textColor = "0xFF0000";
mcFormular.txtStatus.text = "Alle Felder korrekt ausfüllen";
emailRichtig = false;
} else {
emailRichtig = true;
}
}
// ------------------------------------------------------------------------
if ((felderVoll == true) && (emailRichtig == true)) {
mcFormular.txtStatus.text = "Daten gesendet ...";
mcFormular.loadVariables("flashMail.php", "POST");
}
};
//
///////////////////////////////////////////////////////////////////////////////
//
mcFormular.btnClear.txtLabel.text = "löschen";
mcFormular.btnSend.txtLabel.text = "senden";
//----------------------------------------------------------------------------
mcFormular.btnClear.onRollOver = mcFormular.btnSend.onRollOver=function () {
this.txtLabel.textColor = "0xFFFFFF";
};
mcFormular.btnClear.onRollOut = mcFormular.btnSend.onRollOut=function () {
this.txtLabel.textColor = "0x000000";
};
//----------------------------------------------------------------------------
mcFormular.btnClear.onPress = mcFormular.btnSend.onPress=function () {
this.txtLabel._x = this.txtLabel._y += 1;
};
mcFormular.btnClear.onReleaseOutside = mcFormular.btnSend.onReleaseOutside=function () {
this.txtLabel.textColor = "0x000000";
this.txtLabel._x = this.txtLabel._y -= 1;
};
//----------------------------------------------------------------------------
mcFormular.btnClear.onRelease = function() {
this.txtLabel._x = this.txtLabel._y -= 1;
fncInit();
};
mcFormular.btnSend.onRelease = function() {
this.txtLabel._x = this.txtLabel._y -= 1;
fncSend();
};
//
///////////////////////////////////////////////////////////////////////////////
//
fncInit();