
//Begin Refresh Page
var sURL = unescape(window.location.pathname);
function refresh()
{
    window.location.href = sURL;
}
//End Refresh Page

// BEGIN HREF TAGLINES
var sethref = "http://www.clf4kids.org/";
var sethttps = "https://www.clf4kids.org/";
function callhref() {
	var H1 = "<a href='" + sethref;
	document.write(H1);
}
// END HREF TAGLINES

//Donate button temp under construction
function donatetmp() {
	alert("Donation submissions are under security maintenance.\n\nPlease contact Childhood Leukemia Foundation directly at:\n1.888.CLF.7109 [1.888.253.7109]\n\nThank you for your donation and patience.");	
}

//What's This? CSC in donate_now.cfm
function cscinfo() {
	var cscwin = window.open('cscinfo.html','cscwin','width=550,height=425,menubar=no,scrollbar=no,resizable=no,toolbar=no');
	cscwin.moveTo(200,125);
}

//Popup of www.Highlights.com
function highlights() {
	var highwin = window.open('http://www.highlights.com','_blank');
	highwin.moveTo(200,125);
}

// BEGIN SHORE SOFTWARE TAGLINE
function shoretag(){
	var L1, L2, L3, L4 = "";
	L1 = "<tr><td align=right><font size=-2 face=Arial color=Blue>";
	L2 = L1 + "<blockquote><span class=ShoreTag>Designed&nbsp;&amp;&nbsp;maintained&nbsp;by&nbsp;";
	L3 = L2 + "<a href=http://www.shoresoftware.com target=_blank><span class=ShoreLink>Shore&nbsp;Software,&nbsp;Inc.</span></a>";
	L4 = L3 + "</span></blockquote></font></td></tr>";
	document.write(L4);
}
// END SHORE SOFTWARE TAGLINE

//Checks for Acrobat Reader
//This script detects the following plugin:
		//Flash
		//Windows Media Player
		//Java
		//Shockwave
		//RealPlayer
		//QuickTime
		//Acrobat Reader
		//SVG Viewer
function chkacro(pdf){
	if (pluginlist.indexOf("Acrobat Reader")!=-1) 
		{
			window.open("docs/" + pdf,"_blank");
		}
	else
		{
			alert("You need to download and install Acrobat Reader to view this form.\nIf the download does not automatically begin, please visit www.acrobat.com");
			window.open("http://ardownload.adobe.com/pub/adobe/reader/win/6.x/6.0/enu/AdbeRdr60_enu.exe","_blank");
		}
}

//Begin Submenu
//Contents for menu 1 = DONATE
var menu1=new Array()
menu1[0]='<a href="donate_options.cfm" class="menudonate">Make A Donation</a>'
menu1[1]='<a href="workplace_giving.html" class="menudonate">Workplace Giving and Payroll Deduction</a>'
menu1[2]='<a href="bequeath_planned.html" class="menudonate">Bequeath and Planned Giving</a>'
menu1[3]='<a href="visa.html" class="menudonate">New Visa Platinum Card</a>'
menu1[4]='<a href="donate_automobile.html" class="menudonate">Automobile Donation</a>'
menu1[5]='<a href="donate_hair.html" class="menudonate">Donate Your Hair</a>'
menu1[6]='<a href="get_involved.cfm" class="menudonate">Get Involved</a>'

//Contents for menu 2 = ABOUT US
var menu2=new Array()
menu2[0]='<a href="hugs_u_wear.html" class="menuabout">Hugs u Wear</a>'
//menu2[1]='<a href="gift_baskets.html" class="menuabout">Hope Gift Baskets</a>'
menu2[2]='<a href="wishbasket.html" class="menuabout">Wish Baskets</a>'
menu2[3]='<a href="hope_binders.html" class="menuabout">Hope Binders</a>'
//menu2[4]='<a href="care_4_kids_camps.html" class="menuabout">Care 4 Kids Camp</a>'
menu2[5]='<a href="phone_cards.html" class="menuabout">Phone Cards</a>'
menu2[6]='<a href="special_requests.html" class="menuabout">Special Requests</a>'
menu2[7]='<a href="our_sponsors.html" class="menuabout">Our Sponsors</a>'
menu2[8]='<a href="contact_us.cfm" class="menuabout">Contact Us</a>'
menu2[9]='<a href="contact_us.cfm" class="menuabout">Join Mailing List</a>'

//Contents for menu 3 = I'M A KID WITH CANCER
var menu3=new Array()
menu3[0]='<a href="faq.html" class="menukid">Frequently Asked Questions</a>'
menu3[1]='<a href="my_resources.html" class="menukid">Cool Stuff 4 Kids</a>'
menu3[2]='<a href="my_games.html" class="menukid">Cool Games 4 Kids</a>'
menu3[3]='<a href="keeping_real.html" class="menukid">Keeping It Real</a>'

