// JavaScript Document
function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('The following error(s) occurred:\n'+errors);
    document.MM_returnValue = (errors == '');
} }


function check(myId,b,c){
	
	if(c == 1){
		document.location = 'http://www.luxgiv.com/app_start.html';
	}
	
	var myformvalue = document.getElementById('checkformget').value;
	document.getElementById('checkformget').value = Number(myformvalue)+1;
	
	if(myformvalue == 2){
		if(navigator.appName == "Netscape"){
			//document.location = 'http://www.luxgiv.com/sign_up.html';
		}	
	}
	
	if(document.getElementById('checkformget').value == 1){
		if(b == 1){ // b = menu clicked
			if(document.getElementById(myId).style.display == 'inline-block'){
				document.getElementById(myId).style.display = 'none';
			} else {
				document.getElementById(myId).style.display = 'inline-block';
			}
		} else {
			document.getElementById(myId).style.display = 'none';
		}
	}
	
	if(document.getElementById('checkformget').value == 3){
		document.getElementById(myId).style.display = 'none';
		document.getElementById('checkformget').value = 0;
	}
}


function launchItemDetails(a,b,c,d,e,f,g){
	if(g == 1){
		document.location = 'app_gift_create.html?image='+a+'&price='+b+'&pid='+c+'&title='+d+'&url='+e+'&desc='+f;
	} else {
		document.location = 'sign_up.html?image='+a+'&price='+b+'&pid='+c+'&title='+d+'&url='+e+'&desc='+f;
	}		
}

function launchItemDetailsNew(a,b,c){
	if(c == 1){
		document.location = 'app_gift_create.html?price='+a+'&pid='+b;
	} else {
		document.location = 'sign_up.html?price='+a+'&pid='+b;
	}		
}

function show_login(){
	var my_display = document.getElementById('login_screen').style.display;
	if(navigator.appName == "Netscape"){
		var my_display_action = 'table-row';
	} else {
		var my_display_action = 'inline';		
	}

	if(my_display == 'none'){
		document.getElementById('login_screen').style.display = my_display_action;
	} else {		
		document.getElementById('login_screen').style.display = 'none';
	}
}
