function checkDirect(what,where){
	if(isNaN(what)){
	alert("You Must Enter An Integer Here");
	where.focus();
	}
  else{
    window.open('popups/nvcorp/director_information.cfm?num='+(what), 'directors', 'width=600, height=500, scrollbars=1, resizable=1, status=1');
  }
}


function fixstock()
{
  var sp = document.MyForm.sharedollars.value;
  var sq = document.MyForm.amtshares.value;
  var st = document.MyForm.totaldollars.value;
  
  var nc = 0;
  
  if (sp.length == 0 || parseInt(sp) == 0)
  {
    nc++;
    sp = 0;
  }
  else
    sp = parseFloat(sp);
  if (sq.length == 0 || parseInt(sq) == 0)
  {
    nc++;
    sq = 0;
  }
  else
    sq = parseInt(sq);
  if (st.length == 0 || parseInt(st) == 0)
  {
    nc++;
    st = 0;
  }
  else
    st = parseFloat(st);
  if (nc > 1)
    return;
  
  if (isNaN(sp))
  {
    alert("The share price must be a dollar amount greater than 0");
    document.MyForm.sharedollars.focus();
    return;
  }
  if (isNaN(sq))
  {
    alert("The amount of shares must be an integer greater than 0");
    document.MyForm.amtshares.focus();
    return;
  }
  if (isNaN(st))
  {
    alert("The total dollar value of stock must be a value greater than 0");
    document.MyForm.totaldollars.focus();
    return;
  }
  
  if (sp == 0)
  {
    sp = st / sq;
    document.MyForm.sharedollars.realValue = document.MyForm.sharedollars.value = sp;
    document.MyForm.sharedollars.refresh();
  }
  else if (sq == 0)
  {
    sq = st / sp;
    document.MyForm.amtshares.value = sq;
  }
  else
  {
    st = sp * sq;
    document.MyForm.totaldollars.realValue = document.MyForm.totaldollars.value = st;
    document.MyForm.totaldollars.refresh();
  }
  
  if (sp == 0)
  {
    alert("The share price must be a dollar amount greater than 0");
    document.MyForm.sharedollars.focus();
    return;
  }
  if (sq == 0)
  {
    alert("The amount of shares must be an integer greater than 0");
    document.MyForm.amtshares.focus();
    return;
  }
  if (st == 0)
  {
    alert("The total dollar value of stock must be a value greater than 0");
    document.MyForm.totaldollars.focus();
    return;
  }
}

function showagent(what)
{
  document.all("regagentinfo").style.display = (what.checked ? "none" : "block");
}

javascript:window.history.forward(1);

function checkNum(what,where){
	if(isNaN(what)){
	alert("You Must Enter An Integer Here");
	where.focus();
	}
}


function showScorp(what){
	if(what == "Yes"){
		scorps.style.display="block";
		submitty.style.display="none";
    totprice.innerText = "129.95";
	}else{
		scorps.style.display="none";
		submitty.style.display="block";
    totprice.innerText = "119.95";
	}
}
function openShare(what,where,howmany){
	if(where == "1"){
	if((what !== "0") && (what !== "")){
		window.open('http://www.granitedocuments.com/popups/nvcorp/share_holder_information.cfm?num='+(what),'shareholders','width=600,height=500,scrollbars=1,resizable=1,status=1');
	}
	}else if(where == "2"){
	window.open('http://www.granitedocuments.com/popups/nvcorp/share_holder_fixit.cfm?num='+(what)+'&whichshare='+(howmany),'shareholders','width=600,height=500,scrollbars=1,resizable=1,status=1');
	}
}


function checkName(where){
	window.open('http://www.granitedocuments.com/popups/nvcorp/companysearch/name-check-frameset.cfm?name='+(where),'namecheck','width=720,height=600,scrollbars=1,resizable=1');
}

function addNewfield(num){
	if (document.MyForm.nonag.value !== "0" || document.MyForm.agri.value !== "0" || document.MyForm.household.value != "0"){
	sec5.style.display = "block";
	}else{
	sec5.style.display = "none";
	}
	}