//Contents for menu 4 = FAMILY RESOURCES
var menu4=new Array()
menu4[0]='<a href="fr_activity_books.html" class="menufamilyres">Activity Books</a>'
menu4[1]='<a href="fr_alternative_med.html" class="menufamilyres">Alternative Medicine</a>'
menu4[2]='<a href="fr_back_to_school.html" class="menufamilyres">Back to School</a>'
menu4[3]='<a href="fr_books.html" class="menufamilyres">Books</a>'
menu4[4]='<a href="fr_camps.html" class="menufamilyres">Camps</a>'
menu4[5]='<a href="fr_chat_messages.html" class="menufamilyres">Chat Rooms / Message Boards</a>'
menu4[6]='<a href="fr_clinical_trials.html" class="menufamilyres">Clinical Trials</a>'
menu4[7]='<a href="fr_edu_videos.html" class="menufamilyres">Educational Videos</a>'
menu4[8]='<a href="fr_more.html" class="menufamilyres">More...</a>'



var menuwidth='175px' //default menu width
var menuheight='1000px'
var menubgcolor='#ffffff'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu
//End Submenu



function validateWishOrd(){
	var a = false;
	if (document.getElementById("HosCode").value == ""){
	 a = true;
	}
	if (document.getElementById("Basket").value == ""){
	 a = true;
	}
	if (document.getElementById("Name").value == ""){
	 a = true;
	}
	if (document.getElementById("Phone").value == ""){
	 a = true;
	}
	if (document.getElementById("Fax").value == ""){
	 a = true;
	}
	if (document.getElementById("HospName").value == ""){
	 a = true;
	}
	if (document.getElementById("Dept").value == ""){
	 a = true;
	}
	if (document.getElementById("Addr").value == ""){
	 a = true;
	}
	if (document.getElementById("City").value == ""){
	 a = true;
	}
	if (document.getElementById("State").value == ""){
	 a = true;
	}
	if (document.getElementById("Zip").value == ""){
	 a = true;
	}
	if (document.getElementById("EMail").value == ""){
	 a = true;
	}
	if (document.getElementById("Child").value == ""){
	 a = true;
	}
	if (document.getElementById("Color").value == "0"){
	 a = true;
	}
	if (document.getElementById("Age").value == ""){
	 a = true;
	}
	if(a){
		alert ("All fields are required. Thank you.");
		return false;
	}
	else{
		return true;
	}
}



//BEGIN NEWSLETTER FUNCTIONS
function subscribe() {
	if (document.getElementById("NameField").value == ""){
		alert ("Please enter Your Name.");
		document.getElementById("NameField").focus();
		//return false;
	}
	else if (document.getElementById("EmailField").value == ""){
		alert ("Please enter Your Email Address.");
		document.getElementById("EmailField").focus();
		//return false;
	}
	else {
		var N = document.getElementById("NameField").value;	
		var E = document.getElementById("EmailField").value;	
		var newswin = window.open('newsletter.cfm?N=' + N + '&E=' + E,'newswin','width=600,height=150,menubar=no,scrollbar=no,resizable=no,toolbar=no');
		newswin.moveTo(220,150);
	}
}

	// BEGIN NEWSLETTER FORM
	function news(f){
		var f;
		var L1, L2, L3, L4, L5, L6 = "";
		L1 = "<fieldset style=float:center;><legend class=CLFD_txt>Please&nbsp;add&nbsp;me&nbsp;to&nbsp;your&nbsp;mailing&nbsp;list</legend>";
		L2 = L1 + "<form name=frm_emailnews method=post><table border=0 cellpadding=0 cellspacing=0 class=CLFD_txt>";
		L3 = L2 + "<tr><td>&nbsp;Name:&nbsp;<input type=Text id=NameField name=NameField maxlength=200 size=25 class=inputclass>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td</tr>";
		L4 = L3 + "<tr><td>&nbsp;Email:&nbsp;<input type=Text id=EmailField name=EmailField maxlength=200 size=25 class=inputclass></td></tr>";
		L5 = L4 + "<tr><td align=center><br><input type=Button value='Join Mailing List Now' class=CLF_btn onclick=subscribe()>";
		L6 = L5 + "</td></tr></table></form></fieldset>";
		if (f==1){
			document.write(L6);
		}
		else{};
	}
	// END NEWSLETTER FORM

//END NEWSLETTER FUNCTIONS

function checkDD(rb){
	if(rb.value == "Infant Wish Basket"){
		document.getElementById("Color").options.length = 0;
		document.getElementById("Color").options[0] = new Option('White', 'White');
	}
	else
	{
	    if(document.getElementById("Color").options.length == 1){
			document.getElementById("Color").options[0] = new Option('Select Color', '0');
			document.getElementById("Color").options[1] = new Option('Green', 'Green');
			document.getElementById("Color").options[2] = new Option('Blue', 'Blue');
			document.getElementById("Color").options[3] = new Option('Pink', 'Pink');
		}
	}
}
function IsNumeric(sText){
   var ValidChars = "0123456789()-";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }
function validatePhone(fld) {
    var error = "";
    var stripped = fld.value.replace(/[\(\)\.\-\ ]/g, '');    

   if (fld.value == "") {
        alert("You didn't enter a phone number.\n");
		return false;
    } else if (IsNumeric(stripped)==false) {
        alert("The phone number contains illegal characters.\n");
		return false;
    } else if (!(stripped.length == 10)) {
        alert( "The phone number is the wrong length. Make sure you included an area code.\n");
		return false;
    }
    return true;
}
function isChar(argvalue) {
		argvalue = argvalue.toString();
		
	    for (var n = 0; n < argvalue.length; n++){
		if (argvalue.substring(n, n+1) == "/" || argvalue.substring(n, n+1) > "<")
		return false;}
		
		return true;
		}