function loadAll(){
libinit();
DynarchMenu.setup('menu', {tooltips: true, electric: 500, shadows: null} );
}

function libinit(){
	page=new lib_doc_size()
	obj_pgsizer=new lib_obj('pgsizer')
	obj_successsizer=new lib_obj('successsizer')	
	obj_successsizerh=new lib_obj('successsizerh')
	obj_successtext=new lib_obj('successtext')
	obj_loginform=new lib_obj('loginform')
	obj_flashmov=new lib_obj('flashmov')	
	obj_atext=new lib_obj('atext')

			nssubtractamt = '0'
			if(bw.ns7){nssubtractamt = '15'}
//ryan ns6 flash mov is too wide! it doesn't respond to making the moviewidth clip smaller... seems to take a size automatically, weird!
//you will need to try to custom write the width of the flash object in the default page
			if(bw.ns6){nssubtractamt = '25'}
			//alert(nssubtractamt);

	obj_pgsizer.clipTo(0,22,page.y2-127,0,1);
	

	
	if (page.x2 <= "769") {
	obj_loginform.moveIt(580,obj_loginform.y)	
	}else{
	obj_loginform.moveIt(page.x2-188-nssubtractamt,obj_loginform.y)	
	}

	obj_loginform.showIt();

	
	var pattern = /\d*/;
	var movieWidth = pattern.exec ((page.x2)*0.73);
	//if (movieWidth <= "560") movieWidth='560';
	var movieHeight = pattern.exec (movieWidth*0.5137);
 

	obj_flashmov.clipTo(0,movieWidth-nssubtractamt,movieHeight-nssubtractamt,0,1);
	obj_flashmov.showIt();	

	//code to fix when alt images come in large vs flash movie for sizing of success stories box
  //if(bw.mac){alert('mac is true');}    
  //if(bw.ns4){alert('nn4 is true');}
  //if(bw.ns7){alert('nn7 is true');}
  //if(bw.ns6){alert('nn6 is true');}


			//alert(altimagew );
			//alert(altimageh );
			if (altimagew != '0'){
				obj_successsizer.clipTo(0,page.x2-altimagew-52,1,0,1);
				obj_successtext.clipTo(0,page.x2-altimagew-50,altimageh-70,0,1);
				obj_successsizerh.clipTo(0,13,altimageh-60,0,1);
				//alert(page.x2-movieWidth-50);
				//if ((page.x2-altimagew-50) <= "150"){
				//	obj_successtext.clipTo(0,150,altimageh-70,0,1);
				//}
			}else{
				obj_successsizer.clipTo(0,page.x2-movieWidth-51,1,0,1);
				obj_successsizerh.clipTo(0,13,movieHeight-50,0,1);	
				obj_successtext.clipTo(0,page.x2-movieWidth-50,movieHeight-70,0,1);
				//alert(page.x2-movieWidth-50);
				//if ((page.x2-movieWidth-50) <= "150"){
				//	obj_successtext.clipTo(0,150,movieHeight-70,0,1);
				//}		
			}
			obj_successtext.showIt();

	//move+size the a seciton text over flash
			var atextPosition = pattern.exec ((movieWidth)/2.8);
			//alert (atextPosition);
			obj_atext.moveIt(atextPosition,obj_atext.y);
			if (altimagew != '0'){
				obj_atext.clipTo(0,altimagew-atextPosition,obj_atext.h,0,1);
				//alert('using alert image w');
				//alert(altimagew-200);
				//alert(obj_atext.x);
			}else{
				obj_atext.clipTo(0,movieWidth-atextPosition,obj_atext.h,0,1);
				//alert('using movwidth');
			}
	//obj_atext.showIt();

	
	//Takes care of the resizing.
	window.onresize=resized;
	
	document.LoginForm.UserID.focus();
}

function resized() {
libinit();
}


// new function to handle enter key for login form
function trapEnter(e, form) {
     if (e.keyCode && e.keyCode != 13) return true;
     else if (e.which && e.which != 13) return true;
     var field, msg = '';
     if (!form.UserID.value) {
         field = form.UserID;
         msg = 'Please enter your username.'
   } else if (!form.PWD.value) {
         field = form.PWD;
         msg = 'Please enter your password.'
      }
     if (msg) {
         alert(msg);
         if (field) field.focus();
         return false;
   }
     form.submit();
}


function minformChange(){
	if (document.MailList.txtCtFirstName.value == ' First Name') {
	document.MailList.txtCtFirstName.value = '';
	}else{
	//do nothing
	}
}

function minformChange2(){
	if (document.MailList.txtCtEmail.value == ' Email Address') {
	document.MailList.txtCtEmail.value = ''
	}else{
	//do nothing
	}
}


if (screen.availWidth <= 1024){
	//alert('lessthan1024');
	//chooses the smaller font css page.
document.write('<link rel=stylesheet type=text/css href=scripts/style.css>');
	}else{
	//alert('morethan1024');
	//chooses the larger font css page.
document.write('<link rel=stylesheet type=text/css href=scripts/style_1280.css>');
	}

