// JavaScript Document

// Generic JavaScript interactions library

// Refugee Awareness Project 2008

// image definitions for the main site navigation

abouton			=	new Image(260,28);
abouton.src 		=	"images/nav/aboutRAP_on.gif";
aboutoff			=	new Image(260,28);
aboutoff.src		=	"images/nav/aboutRAP_off.gif";

reviewson			=	new Image(260,28);
reviewson.src 	=	"images/nav/reviews_on.gif";
reviewsoff		=	new Image(260,28);
reviewsoff.src	=	"images/nav/reviews_off.gif";

whatcanidoon			=	new Image(260,28);
whatcanidoon.src 	=	"images/nav/whatcanido_on.gif";
whatcanidooff		=	new Image(260,28);
whatcanidooff.src	=	"images/nav/whatcanido_off.gif";

infovaulton			=	new Image(260,28);
infovaulton.src 	=	"images/nav/infovault_on.gif";
infovaultoff		=	new Image(260,28);
infovaultoff.src	=	"images/nav/infovault_off.gif";

contacton		=	new Image(260,28);
contacton.src 	=	"images/nav/contactRAP_on.gif";
contactoff		=	new Image(260,28);
contactoff.src	=	"images/nav/contactRAP_off.gif";

rapshopon			=	new Image(260,28);
rapshopon.src 		=	"images/nav/RAPshop_on.gif";
rapshopoff			=	new Image(260,28);
rapshopoff.src		=	"images/nav/RAPshop_off.gif";

// About Us sub-navigation

/*whatwedoon			=	new Image(85,15);
whatwedoon.src 		=	"images/subnav/whatwedo_on.gif";
whatwedooff			=	new Image(85,15);
whatwedooff.src		=	"images/subnav/whatwedo_off.gif";

learnton			=	new Image(120,15);
learnton.src 	=	"images/subnav/whatwevelearnt_on.gif";
learntoff		=	new Image(120,15);
learntoff.src	=	"images/subnav/whatwevelearnt_off.gif";

gettingtoknowon			=	new Image(145,15);
gettingtoknowon.src 	=	"images/subnav/gettingtoknowyou_on.gif";
gettingtoknowoff		=	new Image(145,15);
gettingtoknowoff.src	=	"images/subnav/gettingtoknowyou_off.gif";

whyrapon			=	new Image(55,15);
whyrapon.src 	=	"images/subnav/whyrap_on.gif";
whyrapoff		=	new Image(55,15);
whyrapoff.src	=	"images/subnav/whyrap_off.gif";

rapsfriendson		=	new Image(80,15);
rapsfriendson.src 	=	"images/subnav/rapsfriends_on.gif";
rapsfriendsoff		=	new Image(80,15);
rapsfriendsoff.src	=	"images/subnav/rapsfriends_off.gif";

rapstuffon		= new Image(60,15);
rapstuffon.src	= "images/subnav/rapstuff_on.gif";
rapstuffoff		= new Image(60.15);
rapstuffoff.src	= "images/subnav/rapstuff_off.gif";

rapteeon		= new Image(80,15);
rapteeon.src	= "images/subnav/raptshirts_on.gif";
rapteeoff		= new Image(80,15);
rapteeoff.src	= "images/subnav/raptshirts_off.gif";

rapbookon		= new Image(90,15);
rapbookon.src	= "images/subnav/rapbooklets_on.gif";
rapbookoff		= new Image(90,15);
rapbookoff.src	= "images/subnav/rapbooklets_off.gif";*/

// Download button rollover

downloadon		=	new Image(60,60);
downloadon.src 	=	"images/download_on.gif";
downloadoff		=	new Image(60,60);
downloadoff.src	=	"images/download_off.gif";

function rollover(imgName){
	document.getElementById(imgName).src = eval(imgName + "on.src");	
}

function rolloff(imgName){
	document.getElementById(imgName).src = eval(imgName + "off.src");	
}

function not_blank(el){
	return el != '';	
}

function is_email(el){
	return((el.value != '')&&((el.value.indexOf('@') < 0) || (el.value.indexOf('.') < 0)))
}

function validate(frmName){
	frm = document.getElementById(frmName);
	if(!frm.policy.checked){
		alert("Please read and agree to our\nPrivacy Policy.");
		return false;
	} else { frm.submit(); }
}


/* pop-up link opener */
function win(url){
	myWindow = window.open(url,url,"width=860,height=660,scrollbars=yes");	
}

/* Div hide and display */

function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}

/* hides any displayed popups */
function hidePops(){
	HideContent('popchair');
	HideContent('poppsp');
	HideContent('poplight');
	HideContent('popvisor');
	HideContent('popsucker');
	HideContent('poppouch');
	HideContent('poptweezers');
}

function ShowContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "block";
}

function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
else { document.getElementById(d).style.display = "none"; }
}

