/* Generic Functions */
function elem_hide(id) {
	var elem = document.getElementById(id);
	elem.style.display ="none";
}

function elem_show(id) {
	var elem = document.getElementById(id);
	elem.style.display ="inline";
}
	

/* Specific Functions */
function country_check (item) {
	var sel_value = item.options[item.selectedIndex].value;
	if (sel_value == "United States") {
		elem_show('state_dropdown');
	} else {
		elem_hide('state_dropdown');
	}
}

function submitBasicInfoForm ()
{
	if (document.basic_info.headline.value == "" || document.basic_info.email.value == "" || document.basic_info.city.value == "" || document.basic_info.country.value == "") {
	    alert( "Headline, Email, Country, and City are all required fields :)" );
	  }
  else {
		document.basic_info.submit() ;
	}
}

function submitAdForm ()
{
	if (document.post_ad.ad_body.value == "" || document.post_ad.headline.value == "" || document.post_ad.email.value == "" || document.post_ad.city.value == "" || document.post_ad.country.value == "") {
	    alert( "Ad Body, Headline, Email, Country, and City are all required fields :)" );
	  }
  else {
		document.post_ad.submit() ;
	}
}

function submitPaypal ()
{
  document.paypal.submit() ;
}

function submitShortForm ()
{
  document.short.submit() ;
}

function submitSkillsForm ()
{
  document.skills.submit() ;
}

function imposeMaxLength(Object, MaxLen)
{
  return (Object.value.length <= MaxLen);
}
