var gfunc;var allLicense=[{display:"1-Year subscription code",paypal:"1-Year subscription code",swreg:2,gross:"49.00",currency:"USD"},{display:"1-Year subscription code(EUR)",paypal:"1-Year subscription code(EUR)",swreg:-1,gross:"35.00",currency:"EUR"},{display:"1-Year subscription code(GBP)",paypal:"1-Year subscription code(GBP)",swreg:-1,gross:"30.00",currency:"GBP"},{display:"1-Year subscription code(JPY)",paypal:"1-Year subscription code(JPY)",swreg:-1,gross:"4900.00",currency:"JPY"}];var selLicenseIndex=0;(function(){var c='<table cellspacing="2" cellpadding="5" border="1" id="purchaseTable" class="listTable" summary="Buy XMindPro Subscription Codes"><thead><tr><th class="th-license">Item</th><th class="th-price">Price</th><th class="th-buy">Paypal<span class="red"> * </span></th><th class="th-buy">SWReg</th></tr></thead><tbody>';for(index in allLicense){var b=allLicense[index];var a="tr";if(index%2==0){a+=2}else{a+=1}c+='<tr class="'+a+'"><td class="td-code-count">'+b.display+'</td><td class="price">'+b.currency+" "+b.gross+'</td><td><a href="#" onclick="javascript: paypal('+index+'); return false;" class="paypal">Buy</a></td><td>';if(b.swreg>0){c+='<a href="#" onclick="javascript: swreg('+index+'); return false;" class="swreg">Buy</a>'}c+="</td></tr>"}c+="</tbody></table>";document.getElementById("tbLicense").innerHTML=c})();function paypal(a){gfunc=function(c,d){var b=document.getElementById("paypal_form");b.item_name.value=c.display;b.item_number.value=c.paypal;b.amount.value=c.gross;b.quantity.value=d;b.currency_code.value=c.currency;b.submit()};reg(a)}function swreg(a){gfunc=function(c,d){var b="https://usd.swreg.org/cgi-bin/s.cgi?s=46266&p=46266-2009&v="+c.swreg+"&d=0&q="+d;window.location.href=b};reg(a)}function updateQuantitySelection(){var a=$("#quantitySelect")[0];if(a.options[a.selectedIndex].value==="other"){$("#quantityInput").show();$(a).hide()}}function reg(a){$("#purchaseTable").hide();$("#reg_info").show();selLicenseIndex=a}function back(){$("#purchaseTable").show();$("#reg_info").hide()}function buy(){var d=$("#reg_info_form").formObject();if(d.age==="-"||d.channel==="-"||d.purchase_factor==="-"||d.usage_factor==="-"){alert("Please fill in all of the fields.");return}var c=allLicense[selLicenseIndex];var b=$("#quantitySelect")[0];var a=b.options[b.selectedIndex].value;if(a==="other"){a=$("#quantityInput").valu();if(isNaN(a)||((a=parseInt(a))<=0)){alert("Please fill Number in the Quantity field.");return}}$.aj("POST","/_res/survey",{reqType:"form",body:{surveyno:"purchase_survey",source:document.referrer,xmind_answer:"age="+d.age+"\nchannel="+d.channel+"\npurchase_factor="+d.purchase_factor+"\nusage_factor="+d.usage_factor+"\n"},complete:function(){gfunc(c,a)}})};