/* ------------------------------------------------------------------------ */
/* ------------------------- Photo Gallery Popup -------------------------- */
/* ------------------------------------------------------------------------ */
function photoGallery() {
	var iMyWidth;
	var iMyHeight;
	//gets top and left positions based on user's resolution so hint window is centered.
	iMyWidth = (window.screen.width/2) - (360 + 13); //half the screen width minus half the new window width. ***NOTE: +13 becos of off ctr design***
	iMyHeight = (window.screen.height/2) - (310); //half the screen height minus half the new window height.
	var win2 = window.open("photoGallery.php","Window2","status=no,height=620,width=720,resizable=no,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=no");
	win2.focus();
}
/* ------------------------------------------------------------------------ */
/* ------------------------ Random "Did U Know?" -------------------------- */
/* ------------------------------------------------------------------------ */
function generateDidUKnow(){
	var randomText = new Array()
	randomText[0] = 'Every year, thousands of people with blood disorders such as leukaemia, reach a stage where only a stem cell transplant can save them. Family members, particularly brothers and sisters have a 1 in 4 chance in making the best match whilst the odds to an unrelated donor is 1 in 20 000.'
	randomText[1] = 'The primary source of stem cells is from bone marrow. This remains a critical life-line for patients suffering from leukaemia, lymphoma & other blood related diseases.'
	randomText[2] = '30% of patients needing a transplant identify a donor with matching tissue-type within their own family and receive bone marrow from a relative, usually a sibling. 70% need to find an unrelated donor.'
/* ------------------------------------------------------------------------ */
	var j = 0
	var p = randomText.length;
	var preBuffer = new Array()
	for (i = 0; i < p; i++){
   		preBuffer[i] = new Image()
   		preBuffer[i].src = randomText[i]
	}
	var whichText = Math.round(Math.random()*(p-1));
		document.write(randomText[whichText]);
}
/* ------------------------------------------------------------------------ */
/* ------------------------- Generate Footer  ----------------------------- */
/* ------------------------------------------------------------------------ */
function generate_footerMsg(){
	document.write('<a href="uCanhelp_donor_whyJoin.html"><img src="images/footerBut_01.jpg" border="0" /></a><a href="uCanHelp_contribute_financial.html"><img src="images/footerBut_02.jpg" border="0" /></a><a href="uCanHelp_Volunteer_whatInIt.html"><img src="images/footerBut_03.jpg" border="0" /></a>')
}
function generate_footerMsg_02(){
	document.write('<!--      <p> ADD LATER IF NEEDED </p>        -->')
}
/* ------------------------------------------------------------------------ */
/* ------------------------------ runSwfs --------------------------------- */
/* ------------------------------------------------------------------------ */
function runSwf_intro()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="620" height="310">\n')
    document.write('<param name="movie" value="images/intro.swf">\n')
    document.write('<param name="quality" value="high"/>\n')
    document.write('<param name="menu" value="false">\n')	
	document.write('<param name="wmode" value="transparent">\n')
    document.write('<embed src="images/intro.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="620" height="310" wmode="transparent"/>\n')
    document.write('</object>\n')
}

function runSwf_didUknow()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="240" height="220">\n')
    document.write('<param name="movie" value="images/didUknow.swf">\n')
    document.write('<param name="quality" value="high"/>\n')
    document.write('<param name="menu" value="false">\n')	
	document.write('<param name="wmode" value="transparent">\n')
    document.write('<embed src="images/didUknow.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="240" height="220" wmode="transparent"/>\n')
    document.write('</object>\n')
}

function runSwf_mapGlobal()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="600" height="400">\n')
    document.write('<param name="movie" value="images/mapGlobal.swf">\n')
    document.write('<param name="quality" value="high"/>\n')
    document.write('<param name="menu" value="false">\n')
	document.write('<param name="wmode" value="transparent">\n')
    document.write('<embed src="images/mapGlobal.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="600" height="400" wmode="transparent"/>\n')
    document.write('</object>\n')
}

function runSwf_navMain(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="940" height="130">\n')
    document.write('<param name="movie" value="images/navMain.swf?target='+location+'">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
	document.write('<param name="wmode" value="transparent">\n')
    document.write('<embed src="images/navMain.swf?target='+location+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="940" height="130" wmode="transparent"/>\n')
    document.write('</object>\n')
}

function runSwf_navSub_aboutUs(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="270" height="350">\n')
    document.write('<param name="movie" value="images/navSub_aboutUs.swf?target='+location+'">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
	document.write('<param name="wmode" value="transparent">\n')
    document.write('<embed src="images/navSub_aboutUs.swf?target='+location+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="270" height="350" wmode="transparent"/>\n')
    document.write('</object>\n')
}

function runSwf_navSub_registeredDonors(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="270" height="280">\n')
    document.write('<param name="movie" value="images/navSub_registeredDonors.swf?target='+location+'">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
	document.write('<param name="wmode" value="transparent">\n')
    document.write('<embed src="images/navSub_registeredDonors.swf?target='+location+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="270" height="280" wmode="transparent"/>\n')
    document.write('</object>\n')
}

function runSwf_navSub_patients(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="270" height="220">\n')
    document.write('<param name="movie" value="images/navSub_patients.swf?target='+location+'">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
	document.write('<param name="wmode" value="transparent">\n')
    document.write('<embed src="images/navSub_patients.swf?target='+location+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="270" height="220" wmode="transparent"/>\n')
    document.write('</object>\n')
}

function runSwf_navSub_howUcanHelp(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="270" height="310">\n')
    document.write('<param name="movie" value="images/navSub_howUcanHelp.swf?target='+location+'">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
	document.write('<param name="wmode" value="transparent">\n')
    document.write('<embed src="images/navSub_howUcanHelp.swf?target='+location+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="270" height="310" wmode="transparent"/>\n')
    document.write('</object>\n')
}

function runSwf_navSub_resourceCentre(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="270" height="200">\n')
    document.write('<param name="movie" value="images/navSub_resourceCentre.swf?target='+location+'">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
	document.write('<param name="wmode" value="transparent">\n')
    document.write('<embed src="images/navSub_resourceCentre.swf?target='+location+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="270" height="200" wmode="transparent"/>\n')
    document.write('</object>\n')
}

function runSwf_video()
{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="600" height="520" id="corporateVideo" align="middle">\n')
    document.write('<param name="allowScriptAccess" value="sameDomain" />\n')
    document.write('<param name="movie" value="video/corporateVideo.swf" /><param name="quality" value="high" />\n')
    document.write('<param name="bgcolor" value="#ffffff" />\n')	
	document.write('<embed src="video/corporateVideo.swf" quality="high" bgcolor="#ffffff" width="600" height="520" name="corporateVideo" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n')
    document.write('</object>\n')
}

/* ------------------------------------------------------------------------ */
/* ---------------------------- FAQ Show & Hide ---------------------------- */
/* ------------------------------------------------------------------------ */
function faq_hideNshow(divID) {
  var item = document.getElementById(divID);
  if (item) {
    item.className=(item.className=='faq-hide')?'faq-show':'faq-hide';
  }
}
/* ------------------------------------------------------------------------ */
/* ---------------------------- DW Functions ------------------------------ */
/* ------------------------------------------------------------------------ */
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  var win2 = window.open(theURL,winName,features);
  win2.focus();
}