<!--
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 doBrand(inVal){
			//alert(inVal);
			if (document.getElementById("selBrand" + inVal).style.display=="inline"){
				document.getElementById("selBrand" + inVal).style.display="none";
			}else{
				document.getElementById("selBrand" + inVal).style.display="inline";
			}
		}
		
		function doWinPrint(){
			window.open("bShowerPrint.asp?Print=yes", "Street_Map", "menubar=yes,location=No,resizable=yes,scrollbars=yes,status=yes,width=775,height=537");
		}
		
		function doWinPrint2(NR){
			window.open("bShowerPrint2.asp?Print=yes&Ukey="+ NR +"", "Street_Map", "menubar=yes,location=No,resizable=yes,scrollbars=yes,status=yes,width=775,height=537");
		}
		
		function doMap(mapImg){
			var url; 
			url = "viewMap.asp?Map=" + mapImg;
			
			window.open(url, "Street_Map", "menubar=yes,location=No,resizable=yes,scrollbars=yes,status=yes,width=775,height=537");
		}

		var numCheck = false;
		var theError;
		var email;
		var pass;
		var emailPat=/^(.+)@(.+)$/;
		theError ="";
		var doErr = false;
		
	function doBirthCheck(){
		var Phone	= document.getElementsByName("cNum");
		var mName	= document.BirthAnounce.mName.value;
		var fName	= document.BirthAnounce.fName.value;
		var email	= document.BirthAnounce.Email.value;
		var bPass	= document.BirthAnounce.bPass.value;
		var cbPass	= document.BirthAnounce.cbPass.value;
		var bSur	= document.BirthAnounce.Surname.value;
	
		var matchArray=email.match(emailPat);
		
		if ((Phone.value=="")){ //||(Phone.value=="")
			alert("In Order To Register, Please Correct The Following Field(s):  "+'\n\n\n' + "Please Enter a Valid Cell Phone Number");
			Phone.focus()
			return false;
		}
		/*if (checkInternationalPhone(Phone.value)==false){
			alert("In Order To Register, Please Correct The Following Field(s):  "+'\n\n\n' + "Please Enter a Valid Cell Phone Number");
			Phone.value="";
			Phone.focus();
			return false;
		}*/
		
		if (mName ==""){ theError += " - Mothers name field can not be blank!"+ '\n\n';} 
		if (matchArray==null) {	theError += " - Email field is not valid "+'\n\n';}
		if (bPass ==""){ theError += " - Password field can not be blank!"+ '\n\n';}
		if (bPass != cbPass){ theError += " - Passwords fields does not match!"+ '\n\n';}
		if (theError!="")
		{	alert("In Order To Register, Please Correct The Following Field(s):  "+'\n\n\n' + theError);
			theError ="";
			return false;
		}
		else{
			document.BirthAnounce.submit();
		}
	}
		//RANDOM STRING
		function randomString() {
			var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
			var string_length = 8;
			var randomstring = '';
			for (var i=0; i<string_length; i++) {
				var rnum = Math.floor(Math.random() * chars.length);
				randomstring += chars.substring(rnum,rnum+1);
			}
			document.randform.randomfield.value = randomstring;
		}
	
	//BOEPIE CLUB VALIDATION	
	function doBoepVal()
	{
		fName		 = document.Boepiec.fName.value;
		sName		 = document.Boepiec.sName.value;
		bTel		 = document.Boepiec.bTel.value;
		bCell		 = document.Boepiec.bCell.value;
		if (document.Boepiec.bPass){
			theEmail = document.Boepiec.bEmail.value;
			pass 	 = document.Boepiec.bPass.value;
			passc	 = document.Boepiec.bPassC.value;	
			var matchArray=theEmail.match(emailPat);
		}
		bDate		 = document.Boepiec.bDate.value;
		
		if (fName ==""){ theError += " - First name field can not be blank!"+ '\n\n';}
		if (sName ==""){ theError += " - Surname field can not be blank!"+ '\n\n';}
		if (bTel ==""){	theError += " - Telephone Home field can not be blank!"+ '\n\n';}
		if (bCell ==""){	theError += " - Cellphone field can not be blank!"+ '\n\n';}
		if (pass){
			if (pass != passc){	theError += " - Passwords fields does not match!"+ '\n\n';}
			if (pass ==""){	theError += " - Password field can not be blank!"+ '\n\n';}
			if (matchArray==null) {	theError += " - Email field is not valid "+'\n\n';}
		}
		if (theEmail ==""){	theError += " - Email field can not be blank!"+ '\n\n';}
		if (bDate =="" || bDate =="Click icon for calander"){	theError += " - Due Date field can not be blank!"+ '\n\n';}
		if (theError!="")
		{	alert("In Order To Register, Please Correct The Following Field(s):  "+'\n\n\n' + theError);
			theError ="";
			return false;
		}else{
			if (document.Boepiec.bPass != true){
				//alert("hello");
				//alert(document.getElementById('myerror'));
				makeRequest('functions/checkemail.asp', 'email');
				if (doErr){
					//alert("Second " + doErr)
					doErr = false;
					return false;
				}else{
					doErr = true;
				}
			}
		}
}

		//BOEPIE CLUB REGISTRATION CHECK EMAIL
		function checkEmail(mEmail, cField){
			var cEmail = document.controls.cName[0].value;
			//alert(mEmail);
			var matchArray=mEmail.match(emailPat);
			if (mEmail != ""){
				if (matchArray==null) {	
					cField.style.backgroundColor='#000000';	
					theError += " - Email field is not valid "+'\n\n';
				
				}else if (cField.style.backgroundColor=='#000000'){
						cField.style.backgroundColor='#FFFFFF';
					}	
			}else if (cField.style.backgroundColor=='#000000'){
						cField.style.backgroundColor='#FFFFFF';
			}	
			
			if (theError!=""){alert("Please Correct The Highlighted Field(s):  "+'\n\n\n' + theError);
			theError =""; cField.focus();return false;}
		}
				/**
 * DHTML phone number validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

// Declaring required variables
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}
function trim(s)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not a whitespace, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (c != " ") returnString += c;
    }
    return returnString;
}
function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone){
var bracket=3
strPhone=trim(strPhone)
if(strPhone.indexOf("+")>1) return false
if(strPhone.indexOf("-")!=-1)bracket=bracket+1
if(strPhone.indexOf("(")!=-1 && strPhone.indexOf("(")>bracket)return false
var brchr=strPhone.indexOf("(")
if(strPhone.indexOf("(")!=-1 && strPhone.charAt(brchr+2)!=")")return false
if(strPhone.indexOf("(")==-1 && strPhone.indexOf(")")!=-1)return false
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}


				
				function ValidateForm(){
					
					var Phone=document.getElementById("FSMS");
					//alert(Phone.value);
					//return false;
					
					if ((Phone.value==null)||(Phone.value=="")){
						alert("Please Enter your Cell Phone Number")
						Phone.focus()
						return false
					}
					//alert(Phone.value);
					/*if (checkInternationalPhone(Phone.value)==false){
						alert("Please Enter a Valid Cell Phone Number")
						Phone.value="";
						Phone.focus();
						return false
					}*/
					makeRequest('includes/BirthNumber.asp','Birth')
					return true
				 }
				function doCheck(){
					
					if (window.event.keyCode==13){
						ValidateForm();
					}
				}	

			// Display pop up for Login Details
			function doPassDiv(){
				
				/* var newElem = document.createElement("div");
				var newElem = document.createElement("div")
				newElem.id = "newDiv"
				var newText = document.createTextNode("This is the second paragraph.")
				newElem.appendChild(newText)
				document.body.appendChild(newElem)
				document.getElementById("emphasis1").childNodes[0].nodeValue = "first"
				newElem.setAttribute("id", "newDiv");	*/
			}

