function getMonthFee(oriFee)
{
//var monthFee = Math.round($oriFee-1+1.49,2)+1.00;
var monthFee = Math.ceil(oriFee);
return monthFee;
}
function getSetupFee(oriFee)
{
//var setupCharge = Math.round(theNumber[2]-1+1.49,2)+1.00;
var setupFee = Math.ceil(oriFee);
if (setupFee == 0) setupFee = 1;
return setupFee;
}
function checkAuthNumber(theNumber){
var num = theNumber.substring(1);
var prefix = theNumber.substring(0,1);
//alert('num=' + theNumber.substring(1));
if(prefix != '+') {
alert("pleaase use international phone format(+xxxxxxxxxx)!");
return;
} else if (isNaN(num)) {
alert("you entered an invalid phone number, only digits are allowed!");
return;
}
setChangeStatus();
return;
}
function checkNumber(theNumber){
var phoneInput = document.getElementById('phone_error_msg');
if (isNaN(theNumber)) {
phoneInput.innerHTML="(invalid number, please enter digits only)";
phoneInput.setAttribute('class','com_txt_error');
setPassStatus();
} else {
initPassStatus();
phoneInput.innerHTML="";
phoneInput.setAttribute('class','password_txt');
}
return;
}
function isValidEmail(str)
{
return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}
function verifyLogin()
{
var at=document.getElementById("vLoginEmail").value.indexOf("@");
if(at == -1) {
alert(" Not a valid e-mail!");
return false;
}
return true;
}
var timeout = 500;
var closetimer = 0;
var ddmenuitem = 0;
function mopen(id)
{
// cancel close timer
mcancelclosetime();
// close old layer
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
// get new layer and show it
ddmenuitem = document.getElementById(id);
ddmenuitem.style.visibility = 'visible';
}
// close showed layer
function mclose()
{
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}
// go close timer
function mclosetime()
{
closetimer = window.setTimeout(mclose, timeout);
}
// cancel close timer
function mcancelclosetime()
{
if(closetimer)
{
window.clearTimeout(closetimer);
closetimer = null;
}
}
var baseopacity=30;
var browserdetect;
function fadeupimg(imgId) {
if (BrowserDetect.browser=="Explorer") {
slowhigh(imgId)
} else {
opacity(imgId, 100, 80, 100);
}
}
function fadedownimg(imgId) {
if (BrowserDetect.browser=="Explorer") {
slowlow(imgId)
} else {
opacity(imgId, 80, 100, 100);
}
}
function slowhigh(which2){
imgobj=which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval("gradualfade(imgobj)",50)
}
function slowlow(which2){
imgobj=which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
cleartimer()
instantset(baseopacity)
highlighting=setInterval("gradualfade(imgobj)",100)
}
function instantset(degree){
if (BrowserDetect.browser=="Explorer")
imgobj.filters.alpha.opacity=degree
else if (BrowserDetect.browser=="Firefox")
imgobj.style.MozOpacity=degree/100
else if (BrowserDetect.browser=="Opera")
imgobj.style.opacity=degree/100
else if (BrowserDetect.browser=="Chrome")
imgobj.style.KhtmlOpacity=degree/100
else
imgobj.style.KhtmlOpacity=degree/100
}
function instantset_old(degree){
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
imgobj.filters.alpha.opacity=degree
else imgobj.style.KhtmlOpacity=degree/100
}
function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}
function gradualfade(cur2){
if (BrowserDetect.browser=="Firefox" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
else if (BrowserDetect.browser=="Explorer" && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (BrowserDetect.browser=="Chrome" && cur2.style.KhtmlOpacity<1)
cur2.style.KhtmlOpacity=Math.min(parseFloat(cur2.style.KhtmlOpacity)+0.1, 0.99)
else if (BrowserDetect.browser=="Opera" && cur2.style.Opacity<1)
cur2.style.Opacity=Math.min(parseFloat(cur2.style.Opacity)+0.1, 0.99)
else if (window.highlighting)
clearInterval(highlighting)
else
cur2.style.KhtmlOpacity=Math.min(parseFloat(cur2.style.KhtmlOpacity)+0.1, 0.99)
}
function gradualfade_old(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
else
cur2.style.KhtmlOpacity=Math.min(parseFloat(cur2.style.KhtmlOpacity)+0.1, 0.99)
}
function opacity(id, opacStart, opacEnd, millisec) {
//speed for each frame
var speed = Math.round(millisec / 100);
var timer = 0;
//determine the direction for the blending, if start and end are the same nothing happens
if(opacStart > opacEnd) {
for(i = opacStart; i >= opacEnd; i--) {
setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
timer++;
}
} else if(opacStart < opacEnd) {
for(i = opacStart; i <= opacEnd; i++)
{
setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
timer++;
}
}
}
//change the opacity for different browsers
function changeOpac_test(opacity, id) {
var imgobj = id;
if (BrowserDetect.browser=="Explorer")
imgobj.filters.alpha.opacity=degree
else if (BrowserDetect.browser=="Firefox")
imgobj.style.MozOpacity=degree/100
else if (BrowserDetect.browser=="Opera")
imgobj.style.opacity=degree/100
else if (BrowserDetect.browser=="Chrome")
imgobj.style.KhtmlOpacity=degree/100
else
imgobj.style.KhtmlOpacity=degree/100
}
//change the opacity for different browsers
function changeOpac(opacity, id) {
var object = document.getElementById(id).style;
object.opacity = (opacity / 100);
object.MozOpacity = (opacity / 100);
object.KhtmlOpacity = (opacity / 100);
// object.filters = "alpha(opacity=" + opacity + ")";
var element = document.getElementById(id);
element.filters.alpha.opacity=opacity
// object.filters.alpha.opacity=90;
// object=filter:alpha(opacity=90);
}
function changeType() {
//var theType = document.getElementById('vLoginPassword').type;
// var theType = which.type;
// if (theType == "text") {
//document.getElementById('vLoginPassword').value="";
//document.getElementById('vLoginPassword').type = "password";
// which.value='';
// which.type='password';
// }
var theForm = document.getElementById('loginform');
var thePass = document.getElementById('vLoginPassword');
var theSubmit = document.getElementById('doquicklogin2');
theForm.removeChild(thePass);
theForm.removeChild(theSubmit);
createPassInput();
}
function createPassInput(){
var parentForm = document.getElementById("loginform");
var passElement = document.createElement("input");
var submitElement = document.createElement("input");
passElement.type = "password";
passElement.name = "vLoginPassword";
passElement.id = "vLoginPassword";
//passElement.class="inputtext";
passElement.setAttribute("class", "inputtext");
passElement.setAttribute("size", "20");
parentForm.appendChild(passElement);
submitElement.type="submit";
submitElement.value="Login";
submitElement.name="doquicklogin2";
submitElement.setAttribute("class", "inputsubmit");
submitElement.setAttribute("border", "1");
parentForm.appendChild(submitElement);
}
function clearField(){
var theValue = document.getElementById('vLoginEmail').value;
if (theValue == "Email") {
document.getElementById('vLoginEmail').value="";
}
}
function clearPasswordField(){
var theValue = document.getElementById('vLoginPassword').value;
if (theValue == "Password") {
document.getElementById('vLoginPassword').value="";
document.getElementById('vLoginPassword').type = "password";
}
}
function UpdateType(e){
if(isIE){//for crappy IE work around.
var nextNode = obj.nextSibling;
obj.removeNode(true);
var obj = document.createElement("INPUT");
obj.setAttribute("type","password");
obj.setAttribute("id","vLoginPassword");
frm.insertBefore(obj,nextNode);
}else{//for mozilla(NS) based browsers and all other standard compliant browsers.
obj.setAttribute("type","password");
obj.setAttribute("id","vLoginPassword");
frm.innerHTML = frm.innerHTML;
}
}
var BrowserDetect = {
init: function () {
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
this.version = this.searchVersion(navigator.userAgent)
|| this.searchVersion(navigator.appVersion)
|| "an unknown version";
this.OS = this.searchString(this.dataOS) || "an unknown OS";
},
searchString: function (data) {
for (var i=0;i