$(document).ready(function () { var options1 = { target: '', beforeSubmit: showRequest, success: showResponse }; var optionsReport = { target: '', beforeSubmit: showRequestReport, success: showResponseReport }; $('form').submit(function () { if ($('#hiduserpanel').val() == 'yes') { RedirectToLoginPage(this.Category.value, this.Item.value); return false } if (this.Category) { if ((this.Category.value == "REMEDYSP") || (this.Category.value == "POOJAS") || (this.Category.value == "HOMAS") || (this.Category.value == "REMEDYEN") || (this.Category.value == "DKRP") || (this.Category.value == "REMEDYBS") || (this.Item.value == "GOODORBADPLANETS") || (this.Item.value == "200912-JTASTREPHOM") || (this.Item.value == "200912-JTASTREPJUPTRA32") || (this.Item.value == "VADISTATUEI") || (this.Item.value == "VADICRYSTALMALA") || (this.Category.value == "GEMSTONES")) { document.commonForm.tosubmit.value = this.name; var arrElement = $('#commonForm :input'); var signusr = 'no'; for (i = 0; i < arrElement.length; i++) { if (arrElement[i].name.toLowerCase() == "userdetail" && $('#otinput').html() == '') { this.UserDetail.value = arrElement[i].value; signusr = 'yes' } } if (signusr == 'yes') { $(this).ajaxSubmit(options1); return false } else { } } else if ((this.Category.value == "REPRT") || (this.Category.value == "AREPRT")) { document.commonForm.tosubmit.value = this.name; $("#dlggcmmfrm").dialog("open"); return false } else { $(this).ajaxSubmit(options1) } } else { $(this).ajaxSubmit(options1) } return false }); $("#dlggcmmfrm").dialog({ bgiframe: true, autoOpen: false, width: 485, modal: true, title: "", buttons: { Ok: function () { frm = eval("document." + $("#tosubmit").val()); var arrElement = $('#commonForm :input'); for (i = 0; i < arrElement.length; i++) { if (arrElement[i].name.toLowerCase() == "nobirthstar") { document.location.href = '/account/update.asp' } if (arrElement[i].name.toLowerCase() == "name") { frm.Name.value = arrElement[i].value } if (arrElement[i].name.toLowerCase() == "nakno") { frm.NakNo.value = arrElement[i].value } if (arrElement[i].name.toLowerCase() == "userdetail") { frm.UserDetail.value = arrElement[i].value } if (arrElement[i].name.toLowerCase() == "partner") { frm.Partner.value = arrElement[i].value } if (arrElement[i].name.toLowerCase() == "monthlypay") { if (arrElement[i].checked) { frm.monthlypay.value = arrElement[i].value } } if (arrElement[i].name.toLowerCase() == "deposit") { if (arrElement[i].checked) { frm.deposit.value = arrElement[i].value } } if (arrElement[i].name.toLowerCase() == "paymethod") { frm.paymethod.value = arrElement[i].value } if (arrElement[i].name.toLowerCase() == "ship") { if (arrElement[i].checked) { frm.ship.value = arrElement[i].value } } } $("#otinput").html(""); if (frm.Category.value == "REPRT" || frm.Category.value == "AREPRT") $("[name='" + $("#tosubmit").val() + "']").ajaxSubmit(optionsReport); else $("[name='" + $("#tosubmit").val() + "']").ajaxSubmit(options1); $(this).dialog('close') }, Cancel: function () { $(this).dialog('close'); $("#otinput").html("") } }, close: function (event) { $("#otinput").html("") } }); $("#reportdialog").dialog({ bgiframe: true, autoOpen: false, height: 540, width: 770, modal: true, title: "Reports", buttons: { Close: function () { window.location.reload(); $(this).dialog('close') } } }); $("#reportdialog").bind('dialogclose', function (event, ui) { window.location.reload() }) }); function RedirectToLoginPage(m_Category, m_Item) { window.location.href = "/account/login.asp?lcategory=" + m_Category + "&litem=" + m_Item } $(document).ready(function () { $('<div id="addtocartwrapper"></div>').prependTo('body'); $("#addtocartwrapper").dialog({ bgiframe: true, autoOpen: false, width: 400, modal: true, position: [600, 50], resizable: false, closeOnEscape: true, hide: 'slow', stack: true }); $("#addtocartwrapper").siblings('div.ui-dialog-titlebar').remove(); $('#addtocartwrapper').parent().removeAttr('class'); $('#addtocartwrapper').css({ 'border-radius': '8px', '-moz-border-radius': '8px', '-webkit-border-radius': '8px', 'border': '8px solid #858585', 'background': '#fff !important', 'padding': '4px' }) }); function showRequest(formData, jqForm, options) { var Item = ""; $(".failure, .success").hide(); temp = ""; if (jqForm[0].elmtarget) { temp = "#" + jqForm[0].elmtarget.value } else { temp = "#" + jqForm[0].Item.value; Item = jqForm[0].Item.value } options["target"] = $("#addtocartwrapper"); if (Item != "NUMEROLOGY" && Item != "TRANSIT" && Item != "INFLUENCE" && Item != "COMPATIBILITY" && Item != "BSTAR" && Item != "CHART" && Item != "MSIGN") { $("#addtocartwrapper").dialog("open") } $("#addtocartwrapper").html("<div class='loading' style='background-color: #f0e256; border-radius: 8px; -moz-border-radius: 8px; -webkit-border-radius: 8px; color:#000;'>&nbsp;&nbsp;&nbsp;<b>Adding Your Item To Cart. Please Wait...</b> &nbsp;&nbsp;<img src='/images/loading.gif'><br /><br /></div>"); return true } function showResponse(responseText, statusText) { $(".shopbag").click(function () { location.href = '/cart/placeorder.asp'; return false }) } function showRequestReport(formData, jqForm, options) { $(".failure, .success").hide(); $("#reportdialog").dialog('option', 'title', $('#rtitle').val()); $("#reportdialog").dialog('open'); $("#reportdialog").html("<div class='loading'>Loading...&nbsp;&nbsp;<img src='/images/loading.gif'></div>"); options["target"] = "#reportdialog"; return true } function showResponseReport(responseText, statusText) { $("#PWFORM2").html(responseText); $("#PWFORM2").dialog("open") } function submitMantraForm(formName, szItem) { if ($('#hiduserpanel').val() == 'yes') { RedirectToLoginPage(formName.Category.value, szItem); return false } var countrycode = formName.tmpccode.value; var strItem = new String(); var monthlypay = "0"; strItem = szItem; var countrycode = formName.tmpccode.value; if (formName.tmpccode.value == "USD") { if ((strItem.indexOf("3", 1) >= 0) || (strItem.indexOf("4", 1) >= 0)) { if (strItem.indexOf("2", 1) >= 0) monthlypay = "1"; else monthlypay = "3"; $('#dlggcmmfrm').dialog('option', 'height', 200); $("#divuserdetglobal").hide(); $("#otinput").html("<div><label style='width:250px;'>Do you want to ship the written mantras?</label><input type=radio value=1 name=ship checked='checked' style='width:50px'>Yes<input type=radio value=0 name=ship style='width:50px'>No</div><div><label style='width:250px;'>Do you want to pay monthly?</label><input type=radio value=1 name=monthlypay onClick='mntpayenable(\"" + szItem + "\",\"" + countrycode + "\")' style='width:50px'>Yes<input type=radio value=0 name=monthlypay checked onClick='mntpaydisable()' style='width:50px'>No</div><div id='paymentmt'></div>") } } else { if ((strItem.indexOf("2", 1) >= 0) || (strItem.indexOf("3", 1) >= 0) || (strItem.indexOf("4", 1) >= 0)) { if (strItem.indexOf("2", 1) >= 0) monthlypay = "1"; else monthlypay = "3"; $('#dlggcmmfrm').dialog('option', 'height', 260, 'width', 460); $("#otinput").html("<div><input type=hidden name=ship id=ship value=0 /> </div><div><label style='width:250px;'>Do you want to pay monthly?</label><input type=radio value=3 name=monthlypay onClick='mntpayenable(\"" + szItem + "\",\"" + countrycode + "\")' style='width:50px' >Yes<input type=radio value=0 name=monthlypay checked onClick='mntpaydisable()' style='width:50px'>No</div><div id='paymentmt'></div>") } } formName.Item.value = szItem; document.commonForm.tosubmit.value = formName.name; $("#dlggcmmfrm").dialog("open") } function mntpayenable(strItem, countrycode) { if (strItem.indexOf("3", 1) >= 0) deposit = "500"; else deposit = "1000"; if (countrycode == "USD") { $("#paymentmt").html('<div><label style="width:250px;">Please select the payment method:</label><select name="paymethod" id="paymethod"><option value=1>12 payments</option><option value=2>24 payments</option></select></div><div><label style="width:250px;">Do you like to pay the deposit?(' + deposit + ')</label><input type=radio value=1 name=deposit style="width:50px">Yes<input type=radio value=0 name=deposit style="width:50px">No</div>') } } function mntpaydisable() { $("#paymentmt").html('') } function submitMantraFormpt(formName, szItem) { if ($('#hiduserpanel').val() == 'yes') { RedirectToLoginPage(formName.Category.value, szItem); return false } var countrycode = formName.tmpccode.value; var strItem = new String(); var monthlypay = "0"; strItem = szItem; var countrycode = formName.tmpccode.value; if (formName.tmpccode.value == "USD") { if ((strItem.indexOf("3", 1) >= 0) || (strItem.indexOf("4", 1) >= 0)) { if (strItem.indexOf("2", 1) >= 0) monthlypay = "1"; else monthlypay = "2"; $('#dlggcmmfrm').dialog('option', 'height', 200); $("#divuserdetglobal").hide(); $("#otinput").html("<div><label style='width:250px;'>Do you want to ship the written mantras?</label><input type=radio value=1 name=ship checked style='width:50px'>Yes<input type=radio value=0 name=ship style='width:50px'>No</div><div><label style='width:250px;'>Do you want to pay monthly?</label><input type=radio value=1 name=monthlypay onClick='mntpayenablept(\"" + szItem + "\",\"" + countrycode + "\")' style='width:50px'>Yes<input type=radio value=0 name=monthlypay checked onClick='mntpaydisablept()' style='width:50px'>No</div><div id='paymentmt'></div>") } } else { if ((strItem.indexOf("2", 1) >= 0) || (strItem.indexOf("3", 1) >= 0) || (strItem.indexOf("4", 1) >= 0)) { if (strItem.indexOf("2", 1) >= 0) monthlypay = "1"; else monthlypay = "3"; $('#dlggcmmfrm').dialog('option', 'height', 260, 'width', 460); $("#otinput").html("<div><input type=hidden name=ship id=ship value=0 /> </div><div><label style='width:250px;'>Do you want to pay monthly?</label><input type=radio value=3 name=monthlypay onClick='mntpayenablept(\"" + szItem + "\",\"" + countrycode + "\")' style='width:50px'>Yes<input type=radio value=0 name=monthlypay checked onClick='mntpaydisablept()' style='width:50px'>No</div><div id='paymentmt'></div>") } } formName.Item.value = szItem; document.commonForm.tosubmit.value = formName.name; $("#dlggcmmfrm").dialog("open") } function mntpayenablept(strItem, countrycode) { if (strItem.indexOf("3", 1) >= 0) deposit = "500"; else deposit = "1000"; if (countrycode == "USD") { $("#paymentmt").html('<div><label style="width:250px;">Please select the payment method:</label><select name="paymethod" id="paymethod"><option value=1>12 payments</option><option value=2>24 payments</option></select></div><div><label style="width:250px;">Do you like to pay the deposit?(' + deposit + ')</label><input type=radio value=1 name=deposit style="width:50px">Yes<input type=radio value=0 name=deposit style="width:50px">No</div>') } } function mntpaydisablept() { $("#paymentmt").html('') } function submitDKRPForm(formName, szItem) { $('#dlggcmmfrm').dialog('option', 'height', 270); $("#otinput").html("<div><p>Payment Type:</p><label>Full Payment</label><input type=radio value=FULLPAY name=Payment onClick='document.frmFULLPAY.Item.value=\"FULLPAY\"' checked style='width:50px'><br/><label>12 Payments</label><input type=radio value=MONTHLYPAY1 name=Payment onClick='document.frmFULLPAY.Item.value=\"MONTHLYPAY1\"' style='width:50px'><br/><label>4 Payments</label><input type=radio value=QUARTERPAY1 name=Payment onClick='document.frmFULLPAY.Item.value=\"QUARTERPAY1\"' style='width:50px'></div>"); formName.Item.value = szItem; document.commonForm.tosubmit.value = formName.name; $("#dlggcmmfrm").dialog("open") } function FillNameBirthStarItem(formName, szItem) { if ($('#hiduserpanel').val() == 'yes') { RedirectToLoginPage(formName.Category.value, szItem); return false } $('#divuserdetglobal').hide(); if ((szItem == "201009INDUMAMAHESHOMA") || (szItem == "2010096MONUMAMAHESHOMA") || (szItem == "20100912MONUMAMAHESHOMA") || (szItem == "201009INDUMAMAHESPOOJA") || (szItem == "2010096MONUMAMAHESPOOJA") || (szItem == "20100912MONUMAMAHESPOOJA")) { $('#dlggcmmfrm').dialog('option', 'height', 280); $("#otinput").html('<div><b>Note: Please Enter Your Spouse\'s Name.</b><br/><br/><table><tr><td align="right" width="40%"><b>Husband Name, BirthStar: </b></td><td width="60%"><Input type="text" name="Name3" id="Name3"></td></tr><tr><td align="right" width="40%"><b>Spouse Name, BirthStar: </b></td><td width="232"><Input type="text" name="Name2" id="Name2"></td></tr></table></div>'); formName.Item.value = szItem; document.commonForm.tosubmit.value = formName.name; $("#dlggcmmfrm").dialog("open"); return false } formName.Item.value = szItem; document.commonForm.tosubmit.value = formName.name; var options1 = { target: '', beforeSubmit: showRequest, success: showResponse }; $(formName).ajaxSubmit(options1) } function submitCharityForm() { amtType = $("[name='AmountRadio']:checked").val(); if (amtType == "fix") $("#Amount").val($("#FixAmount").val()); else $("#Amount").val($("#VariableAmount").val()); if ($("#Amount").val() == "") { $("#TRIPURA").html("<div class=failure>Please enter amount!</div>") } else $("#CharityForm").ajaxSubmit({ target: '#TRIPURA' }) } function AddItemToCart(formname) { $('#' + formname + '').ajaxSubmit({ success: function () { window.location.href = "/cart/placeorder.asp" } }) }
