/**
 * @author Frank Ramirez
 */

function Go_index()
{	var newcontent;
	var element = document.getElementById('boxholder');
	element.align = "center";
	
	newcontent = Write_index();
	element.innerHTML = newcontent;
}

function Write_index()
{	var content;
	content = "<img src='Universal/front.jpg' height='452' width='600'/>";
	content += "<p id='mission'>The purpose of Mi Familia is to provide a social, cultural, and political forum for the students of North Carolina State University and the surrounding community interested in experiencing and promoting the richness of the international Latino and Hispanic community/culture.</p>"
	element = document.getElementById('boxholder');
	element.style.fontSize = "14px";
	content+="<div id=linkholder> <a class = 'link' target = 'blank' href='http://mifamiliancsu.blogspot.com/'><img class='picture' src='Universal/somosbutton.jpg' /></a><br />SOMOS Information Blog</div>"
	content = addFooter(content);
	return content;
}
 
function Go_exec()
{	var stretchers, togglers, accordion, newcontent, element;
		
	newcontent = Write_exec();
	element=$('boxholder');
	element.align = "left";
	element.innerHTML = newcontent;
	
	accordion = new Accordion('.exec-click','.exec-content',{});
	accordion.showThisHideOpen(0);
}

function Write_exec()
{	
	var content, openpopup;
	content = "<div id= execholder><p class='exec-click'>President</p>";
	content += "<p class='exec-content'> <img src='exec/pres.jpg'  width='100' height='118' /> <br><a class = 'link' href='mailto:jdrivera@ncsu.edu'>Jezzette Rivera</a></br></p>";
	content += "<p class='exec-click'>Vice President</p>";
	content += "<p class='exec-content'> <img src='exec/vpres.jpg'  width='100' height='118' /> <br><a class = 'link' href='mailto:mcalvara@ncsu.edu'>Camila Alvarado</a></br></p>";
	content += "<p class='exec-click'>Community Service Chair</p>";
	content += "<p class='exec-content'> <img src='exec/repr.jpg'  width='100' height='118' /> <br><a class = 'link' href='mailto:acchaput@ncsu.edu'>Ashley Chaput</a></br></p>";
	content += "<p class='exec-click'>Secretary</p>";
	content += "<p class='exec-content'> <img src='exec/secr.jpg'  width='100' height='118' /> <br><a class = 'link' href='mailto:nmmachad@ncsu.edu'>Nicole Machado</a></br></p>";
	content += "<p class='exec-click'>Treasurer</p>";
	content += "<p class='exec-content'> <img src='exec/tres.jpg'  width='100' height='118' /> <br><a class = 'link' href='mailto:efalvara@ncsu.edu'>Steven Alvarado</a></br></p>";
	content += "<p class='exec-click'>Webmaster</p>";
	content += "<p class='exec-content'> <img src='exec/webm.jpg'  width='100' height='118' /> <br><a class = 'link' href='mailto:frramire@ncsu.edu'>Frank Ramirez</a></br></p>";
	
	content += "<img id= 'execphoto' src='exec/execfoto.png'/></div>"
	content = addFooter(content);
	return content;
}

function Go_calen()
{	var newcontent;
	var element;
	newcontent = Write_calen();
	element = document.getElementById('boxholder');
	element.align = "center";
	element.style.fontSize = "14px";
	element.innerHTML = newcontent;
}

function Write_calen()
{	var content;
	content =  "<p align='center'>"
	content += "<iframe src='http://www.google.com/calendar/embed?src=mifamiliaadmin%40gmail.com&amp;title=Mi%20Familia&amp;chrome=NONE&amp;height=220&amp;epr=2' style=' border-width:0 ' width='650' frameborder='0' height='350'></iframe>"
    content += "<p align='left'>Meetings are held in 307 Mann Hall @ 7:30</p>"
    content += "<p align='left'>Click on events within calendar for more information</p>";
	content = addFooter(content);
	return content;
}

