
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


function logInCheck(){
alert ("This feature is only available to members who have purchased access to the EMT Database. Click the 'Purchase' link for more information on how to gain access.")
}

/*
#-------------------------------------------------------------------#
#																	#
#				Copy info for claim a company						#			
#																	#
#-------------------------------------------------------------------#
*/
/*		Claim Company AutoFill - Copy user info *Same As		*/
var exec_salutation = "";
var exec_first_name = "";
var exec_last_name = ""; 
var exec_pro_designation = ""; 
var exec_title = ""; 
var exec_phone = "";
var exec_email = ""; 

function InitSaveVariables(form) {
my_salutation = form.exec_salutation.value;
my_first_name = form.exec_first_name.value; 
my_last_name = form.exec_last_name.value; 
my_pro_designation  = form.exec_pro_designation.value;
my_title = form.exec_title.value;
my_phone = form.exec_phone.value;
my_email = form.exec_email.value;
}


function CopyUserInfo(form) {
if (form.copy.checked) {
InitSaveVariables(form);
form.exec_salutation.value = form.my_salutation.value; 
form.exec_first_name.value = form.my_first_name.value;  
form.exec_last_name.value = form.my_last_name.value; 
form.exec_pro_designation.value = form.my_pro_designation.value;  
form.exec_title.value = form.my_title.value; 
form.exec_phone.value = form.my_phone.value; 
form.exec_email.value = form.my_email.value; 
}
else {
form.exec_salutation.value = exec_salutation; 
form.exec_first_name.value = exec_first_name;  
form.exec_last_name.value = exec_last_name; 
form.exec_pro_designation.value = exec_pro_designation;  
form.exec_title.value = exec_title; 
form.exec_phone.value = exec_phone; 
form.exec_email.value = exec_email; 
   }
}
/*	END	Claim Company AutoFill - Copy user info *Same As		*/


/*	Check All for market checkboxes -- used in profile.php and register.php for market preferencess		*/
function check_all($var) {
  // gets Instance to the Form
  this.form = document.getElementById('profile_update');
  // verifies if the instance was successfully obtained
  if (this.form) {
     // gets the current check state
     this.newCheckedValue = document.getElementById('check_all_box').checked;
     // gets instace array for all input elements of the form
     this.checkboxNodes = this.form.getElementsByTagName('input');
         // loops the array
     for (this.i = 0; this.i < this.checkboxNodes.length; this.i++) {
         // verifies if the input element is a checkbox
         if (this.checkboxNodes[i].getAttribute('name') == $var) {
                // sets the new check value
            this.checkboxNodes[i].checked = this.newCheckedValue;
                 }
     }
  }
}
             
// This is the implementation of SimpleSwap
// by Jehiah Czebotar
// Version 1.1 - June 10, 2005
// Distributed under Creative Commons
//
// Include this script on your page
// then make image rollovers simple like:
// <img src="/images/ss_img.gif" oversrc="/images/ss_img_over.gif">
//
// http://jehiah.com/archive/simple-swap
// 


function SimpleSwap(el,which){
  el.src=el.getAttribute(which || "origsrc");
}

function SimpleSwapSetup(){
  var x = document.getElementsByTagName("img");
  for (var i=0;i<x.length;i++){
    var oversrc = x[i].getAttribute("oversrc");
    if (!oversrc) continue;
      
    // preload image
    // comment the next two lines to disable image pre-loading
    x[i].oversrc_img = new Image();
    x[i].oversrc_img.src=oversrc;
    // set event handlers
    x[i].onmouseover = new Function("SimpleSwap(this,'oversrc');");
    x[i].onmouseout = new Function("SimpleSwap(this);");
    // save original src
    x[i].setAttribute("origsrc",x[i].src);
  }
}

var PreSimpleSwapOnload =(window.onload)? window.onload : function(){};
window.onload = function(){PreSimpleSwapOnload(); SimpleSwapSetup();}


