
     
function WriteContact(contact_id, name, position, bio, citystate, addr_string, phone_string, email_string) {
    var cID = 'contact' + contact_id;
    var clickID = 'supernote-click-' + cID;
    var noteID = 'supernote-note-' + cID;
  
    var str = '<div id="contact" style="min-height:8em; vertical-align:top; padding-top:1em;">';
    str = str + name + '<br/>';
    if (position != 'pos') {str = str + position + '<br/>';}
	str = str + citystate + '<br/>';
	str = str + '<a href="#' + cID + '" class="' + clickID + '"><div id="more">more....</div></a>';
    str = str + '</div>';  
	document.write(str);

	str = '<div id="' + noteID + '" class="snp-mouseoffset snb-pinned notedefault ContactBlock" style="border-style:double; border-color:#000; border-bottom-width:2px; border-right-width:2px;" >';
	str = str + '<a name="' + cID + '"></a>';
	str = str + '<h5 style="font-size: 1.1em; background-color:#151B54; color:#ddd; padding-top:10px; padding-bottom:10px !important;">';
	str = str + '<a href="#" class="note-close" style="font-size: 1.1em; background-color:#151B54; color:#ddd;vertical-align:top; ">X</a>';
	str = str + name;
	if (position != 'pos') 
		{
		str = str + '<br/>(' + position + ')<br/>';
		}
	str = str + '</h5>';
	
	if (bio !='bio') {str = str + '<p style="text-align:center;">' + bio + '</p>'};
	str = str + addr_string;
	str = str + phone_string + '<br>';
	str = str + email_string + '<br>';
	str = str + '<a href=personnel_detail.php?id=' + contact_id + '><em>See full profile</em></a>';
	str = str + '</div>';
	document.write(str); 
}



function WriteAddress(addr, city, state, zip, type){
	var str1;
	str1 = '(' + type + ')<br/> ' + addr + '<br/>';
	str1 = str1 + city + ', ' + state + '  ' + zip + '<br/><br/>';
	return(str1);
}

function WritePhone(phone, phone_type){
	var str1;
    str1 = phone + ' (' + phone_type + ')<br/>';
	return(str1);		 
}

function WriteEmail(email, email_type){
    var str1;
	str1 = '<a href="mailto:' + email + '">' + email + '</a>';
	str1 = str1 + ' (' + email_type + ')<br/>';
	return(str1);
}



function switchMenu(obj) {
    var el = document.getElementById(obj);
    if ( el.style.display != 'none' ) {
       el.style.display = 'none';
       }
       else {
       el.style.display = '';
       }
}



function WriteColapseArticle(id, date, author, title, preview_text, in_text, article_type){
    var str, art_id, pre_len;
	art_id = 'article_' + id;
	pre_id = 'pre_' + art_id;
	
	str = '<div class="colItem" style="padding:10px;">';
    	str = str + '<div id="' + pre_id + '" class="colapse_article" style="display:block;';
		if ( id == 2) {   str = str + ' float:right; ">';    }
		else {   str = str + ' float:left; ">';   }
		
		str = str + '<p class="colItemHead">' + title + '</p>'
       	if (date != 'date') {
      	   str = str + '<div class="attribution">Posted: ' + date;
      	   if (author != 'author') {  str = str + ' by ' + author;  }		
      	   str = str + '</div></p>';
    	}
				
    	str = str + '<a onclick="switchMenu(\'' + art_id + '\'); switchMenu(\'' + pre_id + '\');" title="Read More" class="show_more">Read More</a></span>';
    	str = str + '<p style="min-width:450px;">' + preview_text + '....</p>';
    	str = str + '</div>';
		
    	str = str + '<div id="' + art_id + '" class="colapse_article" style="display:none; ';
		if ( id % 2) {   str = str + ' float:right;">';  }
		else {   str = str + ' float:left;">';   }

		str = str + '<p class="colItemHead">' + title + '</p>'
		if (date != 'date') 
			   {str = str + '<div class="attribution">Posted: ' + date;
					if (author != 'author') {str = str + ' by ' + author;}		
					str = str + '</div></p>';
				}
    	str = str + '<a onclick="switchMenu(\'' + art_id + '\');switchMenu(\'' + pre_id + '\');" title="Read More" class="show_more">Read Less</a></p>';
    		str = str + '<p>' + in_text + '</p>';
    	str = str + '<a onclick="switchMenu(\'' + art_id + '\');switchMenu(\'' + pre_id + '\');" title="Read Less" class="show_more">Read Less</a>';
    	str = str + '&nbsp;</div>';
	str = str + '</div>';
	document.write(str);	 
}