function busType(business){
	if ((business) == "construction"){
	financeinsurance.style.display = "none";
	bustypenow.style.display = "block";
	construction.style.display = "block";
	manufacturing.style.display = "none";
	realestate.style.display = "none";
	rentalleasing.style.display = "none";
	transportwarehousing.style.display = "none";
	healthcare.style.display = "none";
	foodservice.style.display = "none";
	wholesaleagent.style.display = "none";
	wholesaleother.style.display = "none";
	retail.style.display = "none";
	other.style.display = "none";
	othermore.style.display = "none";
	}else if ((business) == "financeinsurance"){
	
	bustypenow.style.display = "block";
financeinsurance.style.display = "block";		
	construction.style.display = "none";
	manufacturing.style.display = "none";
	realestate.style.display = "none";
	rentalleasing.style.display = "none";
	transportwarehousing.style.display = "none";
	healthcare.style.display = "none";
	foodservice.style.display = "none";
	wholesaleagent.style.display = "none";
	wholesaleother.style.display = "none";
	retail.style.display = "none";
	other.style.display = "none";
	othermore.style.display = "none";
	
	}else if ((business) == "manufacturing"){
	bustypenow.style.display = "block";
	construction.style.display = "none";
	financeinsurance.style.display = "none";	
	manufacturing.style.display = "block";
	realestate.style.display = "none";
	rentalleasing.style.display = "none";
	transportwarehousing.style.display = "none";
	healthcare.style.display = "none";
	foodservice.style.display = "none";
	wholesaleagent.style.display = "none";
	wholesaleother.style.display = "none";
	retail.style.display = "none";
	other.style.display = "none";
	othermore.style.display = "none";
	} else if ((business) == "realestate"){
	bustypenow.style.display = "block";
	financeinsurance.style.display = "none";		
	construction.style.display = "none";
	manufacturing.style.display = "none";
	realestate.style.display = "block";
	rentalleasing.style.display = "none";
	transportwarehousing.style.display = "none";
	healthcare.style.display = "none";
	foodservice.style.display = "none";
	wholesaleagent.style.display = "none";
	wholesaleother.style.display = "none";
	retail.style.display = "none";
	other.style.display = "none";
	othermore.style.display = "none";
	} else if ((business) == "rentalleasing"){
	bustypenow.style.display = "block";
	financeinsurance.style.display = "none";		
	construction.style.display = "none";
	manufacturing.style.display = "none";
	realestate.style.display = "none";
	rentalleasing.style.display = "block";
	transportwarehousing.style.display = "none";
	healthcare.style.display = "none";
	foodservice.style.display = "none";
	wholesaleagent.style.display = "none";
	wholesaleother.style.display = "none";
	retail.style.display = "none";
	other.style.display = "none";
	othermore.style.display = "none";
	} else if ((business) == "transportwarehousing"){
	bustypenow.style.display = "block";
	financeinsurance.style.display = "none";		
	construction.style.display = "none";
	manufacturing.style.display = "none";
	realestate.style.display = "none";
	rentalleasing.style.display = "none";
	transportwarehousing.style.display = "block";
	healthcare.style.display = "none";
	foodservice.style.display = "none";
	wholesaleagent.style.display = "none";
	wholesaleother.style.display = "none";
	retail.style.display = "none";
	other.style.display = "none";
	othermore.style.display = "none";
	} else if ((business) == "healthcare"){
	bustypenow.style.display = "block";
	financeinsurance.style.display = "none";		
	construction.style.display = "none";
	manufacturing.style.display = "none";
	realestate.style.display = "none";
	rentalleasing.style.display = "none";
	transportwarehousing.style.display = "none";
	healthcare.style.display = "block";
	foodservice.style.display = "none";
	wholesaleagent.style.display = "none";
	wholesaleother.style.display = "none";
	retail.style.display = "none";
	other.style.display = "none";
	othermore.style.display = "none";
	} else if ((business) == "foodservice"){
	bustypenow.style.display = "block";
	financeinsurance.style.display = "none";		
	construction.style.display = "none";
	manufacturing.style.display = "none";
	realestate.style.display = "none";
	rentalleasing.style.display = "none";
	transportwarehousing.style.display = "none";
	healthcare.style.display = "none";
	foodservice.style.display = "block";
	wholesaleagent.style.display = "none";
	wholesaleother.style.display = "none";
	retail.style.display = "none";
	other.style.display = "none";
	othermore.style.display = "none";
	} else if ((business) == "wholesaleagent"){
	bustypenow.style.display = "block";
	financeinsurance.style.display = "none";		
	construction.style.display = "none";
	manufacturing.style.display = "none";
	realestate.style.display = "none";
	rentalleasing.style.display = "none";
	transportwarehousing.style.display = "none";
	healthcare.style.display = "none";
	foodservice.style.display = "none";
	wholesaleagent.style.display = "block";
	wholesaleother.style.display = "none";
	retail.style.display = "none";
	other.style.display = "none";
	othermore.style.display = "none";
	} else if ((business) == "wholesaleother"){
	bustypenow.style.display = "block";
	financeinsurance.style.display = "none";		
	construction.style.display = "none";
	manufacturing.style.display = "none";
	realestate.style.display = "none";
	rentalleasing.style.display = "none";
	transportwarehousing.style.display = "none";
	healthcare.style.display = "none";
	foodservice.style.display = "none";
	wholesaleagent.style.display = "none";
	wholesaleother.style.display = "block";
	retail.style.display = "none";
	other.style.display = "none";
	othermore.style.display = "none";
	} else if ((business) == "retail"){
	bustypenow.style.display = "block";
	financeinsurance.style.display = "none";		
	construction.style.display = "none";
	manufacturing.style.display = "none";
	realestate.style.display = "none";
	rentalleasing.style.display = "none";
	transportwarehousing.style.display = "none";
	healthcare.style.display = "none";
	foodservice.style.display = "none";
	wholesaleagent.style.display = "none";
	wholesaleother.style.display = "none";
	retail.style.display = "block";
	other.style.display = "none";
	othermore.style.display = "none";
	} else if ((business) == "other"){
	bustypenow.style.display = "block";
	financeinsurance.style.display = "none";		
	construction.style.display = "none";
	manufacturing.style.display = "none";
	realestate.style.display = "none";
	rentalleasing.style.display = "none";
	transportwarehousing.style.display = "none";
	healthcare.style.display = "none";
	foodservice.style.display = "none";
	wholesaleagent.style.display = "none";
	wholesaleother.style.display = "none";
	retail.style.display = "none";
	other.style.display = "block";
	othermore.style.display = "block";
	}
}
function resetBustype(){

document.MyForm.businesstype.value = "";
for (i=0;i<11;i++){
z = (i+1);
x = (z+1);
var bustype = "businesstype" + (x);
document.MyForm(bustype).value = "";

}
}