/*
#-------------------------------------------------------------------#
#																	#
#					Validate Keyword Search							#			
#																	#
#-------------------------------------------------------------------#
*/
function checkSearch($frm) {

var val = $frm;	
missinginfo = "";

if (document[val].search_word.value == "" || document[val].search_word.value == "Search all products.." || document[val].search_word.value == "Emerging Medical Technologies" || document[val].search_word.value == "Market Reports" || document[val].search_word.value == "Search EMT Database" || document[val].search_word.value == "Search by company name..") {
missinginfo += "\n     -  'Search' was left blank! \n";
}


if (missinginfo != "") {
missinginfo ="You did not fill in all required fields: \n___________________________________________________\n" +
missinginfo + "\n___________________________________________________" +
"\n \n Please re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}


/*
#-------------------------------------------------------------------#
#																	#
#					Validate User Login 							#			
#																	#
#-------------------------------------------------------------------#
*/
function checkLogin() {
missinginfo = "";

if (document.loginform.username.value == "") {
missinginfo += "\n     -  'Username' was left blank! \n";
}
if (document.loginform.password.value == "") {
missinginfo += "\n     -  'Password' was left blank! \n";
}


if (missinginfo != "") {
missinginfo ="You did not fill in all required fields: \n___________________________________________________\n" +
missinginfo + "\n___________________________________________________" +
"\n \n Please re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}


/*
#-------------------------------------------------------------------#
#																	#
#				Validate Registration Form							#			
#																	#
#-------------------------------------------------------------------#
*/

function checkRegistrationForm(frm) {
	missinginfo = "";
	
	if (document.profile_update.username.value == "") {
		missinginfo += "\n     -  Username";
	}
	
	if (document.profile_update.my_email.value == "") {
		missinginfo += "\n     -  Email";
	}
	
	if (document.profile_update.my_first_name.value == "") {
		missinginfo += "\n     -  First Name";
	}
	
	if (document.profile_update.my_last_name.value == "") {
		missinginfo += "\n     -  Last Name";
	}	
	
	
	if (document.profile_update.company.value == "") {
		missinginfo += "\n     -  Company";
	}
	
	
	if (document.profile_update.mathguard_answer.value == "") {
		missinginfo += "\n     -  Anti-Spam Question";
	}
	// get markets checkbox array
	var checked = false;
	for (i=0; i<frm.length; i++)  {
	    if (frm.elements[i].id.indexOf('chkStatus') !=-1)    {
	        if (frm.elements[i].checked) {
	            checked = true;
	        }
	    }
	}
	if (!checked) {
	    missinginfo += "\n     -  Select a market checkbox";
	}


	// get referrer checkbox array
	var checked2 = false;
	for (i=0; i<frm.length; i++)  {
	    if (frm.elements[i].id.indexOf('chkStatus2') !=-1)    {
	        if (frm.elements[i].checked) {
	            checked2 = true;
	            
	            
	        }
	    }
	}
	if (!checked2) {
	    missinginfo += "\n     -  What brought you to our site today?";
	}
	
	
	
	if (missinginfo != "") {
		missinginfo ="_____________________________\n" +
		"You failed to correctly fill in your:\n" +
		missinginfo + "\n_____________________________" +
		"\nPlease re-enter and submit again!";
		alert(missinginfo);
		return false;
	}
else return true;
}



/*
#-------------------------------------------------------------------#
#																	#
#					VALIDATE EMT e-COMMERCE							#			
#																	#
#-------------------------------------------------------------------#
*/

function checkEMTcheckout(frm) {
	missinginfo = "";
	
	if (document.buyemt.emtsegment.value == "") {
		missinginfo += "\n     -  Please make a selection";
	}
	
	if (document.buyemt.emtsegment.value == "market") {
        var checked = false;
        var cb=document.getElementById('hideme').getElementsByTagName('input');
        for (i=0; i<cb.length; i++)  {
            if (cb[i].checked) {
                checked = true;
                break;
            }
        }
        if (!checked) {
            missinginfo += "\n     -  Select a market checkbox";
        }
    }
	



	if (missinginfo != "") {
		missinginfo ="_____________________________\n" +
		"You failed to correctly fill in your:\n" +
		missinginfo + "\n_____________________________" +
		"\nPlease re-enter and submit again!";
		alert(missinginfo);
		return false;
	}
else return true;
}




/*
#-------------------------------------------------------------------#
#																	#
#			Copy billing info to shipping for shopping cart			#
#																	#
#-------------------------------------------------------------------#
*/
var SfirstName = ""; 
var SlastName = "";
var Scompany = "";
var Saddress1 = "";
var Saddress2 = "";
var Scity = "";
var Sstatee = "";
var Szip = ""; 
var Scountry = ""; 

function InitSaveShippingVariables(form) {
firstName = form.SfirstName.value;
lastName = form.SlastName.value;
company = form.Scompany.value;
address1 = form.Saddress1.value;
address2 = form.Saddress2.value;
city = form.Scity.value;
state = form.Sstate.value;
zip = form.Szip.value;
country = form.Scountry.value;
}

function CopyUserBillingInfo(form) {
if (form.copy.checked) {
InitSaveShippingVariables(form);
form.SfirstName.value = form.firstName.value; 
form.SlastName.value = form.lastName.value;  
form.Scompany.value = form.company.value; 
form.Saddress1.value = form.address1.value;  
form.Saddress2.value = form.address2.value; 
form.Scity.value = form.city.value; 
form.Sstate.value = form.state.value; 
form.Szip.value = form.zip.value; 
form.Scountry.value = form.country.value; 
}
else {
form.SfirstName.value = firstName; 
form.SlastName.value = lastName;  
form.Scompany.value = company; 
form.Saddress1.value = address1;  
form.Saddress2.value = address2; 
form.Scity.value = city; 
form.Sstate.value = state; 
form.Szip.value = zip; 
form.Scountry.value = country; 
   }
}










/*
#-------------------------------------------------------------------#
#																	#
#					Checkout Page Validation						#			
#																	#
#-------------------------------------------------------------------#
*/

function checkCheckout(frm) {
missinginfo = "";

if (document.formpayment.firstName.value == "") {
missinginfo += "\n     -  'First Name' was left blank! \n";
}
if (document.formpayment.lastName.value == "") {
missinginfo += "\n     -  'Last Name' was left blank! \n";
}
if (document.formpayment.address1.value == "") {
missinginfo += "\n     -  'Address' was left blank! \n";
}
if (document.formpayment.city.value == "") {
missinginfo += "\n     -  'City' was left blank! \n";
}
if (document.formpayment.state.value == "") {
missinginfo += "\n     -  'State' was left blank! \n";
}
if (document.formpayment.zip.value == "") {
missinginfo += "\n     -  'Zip' was left blank! \n";
}
if (document.formpayment.country.value == "") {
missinginfo += "\n     -  'Country' was left blank! \n";
}
if (document.formpayment.CCNo.value == "") {
missinginfo += "\n     -  'Credit Card Number' was left blank! \n";
}
if (document.formpayment.CCExpiresMonth.value == "") {
missinginfo += "\n     -  'Credit Card Expiration Month' was left blank! \n";
}
if (document.formpayment.CCExpiresYear.value == "") {
missinginfo += "\n     -  'Credit Card Expiration Year' was left blank! \n";
}
if (document.formpayment.contactEmail.value == "") {
missinginfo += "\n     -  'Contact Email' was left blank! \n";
}
if (document.formpayment.phone.value == "") {
missinginfo += "\n     -  'Phone' was left blank! \n";
}
// get checkbox array
	var checked = false;
	for (i=0; i<frm.length; i++)  {
	    if (frm.elements[i].id.indexOf('chkStatus') !=-1)    {
	        if (frm.elements[i].checked) {
	            checked = true;
	        }
	    }
	}
	if (!checked) {
	    missinginfo += "\n     -  'Agree Terms' was left blank! ";
	}


if (missinginfo != "") {
missinginfo ="You did not fill in all required fields: \n___________________________________________________\n" +
missinginfo + "\n___________________________________________________" +
"\n \n Please re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}


/*
#-------------------------------------------------------------------#
#																	#
#				Validate Registration Form							#			
#																	#
#-------------------------------------------------------------------#
*/

function checkSpotlightPresenterRegistration(frm) {
	missinginfo = "";
	if (document.spotlightregistration.referrer.value == "") {
		missinginfo += "\n     -  How did you hear about meeting?";
	}
	if (document.spotlightregistration.name.value == "") {
		missinginfo += "\n     -  Name";
	}
	if (document.spotlightregistration.year.value == "") {
		missinginfo += "\n     -  Year Established";
	}
	if (document.spotlightregistration.title.value == "") {
		missinginfo += "\n     -  Title";
	}
	if (document.spotlightregistration.email.value == "") {
		missinginfo += "\n     -  Email";
	}
	if (document.spotlightregistration.company.value == "") {
		missinginfo += "\n     -  Company";
	}
	if (document.spotlightregistration.phone.value == "") {
		missinginfo += "\n     -  Phone";
	}
	if (document.spotlightregistration.address.value == "") {
		missinginfo += "\n     -  Full Address";
	}
	if (document.spotlightregistration.description.value == "") {
		missinginfo += "\n     -  Technology Description";
	}
	if (document.spotlightregistration.stage.value == "") {
		missinginfo += "\n     -  Stage Of Development";
	}
	
	if (document.spotlightregistration.raisingmoney.value == "") {
		missinginfo += "\n     -  Are your currently raising money?";
	}
	if (document.spotlightregistration.revenueyear.value == "") {
		missinginfo += "\n     -  Revenue for past fiscal year?";
	}
	if (document.spotlightregistration.revenuefive.value == "") {
		missinginfo += "\n     -  5-year sales projection?";
	}
	

	if (missinginfo != "") {
		missinginfo ="_____________________________\n" +
		"You failed to correctly fill in your:\n" +
		missinginfo + "\n_____________________________" +
		"\nPlease re-enter and submit again!";
		alert(missinginfo);
		return false;
	}
else return true;
}


/*
#-------------------------------------------------------------------#
#																	#
#				Validate Registration Form							#			
#																	#
#-------------------------------------------------------------------#
*/


/*
#-------------------------------------------------------------------#
#																	#
#																	#			
#																	#
#-------------------------------------------------------------------#
*/



/*
#-------------------------------------------------------------------#
#																	#
#																	#			
#																	#
#-------------------------------------------------------------------#
*/

/*
#-------------------------------------------------------------------#
#																	#
#																	#			
#																	#
#-------------------------------------------------------------------#
*/


/*
#-------------------------------------------------------------------#
#																	#
#																	#			
#																	#
#-------------------------------------------------------------------#
*/





/*
#-------------------------------------------------------------------#
#																	#
#																	#			
#																	#
#-------------------------------------------------------------------#
*/
