var upperX = 250;			
var upperY = 150;			
var winHeight = 800;		
var winWidth = 900;		
var winParameters = "";	
var winContent = "";		


blue_sel = new Array();

blue_sel[0] = "images/blue-space.gif";
blue_sel[1] = "images/blue-arrow.gif";

ozone_icon = new Array();

ozone_icon[0] = "images/ozone-tips-up.jpg";
ozone_icon[1] = "images/ozone-tips-up.jpg";

twitter_icon = new Array();

twitter_icon[0] = "images/twitter-up.gif";
twitter_icon[1] = "images/twitter-over.gif";

facebook_icon = new Array();

facebook_icon[0] = "images/facebook-up.gif";
facebook_icon[1] = "images/facebook-over.gif";


blue_sel_img = new Array();

for (var i = 0; i < blue_sel.length; i++) 
{
	blue_sel_img[i] = new Image();
	blue_sel_img[i].src = blue_sel[i];		
}

ozone_icon_img = new Array();

for (var i = 0; i < ozone_icon.length; i++) 
{
	ozone_icon_img[i] = new Image();
	ozone_icon_img[i].src = ozone_icon[i];		
}

facebook_icon_img = new Array();

for (var i = 0; i < facebook_icon.length; i++) 
{
	facebook_icon_img[i] = new Image();
	facebook_icon_img[i].src = facebook_icon[i];		
}

twitter_icon_img = new Array();

for (var i = 0; i < twitter_icon.length; i++) 
{
	twitter_icon_img[i] = new Image();
	twitter_icon_img[i].src = twitter_icon[i];		
}


function button_state(img_name,img_num) {
	switch(img_name) {
		case 'twitter_name':
			document[img_name].src = twitter_icon_img[img_num].src;
			break;
		case 'twitter_name2':
			document[img_name].src = twitter_icon_img[img_num].src;
			break;			
			
		case 'facebook_name':
			document[img_name].src = facebook_icon_img[img_num].src;
			break;
		case 'facebook_name2':
			document[img_name].src = facebook_icon_img[img_num].src;
			break;			
	}
					
}

function launch_social_media(img_name) {
	switch(img_name) {
		case 'twitter_name':
			document.location = "http://twitter.com/OzoneActionHero";
			break;
		case 'twitter_name2':
			document.location = "http://twitter.com/OzoneActionHero";
			break;			
						
		case 'facebook_name':
			document.location = "http://www.facebook.com/pages/Ozone-Action-Hero/72583067284";
			break;
		case 'facebook_name2':
			document.location = "http://www.facebook.com/pages/Ozone-Action-Hero/72583067284";
			break;			
	}
}

function toggle_menu() {

	if (document.getElementById('ozone_tips_id').style.visibility == 'hidden') {
		document.getElementById('ozone_tips_id').style.visibility = 'visible';
	}
	else {
		document.getElementById('ozone_tips_id').style.visibility = 'hidden';
	}
}

function open_menu() {
	document.getElementById('ozone_tips_id').style.visibility = 'visible';

	document['ozone_name'].src = ozone_icon_img[1].src;
}

function close_menu() {
	document.getElementById('ozone_tips_id').style.visibility = 'hidden';
	document['ozone_name'].src = ozone_icon_img[0].src;
	document['blue_selA'].src = blue_sel_img[0].src;
	document['blue_selB'].src = blue_sel_img[0].src;
}

function select_eblast(sub_menu) {
	switch(sub_menu) {
		case 1:document['blue_selA'].src = blue_sel_img[1].src;
			   document['blue_selB'].src = blue_sel_img[0].src;
			break;
		case 2:document['blue_selA'].src = blue_sel_img[0].src;
			   document['blue_selB'].src = blue_sel_img[1].src;		
			break;			
	}
}

function shirt_selection(num) {
	switch(num) {
		case 1:
			document.ozoneform2.t_shirt.value = "KMedium";
			submit_tshirt_info();
			break;	
		case 2:
			document.ozoneform2.t_shirt.value = "KLarge";
			submit_tshirt_info();
			break;				
		case 3:
			document.ozoneform2.t_shirt.value = "small";
			submit_tshirt_info();
			break;
		case 4:
			document.ozoneform2.t_shirt.value = "medium";
			submit_tshirt_info();
			break;		
		case 5:
			document.ozoneform2.t_shirt.value = "large";
			submit_tshirt_info();			
			break;				
		case 6:
			document.ozoneform2.t_shirt.value = "xlarge";
			submit_tshirt_info();			
			break;
		case 7:
			document.ozoneform2.t_shirt.value = "xxlarge";
			submit_tshirt_info();			
			break;			
		case 8:
			document.ozoneform2.t_shirt.value = "none";
			submit_tshirt_info();			
			break;			
	}				   
}

function toggle_shirt_form(num) {
	if (num == 1) {
		document.getElementById('size_option').style.display = 'block';
	}
	else {
		document.getElementById('size_option').style.display = 'none';
		shirt_selection(5);
	}  
}

function toggle_shirt_form(num) {
	if (num == 1) {
		document.getElementById('size_option').style.display = 'block';
	}
	else {
		document.getElementById('size_option').style.display = 'none';
		shirt_selection(5);
	}  
}

function school_option() {
	var current_list = document.contact_info.school_nme;
	var option_choice = current_list.options[current_list.selectedIndex].value;
	if (option_choice == "Other") {
		document.getElementById('school_id').style.display = 'block';
		document.contact_info.SchoolOther.focus();
	}
	else {
		document.getElementById('school_id').style.display = 'none';
	}
}

function submit_tshirt_info() {
	document.ozoneform2.submit();
}