<!--
			//*********************************************
			//                AJAX FUNCTIONS
			//*********************************************
			
			var http_request = false;
			var Get_http_response ="";
			
            function makeRequest(url,rType) {
								//IF YOU ARE CHECKING FOR EMAIL ON BOEPIE REGS
								if(rType=="email"){
									url=url+"?Email="+ document.getElementById('bEmail').value;	
								//LOG INTO BABY BOOM	
								}else if(rType=="login") {
										url=url+"?UserID="+ document.getElementById("email").value+ "&Password="+ document.getElementById("pass").value;	
								}
								else if (rType=="Branches"){
									url=url+"?ID=" + document.getElementById("selects").value;
									//alert(url);
								}
								else if (rType=="Branches2"){
									url=url+"?ID=" + document.getElementById("selects2").value;
									//alert(url);
								}
								else if(rType=="Birth") {
									var b;
									var c;
									c = document.getElementById("FSMS").value;
									b =  url + '?Nr=' + c;
									url = encodeURI(b);
								}
								

				//alert(url);
                http_request = false;

                if (window.XMLHttpRequest) { // Mozilla, Safari,...
                    http_request = new XMLHttpRequest();
                    if (http_request.overrideMimeType) {
                        http_request.overrideMimeType('text/xml');
                    }
                } else if (window.ActiveXObject) { // IE
                    try {
                        http_request = new ActiveXObject("Msxml2.XMLHTTP");
                    } catch (e) {
                        try {
                        http_request = new ActiveXObject("Microsoft.XMLHTTP");
                        } catch (e) {}
                    }
                }
                if (!http_request) {
                    alert("Cannot create an XMLHTTP instance");
                    return false;
                }
				if(rType=="email"){
                	http_request.onreadystatechange = alertContents;
				}else  if(rType=="login"){
					http_request.onreadystatechange = alertContents2;	
				}else  if(rType=="layette"){
						http_request.onreadystatechange = doLayette;	
				}else  if(rType=="DelLayette"){
						http_request.onreadystatechange = doDelLayette;	
				}else if(rType == "DelLayette2"){
									
						
				}else if(rType=="eBoepie"){ 
						http_request.onreadystatechange = doEditDetails;	
				}
				else if (rType=="Branches" || rType=="Branches2" ){
					http_request.onreadystatechange = getBranchDetails;
				}	
				else if(rType=="Birth") {
					var counter = document.getElementById("bCount");
					if (!counter){
						http_request.onreadystatechange = doBirthNumber;
					}else{
						alert("Your Maximum number of 10 has been reached.");
					}
				}
				else if(rType=="DelBirth"){
					http_request.onreadystatechange = doBirthNumber;
				}
				else if(rType=="showRegion"){
					http_request.onreadystatechange = showRegion;
				}
				else if(rType=="showSupport"){
					http_request.onreadystatechange = showSupport;
				}
				else if(rType=="FaceVote"){
					http_request.onreadystatechange = getVoteResults;
				}				
				
				if (window.XMLHttpRequest){
					http_request.open('GET', encodeURI(url), true);		
					}else{
					http_request.open('POST', encodeURI(url), true);			
				}
				
				
                
                http_request.send(null);
            }
			
			/* ****************************************** */
			//	FACE OF BABY BOOM
			/* ****************************************** */
			var mStr = "";
			var bvoteID ; 
			var bintNum 
			var bvName 
				
			function doVote(voteID, intNum, vName){
				var img 	= document.getElementById("Main1");
				var vBut 	= document.getElementById("voteButtons");
				
				vBut.style.display="none";
				
				if (intNum ==22){
					img.src='images/votemain1_Jan01.jpg'
				}else if(intNum ==23){
					img.src='images/votemain1_Jan02.jpg'
				}else if(intNum ==24){
					img.src='images/votemain1_Jan03.jpg'
				}
				bvName = vName
				bvoteID = voteID;
				bintNum = intNum;
					var v1		= document.getElementById("LoadMain1");
				v1.style.display="inline";
				setTimeout('doFaceLoading()', 1000)
				
			}
			
			function doFaceLoading(){
				
			

				var voteName 	= document.getElementById("voteName");
				voteName.innerHTML = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>'+ bvName +'</strong>';
				self.setTimeout('doFaceLoad()', 5000)
				
			}
			
			function doFaceLoad(){
				//cal Ajax Function
				
				
				var vUrl = "includes/doFaceVote.asp?VoteID=" + bvoteID + "&VoteFor=" + bintNum;
//alert(vUrl);
				makeRequest(vUrl, 'FaceVote');	
			}
			
			
			//AJAX GET VOTE RESULT
			function getVoteResults() {
                if (http_request.readyState == 4) {
                    if (http_request.status == 200) {
					Get_http_response=http_request.responseText;
								//alert(Get_http_response)
								var map		 = document.getElementById("imgMap");
								var Loading	 = document.getElementById("LoadMain1");
								var img 	 = document.getElementById("Main1");
								Loading.style.display="none";
								img.src='images/thankyou.jpg'
								
								
								var vResult = document.getElementById("MainResult");
								var Region	= document.getElementById("region"); 
								
								Region.style.width="300px";
								
								map.style.display="none";
								Region.innerHTML = Get_http_response;
								
																
                    } else {
                        alert('There was a problem with the request.');
                    }
                }
            }
			
			
			
			// Get BRanch Details
			function showSupport() {
                if (http_request.readyState == 4) {
                    if (http_request.status == 200) {
					Get_http_response=http_request.responseText;
								if (Get_http_response=="1"){
										alert("\nYour session has expired\n\n Please log in again!\n\n");
								}else{
									if (document.getElementById('SupportG').innerHTML==""){
										document.getElementById('SupportG').innerHTML = Get_http_response;
									}else{
										document.getElementById('SupportG').innerHTML = "";
										document.getElementById('SupportG').innerHTML = "<span id=noProd><img src=images/load7.gif border=0></span>";
										document.getElementById('SupportG').innerHTML = Get_http_response;
									}
								}
                    } else {
                        alert('There was a problem with the request.');
                    }
                }
            }	
		
			// Get BRanch Details
			function showRegion() {
                if (http_request.readyState == 4) {
                    if (http_request.status == 200) {
					Get_http_response=http_request.responseText;
								if (Get_http_response=="1"){
										alert("\nYour session has expired\n\n Please log in again!\n\n");
								}else{
									if (document.getElementById('region').innerHTML==""){
										document.getElementById('region').innerHTML = Get_http_response;
									}else{
										document.getElementById('region').innerHTML = "";
										document.getElementById('region').innerHTML = "<span id=noProd><img src=images/load7.gif border=0></span>";
										document.getElementById('region').innerHTML = Get_http_response;
									}
								}
                    } else {
                        alert('There was a problem with the request.');
                    }
                }
            }		
		
			// Get BRanch Details
			function doBirthNumber() {
                if (http_request.readyState == 4) {
                    if (http_request.status == 200) {
					Get_http_response=http_request.responseText;
								if (Get_http_response=="1"){
										alert("\nYour session has expired\n\n Please log in again!\n\n");
								}else{
									if (document.getElementById('Nrs').innerHTML==""){
										document.getElementById('Nrs').innerHTML = Get_http_response;
										var counter = document.getElementById("bCount");
										if(counter){
											alert("Your Maximum number of 10 has been reached.");
										}
										document.getElementById("FSMS").value="";
										document.getElementById("FSMS").focus();
									}else{
										document.getElementById('Nrs').innerHTML = "";
										document.getElementById('Nrs').innerHTML = Get_http_response;
										var counter = document.getElementById("bCount");
										if(counter){
											alert("Your Maximum number of 10 has been reached.");
										}
										document.getElementById("FSMS").value="";
										document.getElementById("FSMS").focus();
									}
								}
                    } else {
                        alert('There was a problem with the request.');
                    }
                }
            }
			

			// Get BRanch Details
			function getBranchDetails() {
                if (http_request.readyState == 4) {
                    if (http_request.status == 200) {
					Get_http_response=http_request.responseText;
								if (Get_http_response=="1"){
										alert("\nYour session has expired\n\n Please log in again!\n\n");
								}else{
									if (document.getElementById('BranchContent').innerHTML==""){
										document.getElementById('BranchContent').innerHTML = Get_http_response;
									}else{
										document.getElementById('BranchContent').innerHTML = "";
										document.getElementById('BranchContent').innerHTML = Get_http_response;
									}
								}
                    } else {
                        alert('There was a problem with the request.');
                    }
                }
            }

			
			// Logging Into Boepie Club
			function alertContents2() {
                if (http_request.readyState == 4) {
					//alert(http_request.status);
                    if (http_request.status == 200) {
					Get_http_response=http_request.responseText;
						
								if (Get_http_response=="1"){
										alert("\nWelcome To Baby-Boom\n\n You are now Logged In!\n\n");
										document.getElementById('bLoggedIn').style.display="inline";
										document.getElementById('bLogIN').style.display="None";
										document.getElementById('LogName').innerHTML= getCookieData('Lname');
										document.getElementById('LogName2').innerHTML= getCookieData('Lname');
										document.getElementById('myMenu').style.left="200";
								}else if (Get_http_response=="0"){
										document.getElementById('noMatch').style.display="inline";
								}
                    } else {
                        alert('There was a problem with the request. Login System');
                    }
                }
            }
			
			// Edit BoepieClub details
			function doEditDetails() {

                if (http_request.readyState == 4) {
                    if (http_request.status == 200) {
					Get_http_response=http_request.responseText;
								if (Get_http_response=="1"){
										alert("\nYour session has expired\n\n Please log in again!\n\n");
								}
								/*else if (Get_http_response=="0"){
										document.getElementById('noMatch').style.display="inline";
								}else{ */
									//alert(Get_http_response);
									

									document.getElementById('MyDetails').style.display="none";
									document.getElementById('EditDetails').innerHTML = Get_http_response;
									//CALL CALANDAR FUNCTION
									$(function()
									{
										Date.format = 'mm/dd/yyyy';
										$('input.date-pick').datePicker();
										
									});
								//}
								
								//document.getElementById('layBuild').innerHTML = Get_http_response
								
                    } else {
                        alert('There was a problem with the request.');
                    }
                }
            }
			
			function showBoepDetails(){
				document.getElementById('MyDetails').style.display="inline";
				document.getElementById('EditDetails').innerHTML ="";
			}
			
			
						
			//DELETE LAYETTE ITEMS, PRODUCTS FROM PRODLIST
            function doDelLayette() {

                if (http_request.readyState == 4) {
                    if (http_request.status == 200) {
					Get_http_response=http_request.responseText;
								
								if (Get_http_response=="1"){
									
								}else if (Get_http_response=="0"){
									alert("Deleted");
								}
								//var oldElem = document.getElementById("layBuild");
								//document.body.removeChild(oldElem);
								//var newdiv = document.createElement("div");
								//newdiv.id = "layBuild";
								//document.body.appendChild(newdiv);
								document.getElementById('layBuild').innerHTML = Get_http_response
								makeRequest('functions/layette.asp', 'layette')
								//var myDiv = document.getElementById('layBuild')
								//document.body.appendChild(myDiv);
								
						//alert(Get_http_response);		
                    } else {
                        alert('There was a problem with the request.');
                    }
                }
            }


			//Remove Login Alert DIV
			function removeHelp(){
					document.getElementById('mainDiv').style.display="none";
					var newElem = document.getElementById("mainDiv");
					var newElem2 = document.getElementById("Div2");
					document.body.removeChild(newElem);
					document.body.removeChild(newElem2);
					//document.getElementById('email').style.backgroundColor="#FFFFFF";
				}
				
			function doLayHelp(){
				//alert("get here")
				 if (!document.getElementById("mainDiv")){
				 	var newElem = document.createElement("div");
				    newElem.id = "mainDiv";
					document.body.appendChild(newElem);
					var newCDiv = document.createElement("div");
					newCDiv.id = "Div2";
					document.body.appendChild(newCDiv);
					//var newText = document.createTextNode("<p>This is going to be and error</p>");
					 myHtml = "<div align=right id=whiteDiv>[ <a id=whiteLink href='javascript:removeHelp();'>Close Window<a/> ]</div> <div id='helpDiv' ><table valign='middle' width='100%' align=center cellpadding='3' cellspacing='2'>"
					 myHtml +=  "<tr>"
					 myHtml += "<td id='doHeading' align='center'  bgcolor='#FFF0FD'>HELP</td>"
					 myHtml += "</tr>"
					 myHtml +=  "<tr>"
					 myHtml += "<td align='centre'><img src='images/layette_help.jpg' border='0'></td>"
					 myHtml += "</tr>"
					 myHtml += "</table></div>"
					 
					 document.getElementById('Div2').innerHTML = myHtml;
					 //document.getElementById('email').style.backgroundColor="#ED008C";
				 	
				 }
			
			}
			
			function getBithPass(){
				
				makeRequest('functions/layette.asp', 'layette')
			}
			
			
			//Remove Login Alert DIV
			function removeForgetBirthPass(){
					document.getElementById('mainDiv2').style.display="none";
					var newElem = document.getElementById("mainDiv2");
					var newElem2 = document.getElementById("bithCDiv");
					document.body.removeChild(newElem);
					document.body.removeChild(newElem2);
					//document.getElementById('email').style.backgroundColor="#FFFFFF";
				}
				
			function doForgetBirthPass(){
				//alert("get here")
				 if (!document.getElementById("mainDiv2")){
				 	var newElem = document.createElement("div");
				    newElem.id = "mainDiv2";
					document.body.appendChild(newElem);
					var newCDiv = document.createElement("div");
					newCDiv.id = "bithCDiv";
					document.body.appendChild(newCDiv);
					//var newText = document.createTextNode("<p>This is going to be and error</p>");
					 myHtml = "<div align=right id=whiteDiv>[ <a id=whiteLink href='javascript:removeForgetBirthPass();'>Close Window<a/> ]</div> <div id='helpDiv2' ><table valign='middle' width='100%' border='0' align=center cellpadding='3' cellspacing='2'>"
					 myHtml +=  "<tr>"
					 myHtml += "<td id='doHeading' align='center'  bgcolor='#FFF0FD'>Forgot Password</td>"
					 myHtml += "</tr>"
					 myHtml +=  "<tr>"
					 myHtml += "<td align='centre' height='20'></td>"
					 myHtml += "</tr>"
					 myHtml += "</tr>"
					 myHtml +=  "<tr>"
					 myHtml += "<td align='center' id='BirthForgetContent'><b>Email:</b> <input type='text' id='TxtInput'> <input type='button' value='Send' onclick='getBithPass()' class='SubmitButton'></td>"
					 myHtml += "</tr>"
					 myHtml += "</table></div>"
					 
					 document.getElementById('bithCDiv').innerHTML = myHtml;
					 //document.getElementById('email').style.backgroundColor="#ED008C";
				 	
				 }
			
			}
			//Check if logged in when adding Layette List Items
			function doLayette() {
                if (http_request.readyState == 4) {
                    if (http_request.status == 200) {
					Get_http_response=http_request.responseText;
								//alert(Get_http_response);
								if (Get_http_response=="1"){
									document.getElementById('myerror').style.display="inline";
									document.getElementById('bEmail').style.backgroundColor="#DFF1FA";
									document.getElementById('bEmail').focus();
								}else if (Get_http_response=="0"){
								 if (!document.getElementById("errDiv")){
									 var newElem = document.createElement("div");
									 newElem.id = "errDiv";
									 var newText = document.createTextNode("<p>This is going to be and error</p>");
									 myHtml = "<div id='errDivsml'><table with='100%' cellpadding='3' cellspacing='2'>"
									 myHtml +=  "<tr>"
									 myHtml += "<td id='doHeading' align='center'>Your Are not Logged In</td>"
									 myHtml += "</tr>"
									 myHtml +=  "<tr>"
									 myHtml += "<td align='centre'>Please log in before you can add items to your layette list or <a href='boepie.asp' id='loginLink'>click here</a> to register</td>"
									 myHtml += "</tr>"
									 myHtml +=  "<tr>"
									 myHtml += "<td align='center' height='50'><a href='javascript:removeErrDiv();' id='loginLink'>Close Window</a></td>"
									 myHtml += "</tr>"
									 myHtml += "</table></div>"
									 document.body.appendChild(newElem);
									 document.getElementById('errDiv').innerHTML = myHtml;
									 document.getElementById('email').style.backgroundColor="#ED008C";
									}
								}else{
									document.getElementById('LayDiv').innerHTML= Get_http_response;			
								}
								
                    } else {
                        alert('There was a problem with the request3.');
                    }
                }
            }
			
			//Remove Login Alert DIV
			function removeErrDiv(){
					document.getElementById('errDiv').style.display="none";
					var newElem = document.getElementById("errDiv");
					document.body.removeChild(newElem);
					document.getElementById('email').style.backgroundColor="#FFFFFF";
				}
			
			//when Boepie club registration
            function alertContents() {

                if (http_request.readyState == 4) {
                    if (http_request.status == 200) {
					Get_http_response=http_request.responseText;
								if (Get_http_response=="1"){
								
								document.getElementById('myerror').style.display="inline";
								document.getElementById('bEmail').style.backgroundColor="#DFF1FA";
								document.getElementById('bEmail').focus();
								doErr = true;
								return false;
								//alert("HTTP " + Get_http_response);
								}else if (Get_http_response=="0"){
								 //return; //document.location.href="mypage.asp";
								 if (document.getElementById('myerror').style.display="inline"){
										document.getElementById('myerror').style.display="none";
										document.getElementById('bEmail').style.backgroundColor="#FFFFFF";
										doErr = false;	
									}
											
								}
                    } else {
                        alert('There was a problem with the request.');
                    }
                }
            }


			//COLLECTING COOKIE INFORMATION
			function getCookieData(labelName) {
				var labelLen = labelName.length
				// read cookie property only once for speed
				var cookieData = document.cookie
				var cLen = cookieData.length
				var i = 0
				var cEnd
				while (i < cLen) {
					var j = i + labelLen
					if (cookieData.substring(i,j) == labelName) {
						cEnd = cookieData.indexOf(";",j)
							if (cEnd == -1) {
								cEnd = cookieData.length
							}
							return unescape(cookieData.substring(j+1, cEnd))
					}
				i++
				}
				return ""
			}