function Go_links()
{	var newcontent;
	var element;
	newcontent = Write_links();
	element = document.getElementById('boxholder');
	element.align = "center";
	element.style.fontSize = "14px";
	element.innerHTML = newcontent;
}

function Write_links()
{	var content;
	content =  "<div id=linkholder> <a class = 'link' target = 'blank' href='http://www.ncsu.edu/stud_orgs/shpe/index.html'>Society of Hispanic Professional Engineers<br /><img class='picture' src='Universal/shpeLogo.png' /></a><br />"
    content += "<a class = 'link' target = 'blank' href='http://www.ncsu.edu'>NCSU Homepage<br /><img class='picture' src='Universal/ncsuLogo.gif' /></a></div>"
	content = addFooter(content);
	return content;
}

function Go_photos()
{	var newcontent;
	var element;
	newcontent = Write_photos();
	element = document.getElementById('boxholder');
	element.align = "center";
	element.style.fontSize = "14px";
	element.innerHTML = newcontent;
}

function Write_photos()
{	var content;
	content =  "<div id='photoholder'> <a onclick='Switch_show(0);'><img class='picture' src='images/MiFamiliaSoccerTournament.jpg' border= '0'></a>";
	content += "<a onclick='Switch_show(1);'><img class='picture' src='images/OldPhotos.jpg' border= '0'></a>";
    content += "<br /><a onclick='Switch_show(2);'><img class='picture' src='images/FiestaDelPueblo.jpg' border= '0'></a>";
    content += "<a  onclick='Switch_show(3);'><img class='picture' src='images/OrganizationalFair.jpg' border= '0'></a>";
	content = addFooter(content);
	
	return content;
}

function Switch_show(num)
{	var content, i, numofpics, albumnames;
	var numofpics = new Array(10,10, 7, 5);
	var albumnames = new Array("Soccer Tournament","Old Photos", "Fiesta Del Pueblo", "Organizational Fair");

	content = "Lightbox.open([";
	for(i=1;i<=numofpics[num];i++)
	{
		content += "['photos/"+num+"/"+i+".jpg', '"+albumnames[num]+"']";
		if(i!=10){
			content+= ",";
		}
	}
	content += "],0);";
	return eval(content);
}

function Go_const()
{	var newcontent, element, stretchers, togglers, accordion;

	newcontent = Write_const();
	element = document.getElementById('boxholder');
	element.align = "center";
	element.style.fontSize = "14px";
	element.innerHTML = newcontent;
	
	accordion = new Accordion('.const-click', '.const-content');
	accordion.showThisHideOpen(0);
}