function setWinParams() {
	winParameters  = "left="+upperX+",top="+upperY+",screenx="+upperX+",screeny="+upperY;
	winParameters += ",height="+winHeight+",width="+winWidth+",toolbar=no,titlebar=no,maximize=no,";
	winParameters += "location=no,directories=no,status=no,menubar=yes,scrollbars=no,resizable=yes";
}

function launch_pledge_form() {

	setWinParams();
	
	// Open window	
	newWin = window.open("pdf/campo-pledge-form.pdf","contactWin",winParameters);
	
	if(newWin==null){
		document.getElementById('campo_pledge_id').style.visibility = 'visible';
	}
}

function NavigationSection() {
	document.writeln('<a href="accessibility.htm" style="padding-left:17px; color:#0f5aab; text-decoration:none; font-size:0.7em;">Accessibility</a>');
	document.writeln('<div id="navigation">');	
	document.writeln('<ul>');
	document.writeln('<li class="nav_home"><a href="index.html">Home</a></li>');
	document.writeln('<li class="nav_signup"><a href="sign-up.php?school=n">Sign Up</a></li>');
	document.writeln('<li class="nav_yourcommitment"><a href="your-commitment.html">Your Commitment</a></li>');
	document.writeln('<li class="nav_contactus"><a href="contact.html">Contact</a></li>');
	document.writeln('<li class="nav_enespanol"><a href="es/es_index.html">En Espanol</a></li>');
	document.writeln('</ul>');
	document.writeln('</div>');
	document.writeln('<div id="sidebar" onmouseout="close_menu()";>');
	document.writeln('<a href="educ-activities.html"><img src="images/educational-activities.jpg" alt="Educational Heroes" /></a>');
	document.writeln('<a href="interesting-facts.html"><img style="padding-top:4px;" src="images/interesting-facts.jpg" alt="Interesting Facts" /></a>');
	document.writeln('<a href="school-resources.html"><img src="images/school-resources.jpg" alt="School Resources" /></a>');
	document.writeln('<a href="become-a-hero.html"><img src="images/become-a-hero.jpg" alt="Become a Hero!" /></a>');
	document.writeln('<a href="press-room.html"><img src="images/press-room.jpg" alt="Press Room" /></a>');
	document.writeln('<a href="helpful-links.html"><img src="images/helpful-links.jpg" alt="Helpful Links" /></a>');
	document.writeln('<a href="hero-spotlight.html"><img src="images/hero-spotlight.jpg" alt="Hero Spotlight" /></a>');
	document.writeln('<a href="calendar.html"><img src="images/calendar.jpg" alt="Calendar" /></a>');
	document.writeln('<div onmouseover="javascript:open_menu();" style="cursor:pointer; padding-bottom:0px;">');
	document.writeln('<img name="ozone_name" src="images/ozone-tips-up.jpg" alt="Ozone Tips" />');
	document.writeln('</div>');
	document.writeln('<div id="ozone_tips_id" style="padding-top:0px; padding-left:2px; padding-right:2px; width:120px; visibility:hidden;" onmouseover="open_menu()";valign=top>');
	document.writeln('<table class="ozone_tips_menu" valign=top>');
	document.writeln('<tr onmouseover="javascript:select_eblast(1);"><td id="item1" valign=top width=6px; align=right style="color:#ffffff";><img name="blue_selA" src="images/blue-space.gif" alt="Back to School" /></td><td align=left valign=top><a href="back-to-school.html" style="color:#1a61af; text-decoration:none;">Back to School</a></td></tr>');
	document.writeln('<tr onmouseover="javascript:select_eblast(2);"><td id="item1" valign=top width=6px; align=right style="color:#ffffff";><img name="blue_selB" src="images/blue-space.gif" alt="Green Grilling Tips" /></td><td align=left valign=top><a href="green-grilling.html" style="color:#1a61af; text-decoration:none;">Green Grilling Tips</a></td></tr>');
	document.writeln('</table>');
	document.writeln('</div>');
	document.writeln('<br /><br />');
	document.writeln('<div>');
	document.writeln('<table class="commonTL">');
	document.writeln('<tr><td style="padding-left:26px;">');
	document.writeln('<img name="twitter_name" src="images/twitter-up.gif" width="60" height="60" style="cursor:hand"; onclick="launch_social_media(\'twitter_name\')"; onmouseup="button_state(\'twitter_name\',0)"; onmouseover="button_state(\'twitter_name\',1)"; onmouseout="button_state(\'twitter_name\',0)"; onmousedown="button_state(\'twitter_name\',1)"; alt="" />');
	
	document.writeln('</td></tr><tr><td style="padding-left:26px;">');
	document.writeln('<img name="facebook_name" src="images/facebook-up.gif" width="60" height="60" style="cursor:hand"; onclick="launch_social_media(\'facebook_name\')"; onmouseup="button_state(\'facebook_name\',0)"; onmouseover="button_state(\'facebook_name\',1)"; onmouseout="button_state(\'facebook_name\',0)"; onmousedown="button_state(\'facebook_name\',1)"; alt="" />');
	document.writeln('</td></tr></table></div><img src="images/oahlogo.jpg" alt="Become an ozone action hero." /></div>"');
}

function FooterSection() {
	document.writeln('<div id="footer">');
	document.writeln('<p>&copy; 2009-2013 CAMPO - Become an Ozone Action Hero, All Rights Reserved. site by <a href="http://www.pgccreative.com">PGC</a> &nbsp; &nbsp; <a href="sitemap.html">Sitemap</a> &nbsp; &nbsp; revision date: 10/28/2009</p>');
	document.writeln('</div>');
}