function ARCHIVE_WriteEvent(in_event_id, display_date, evt_day, evt_month, evt_year, event_type, cityState, location, locationURL, subLocation, address, phone, time, agenda, register_open_flag, docstring){
     var str, pre_id;
	 if ( !docstring) {docstring="";}
	 event_id = 'event_id' + in_event_id;
	 pre_id = 'pre_' + in_event_id;
	 str = '<div class="colItem">';
    	 str = str + '<div id="' + pre_id + '" class="eventItem colapse_article" style="display:block; min-height:75px;">';
    	 str = str + '<p class="eventItemHead">' + display_date + '</p>';
    	 str = str + '<a onclick="switchMenu(\'' + event_id + '\');switchMenu(\'' + pre_id + '\');" title="Read More" class="show_more">Read More</a>';
    	 str = str + '<p class="eventItemDetail"><strong>' + event_type + '</strong> in ' + cityState + '<br/>';
    	 str = str + '<a href="http://' + locationURL + '" target="_blank">' + location + '</a> <br/>';
     	 str = str + '</p>';
     str = str + '</div>';
	 document.write(str);
	  
	 str = '<div id="' + event_id + '" class="eventItem colapse_article" style="display:none;">';
	 str = str + '<p class="eventItemHead">' + display_date + '</p>';
	 str = str + '<a onclick="switchMenu(\'' + event_id + '\');switchMenu(\'' + pre_id + '\');" title="Read More" class="show_more">Read Less</a>';

	 str = str + '<p class="eventItemDetail"><strong>' + event_type + '</strong> in ' + cityState + '<br/>';
	 str = str + '<a href="http://' + locationURL + '" target="_blank">' + location + '</a> <br/>';
     	if (subLocation !='subLocation') {str = str + subLocation + '<br/>';}
		if (address !='address') {str = str + address + '<br/>'}
		if (phone != 'phone') {str = str + phone + '<br/>';}
		if (time != 'time') {str = str + time + '<br/>';}
		if (agenda != 'agenda') {str = str + agenda +'<br/>';}
		if (docstring != ""  ) {
		   str = str + 'Documents for this meeting:<br>';
		   str = str +  docstring + '<br/>';
		}
		var now = new Date();
		var evt_date = new Date();
		evt_date.setFullYear(evt_year, (evt_month-1), evt_day);
		
		if (  (evt_date > now )  ) {
		   if (register_open_flag != 'N')  {
		   	  str = str + '<a href="docs/Winter 2011 Convention registration form.pdf">download the REGISTRATION form</a><br/>';
//		   	  str = str + '<a href="event_registration.php?event_id=' + in_event_id + '">REGISTER</a> to attend this meeting<br/>';
		   }
		}
//		str = str + evt_date + '===' + now;
      	str = str + '</p>';
      str = str + '</div>';
	  str = str + '</div>';
	  document.write(str);
}


function WriteCommittee(id, comm_name, chair, people_string, comm_desc){
	 var str, comm_id, pre_id;
	 comm_id = 'comm_' + id;
	 pre_id = 'pre_' + comm_id;
	 
	 str = '<div class="colItem" style="margin:0.5%;">';
	 	 str = str + '<div id="' + pre_id + '" class="colapse_article CommBlock" style="display:block;">';
	 	 	 str = str + '<p class="colItemHead">' + comm_name + '<p>';
			 if (chair.length>0){
     	 	 	str = str + '<a href="personnel.php">' + chair + '</a> - Chair';
			 }
		 	 str = str + '<p style="text-align:justify;">'+ comm_desc + '</p>';
		 	 if (people_string.length>0){
			 	str = str + '<span><a onclick="switchMenu(\'' + comm_id + '\'); switchMenu(\'' + pre_id + '\');" title="See Members" class="show_more">Show Members</a></span>';
			 }
			 str = str + '<p>&nbsp;</p>';
	 	str = str + '</div>';	 
		str = str + '<div id="' + comm_id + '" class="colapse_article CommBlock" style="display:none;">';
		 	str = str + '<p class="colItemHead">' + comm_name + '<p>';
     	 	if (chair.length>0){
			   str = str + '<a href="personnel.php">' + chair + '</a> - Chair';
			}
		 	str = str + '<p style="text-align:justify;">'+ comm_desc + '</p>';
			str = str + '<div style="float:right"><a onclick="switchMenu(\'' + comm_id + '\'); switchMenu(\'' + pre_id + '\');" title="Hide Members" class="show_more">Hide Members</a></div><br/>';
			str = str + '<span>' + people_string + '</span>';
		str = str + '</div>';
	str = str + '</div>';
	
	document.write(str);	 
	
}

function WriteCommitteeMembers(name_str, new_name){
	 var str;
	 str = name_str + '<br/><a href="#">' + new_name + '</a>';
	 return(str);
}

function ConfirmLogin(id, name){
	var password;
	prompt('Please enter name & password');
	   switchMenu(name);

}

function WriteAwardInfo(id, award_name){
    var str, award_id;
	award_id = 'award_' + id;
	pre_id = 'pre_' + award_id;
	str = '<div class="colItem">';
	    	str = str + '<div id="' + pre_id + '" class="colapse_article" style="display:inline; background:none; margin:0px; padding:0px;">';
		//str = str + '<a onclick="switchMenu(\'' + award_id + '\');switchMenu(\'' + pre_id + '\');" title="Read More" style="cursor:pointer; margin-top:0px;">Show Award History</a>';
		str = str + '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;';
		//str = str + '<a href="docs/NOMINATION FOR NFH OUTSTANDING TRACT ASSOCIATION AWARD 05-20-10.pdf" target="_blank">Award Nomination Form</a>';
    str = str + '</div>';

    	//str = str + '<div id="' + award_id + '" class="colapse_article" style="display:none; margin-top:0px;">';
		//str = str + '<span class="colItemHead" style="margin-top:0px; font-size:1.2em;">' + award_name + ': Award History</span>'
		//str = str + '<br/><span><a href="#">Award Nomination Form</a></span>';
    	//str = str + '<a onclick="switchMenu(\'' + award_id + '\');switchMenu(\'' + pre_id + '\');" title="Read More" class="show_more">Hide</a></p>';
		// 	 ** individual items are in the WriteAwardItem function **
		//	 ** close the blocks with the WriteAwardEnd function ** 		
	document.write(str);

}

function WriteAwardEnd(){
   var str = '</div></div>';
   document.write(str);
}


function WriteAwardItem(name, url, year, in_text){
    	var str = '<div style="font-weight:bold; text-align:left;">';
		if  (url != 'url') {str = str + '<a href="http://' + url + '" target="blank">' + name + '</a>';}
			else {str = str + name;}
		str = str + ' -- ' + year + ': </div>';
   		str = str + '<div style="margin-left:5%; text-align:left;">' + in_text + '</div>';
	document.write(str);
}