function Write_const()
{	var content;
	content = "<div id='constitution'><div class='const-click'>I: Name and Purpose</div>" 
	content +="<div class='const-content'>This organization shall be called <span class='ch'>Mi Familia</span> at North Carolina State University.<br />"
	content +="The purpose of this club shall be to provide a social, cultural and political forum for students for North Carolina State University and the surrounding community interested in experiencing and promoting the richness of the international Hispanic &amp; Latino community/culture.</div>"	
	content +="<div class='const-click'>II: Membership</div>"
	content +="<div class='const-content'><span class='ch'>Section 1: Regular Membership</span><br />"
	content +="Regular membership shall be open to all regularly enrolled North Carolina State University students.<br />"
	content +="<span class='ch'>Section 2: Honorary Membership</span><br />"
	content +="Honorary membership will be granted to alumni and community members.</div>"
	content +="<div class='const-click'>III: Organization: Officers</div>"
    content +="<div class='const-content'>The elected officers of this organization shall be the president, the vice president, the secretary, the treasurer, and the historian:<br />"
    content +="<span class='ch'>1.</span> The president shall be the chief executive officer for the organization; he or she shall be present at all regular and special meetings, and appoint all committee chairpersons.<br />"
    content +="<span class='ch'>2.</span> The Vice president shall assume the duties of the President when the President is not available, and shall be directly responsible for oversight of all committee activities.<br />"
    content +="<span class='ch'>3.</span> The Secretary shall record the minutes of all organizational activities and keep all official records.  It will be duty of this person to communicate with organization membership and all organization correspondence.<br />"
    content +="<span class='ch'>4.</span> The Treasurer shall receive all monies, writing receipts, and shall deposit and disburse monies in accordance with the constitution.  He or she shall maintain all financial records.<br />"
    content +="<span class='ch'>5.</span> The Historian/Webmaster shall keep log of all organization programs and activities and have primary responsibility of developing a scrapbook for the organization.  It will also be duty of this person to make sure the organization website is updated constantly.  The administration shall consist of an executive board, non-executive officers, and committee chairpersons.<br /><br /></div>"
    content +="<div class='const-click'>III: Organization: Elections</div>"
	content +="<div class='const-content'>The offices of the administration are elected positions the be held by regular members<br />"
    content +="only.  Any regular member of the chapter may be nominated for office provided they are:<br />"
    content +="<span class='ch'>1.</span>  In good standing, as defined by North Carolina State University.<br />"
    content +="<span class='ch'>2.</span>  A full-time student.<br />"
    content +="<span class='ch'>3.</span>  Carrying a minimum GPA of 2.0.<br />"
    content +="<span class='ch'>4.</span>  Eligible for an elected position.<br />"
    content +="Elections will take place at the third to last meeting of the spring semester for the following academic year, unless otherwise needed anytime while school is in session.  Nomination of all officers shall be made directly from the floor.  Only regular members present at the election will be afforded voting privileges.  The procedure for voting will be by secret ballot.  All voting ballot shall be collected and counted by the Secretary.  An election of officer is won by obtaining fifty-one percent (51%) of the vote.  The winning candidates assume office at the last legislative meeting of the spring semester.</div>"	
	content +="<div class='const-click'>IV: Dues</div>"
    content +="<div class='const-content'>All regular and new members must pay annual membership dues at the beginning of the school term at the discretion of the executive board.</div>"
    content +="<div class='const-click'>V: Amending the Constitution</div>"
    content +="<div class='const-content'>Amendments to the constitution shall be presented by members of the club in writing and read at a regular meeting but shall not be voted upon until the next regular meeting and then only after informing each member of the proposed amendments.  A two-thirds majority of regular members present and voting shall be required to pass the amendment.</div>"
    content +="<div class='const-click'>VI: Meetings</div>"
    content +="<div class='const-content'><span class='ch'>Section 1: Regular Meetings</span><br />"
    content +="At the beginning of each semester, a time and place for weekly or bi-weekly meetings shall be decided upon by majority vote of the regular members.<br />"
    content +="<span class='ch'>Section 2: Special Meetings</span><br />"
    content +="Special meetings shall be held at the discretion of the President and all members will be notified of the time and place.<br />"
    content +="<span class='ch'>Section 3: Officer Meetings</span><br />"
    content +="Officers shall meet a minimum of every two weeks during the academic year at a time and place designated by the President.</div>"
    content +="<div class='const-click'>VII: Committees</div>"
  	content +="<div class='const-content'>The club shall form special committees as needed.  The President shall appoint committee chairpersons.</div></div>"    
	content = addFooter(content);
	return content;
}

function addFooter(content)
{
	content+="<div id = 'iconfooter' align='center'>"
  	content+="<img src='Universal/MiFamlogonew.jpg'/></div>"
	return content;
}


window.addEvent('domready', function(){
	/* var accordion = new Accordion('a.tab', 'div.box', {
		onActive: function(toggler, element){
			toggler.setStyle('opacity', '1');
		},
		onBackground: function(toggler, element){
			toggler.setStyle('opacity', '.6');
		},
		show:0
	}); */
	Go_index();
});