function showMore(where){
	document.all(where).style.display="block";
	}
		
function showM(what,where){
	if(what == "Yes"){
		document.all(where).style.display="block";
	}else{
		document.all(where).style.display="none";
		mid.style.display="block";
	}
}
//  ----------------------------------    Stuff for the day picker    ----------------------------------

function showDay(what){
	var s = document.all.shareday;

	if((what == "January") || (what == "March") || (what == "May") || (what == "July") || (what == "August") || (what == "October") || (what == "December")){

		
		
		if(s.length > 30){
			
		s.options.remove(30);
		s.options.remove(29);
		 }else if(s.length > 29){
		 s.options.remove(29);
		 }
		
  		 newOption = document.createElement("OPTION");
          newOption.text =  "30th";
		  newOption.value = "30th";
          s.add(newOption,s.length);
		  
		  newOption2 = document.createElement("OPTION");
		  newOption2.text =  "31st";
		  newOption2.value = "31st";
          s.add(newOption2,s.length);
        

	}else if ((what == "April") || (what == "June") || (what == "September") || (what == "November")){
		if(s.length > 30){
			
		 s.options.remove(30);
		 s.options.remove(29);
		
	     }else if(s.length > 29){
		 s.options.remove(29);
		 }
	
	
	  	  newOption = document.createElement("OPTION");
          newOption.text =  "30th";
		  newOption.value = "30th";
          s.add(newOption,s.length);
	
	}else if (what == "February"){
		if(s.length > 30){
		 s.options.remove(30);
		 s.options.remove(29);
		
	     }else if(s.length > 29){
		 s.options.remove(29);
		 }
	}
}
		
// - ---------------------------------- End Stuff For Day Picker -----------------------------------

function showOut(what,where,nowwhere){
	if(what == "Yes"){
		document.all(where).style.display = "block";
	}else{
		document.all(where).style.display = "none";
		document.all(nowwhere).style.display="block";
	}
}
function showPar(what){
  document.all("noparyes").style.display = (what == "nopar" ? "block" : "none");
  document.all("capitalyes1").style.display = document.all("capitalyes2").style.display = document.all("capitalyes3").style.display = (what == "capital" ? "block" : "none");
}
function warn(what){
	if(what == "Yes"){
	alert('This is an unusual situaion.  You will be required to have a qualified accountant help you complete section two of your IRS form 2553 as this can vary considerably depending on your specific situation.  This does not mean that we can not continue helping you form your corporation, simply that you will require further assistance in completing the form 2553.');
	}
}