// blurField method: called when username and password are blurred
function blurField()
{
	try {
		if(document.getElementById('bEmail').value != "" )
		{
			makeRequest('functions/checkemail.asp', 'email');		
		}
	}
	catch (e)
	{ } // hide bug https://bugzilla.mozilla.org/show_bug.cgi?id=236791
}
// setupLogin method: to be called on page load, sets up the login script
function setupLogin()
{
	//initLightbox();
	forgotLInk	= document.getElementById('ForgotLink');
	bEmail 		= document.getElementById('bEmail');
	myBranch	= document.getElementById('selects');
	myNr		= document.getElementById('Nrs');
	//SupportG	= document.getElementById('SupportG');
		
		
		
	//if (SupportG){
	//	makeRequest('includes/getSupport.asp?ID=A', 'showSupport');
	//}
	if (myBranch){
		makeRequest('includes/getAjaxBranches.asp', 'Branches');
	}
	if (bEmail){
		//addEvent(bEmail, 'focus', focusField);	
		addEvent(bEmail, 'blur', blurField);	
	}
	if (myNr){
		//addEvent(bEmail, 'focus', focusField);	
		makeRequest('includes/BirthNumber.asp', 'Birth');	
	}
	if (forgotLInk){
		initLightbox();
	}
	
	
}
// function to add events to the page in a cross-browser manner
function addEvent(objObject, strEventName, fnHandler) { 
	// DOM-compliant way to add an event listener 
 	if (objObject.addEventListener) {
		objObject.addEventListener(strEventName, fnHandler, false); 
	}
	// IE/windows way to add an event listener 
	else if (objObject.attachEvent) {
		objObject.attachEvent('on' + strEventName, fnHandler); 
	}
}

addEvent(window,'load',setupLogin);