var missingFields;
function checkIt()
{
  var what = document.MyForm;
  missingFields = new Array();
  	try{
  	var els = what.elements;
  	for (i = 0; i < els.length; i++){
  	
    	el = els[i];
    	n = el.name.toLowerCase();
   	 	switch (el.tagName.toUpperCase()){
    	
     	 case "INPUT":
     	 case "SELECT":
       	 v = el.value;
      	break;
      	case "TEXTAREA":
       	 v = el.innerText;
      	break;
   		 }
   		if (v == ""){
    
			if(n == "corpname" || n == "extension" || n == "corppurpose"  || !what.useregagent.checked && (n == "registeredagent" || n == "agentadr" || n == "agentcity" || n == "agentstate" || n == "agentzip") || n == "incorporator1" || n == "incorpadr1" || n == "incorpcity1" || n == "incorpstate1" || n == "incorpzip1" || n == "incorporatoryorn2" || n == "effectivedate" || n == "corppriadr" || n == "corppricity" || n == "corppricounty" || n == "corppristate" || n == "sharemonth" || n == "shareday" || n == "shareyear" || n == "sharetime" || n == "holderspercent" || n == "noticedays" || n == "directamt" || n == "stockholdersyorn" || n == "holdpositionyorn1" || n == "fiscalstart" || n == "fiscalend" || n == "adoptdate" || n == "newbustype" || n == "nonag" || n == "agri" || n == "household" || n == "title" || n == "principalofficer" || n == "principaloffssn" || n == "scorpinfo" || n == "corpprizip" || n == "infofax" || sCorpMissing(n,what) || moreStuff(n,what)){


				

        		missingFields[missingFields.length] = n;
     		 }
    	}
  }
  		if (missingFields.length > 0){
		window.open('http://www.granitedocuments.com/popups/nvcorp/missing_information.cfm','missinginfo','width=600,height=500,scrollbars=1,resizable=1,status=1');
  
    	return false;
  		}else{
  		return true;
  		}
	}  // close try
 	 catch(e)
  	{
    alert(e.message);
    return false;
  	}
}

function sCorpMissing(n,what){

  if (what.scorpinfo.value == "Yes" && ( n == "corpmailadr" || n == "corpmailcity" || n == "corpmailstate" || n == "corpzip" || n == "otheradryorn" || n == "incorpdate" || n == "scorpstart" || n == "infoofficer" || n == "infotitle" || n == "infophone" || n == "occurfirst" || n == "taxyearyorn"))
    return true;
  else
    return false;
  
}

function moreStuff(n,what){
	// incorporator stuff
	if(what.incorporatoryorn2.value == "Yes" && (n == "incorporator2" || n == "incorpadr2" || n == "incorpcity2" || n == "incorpstate2" || n == "incorpzip2" || n == "incorporatoryorn3")

	||(what.incorporatoryorn2.value == "Yes" && what.incorporatoryorn3.value == "Yes") && (n == "incorporator3" || n == "incorpadr3" || n == "incorpcity3" || n == "incorpstate3" || n == "incorpzip3" || n == "incorporatoryorn4")

	||(what.incorporatoryorn3.value == "Yes" && what.incorporatoryorn2.value == "Yes" && what.incorporatoryorn4.value == "Yes") && (n == "incorporator4" || n == "incorpadr4" || n == "incorpcity4" || n == "incorpstate4" || n == "incorpzip4" )
	//end incorporator stuff
	//stuff for biz type
	||(what.holdpositionyorn1.value == "Yes") && (n == "holdposition1" || n == "holdposition2")
	||(what.newbustype.value == "construction") && (n == "businesstype")
	||(what.newbustype.value == "manufacturing") && (n == "businesstype2")
	||(what.newbustype.value == "realestate") && (n == "businesstype3")
	||(what.newbustype.value == "rentalleasing") && (n == "businesstype4")
	||(what.newbustype.value == "transportwarehousing") && (n == "businesstype5")
	||(what.newbustype.value == "financeinsurance") && (n == "businesstype6")
	||(what.newbustype.value == "healthcare") && (n == "businesstype7")
	||(what.newbustype.value == "foodservice") && (n == "businesstype8")
	||(what.newbustype.value == "wholesaleagent") && (n == "businesstype9")
	||(what.newbustype.value == "wholesaleother") && (n == "businesstype10")
	||(what.newbustype.value == "retail") && (n == "businesstype11")
	||(what.newbustype.value == "other") && (n == "businesstype12" || n == "otherbustype")
	||(what.noparorcapital.value == "nopar") && (n == "amtshare")
    ||(what.noparorcapital.value == "capital") && (n == "sharedollars" || n == "amtshares")
	
	//end stuff for biz type
	//datewages stuff
	||(what.agri.value !== "0" || what.nonag.value !== "0" || what.household.value !== "0") && (n == "firstdatewages")
	// end date wages stuff
	//extra scorp name stuff
	||(what.scorpinfo.value == "Yes" && what.otheradryorn.value == "Yes") && (n == "othername")
	||(what.scorpinfo.value == "Yes" && what.occurfirst.value == "Yes") && (n == "occurdate")
	||(what.scorpinfo.value == "Yes" && what.taxyearyorn.value == "Yes") && (n == "taxyear")
	||(what.scorpinfo.value == "Yes") && (n == "numberofshreholders")
	//end alternate name stuff
	
		)
	
    return true;
  else
    return false;
  
  
  
  
}
	
	
	function openDirectFixit(what,howmany){
	window.open('popups/nvcorp/director_fixit.cfm?whichdirect=' + (what) + '&num=' + howmany, 'directors', 'width=600, height=500, scrollbars=1, resizable=1, status=1');
}