var hostname=top.location.host;
var scheme=("https:"==document.location.protocol)?"https://":"http://";
function showSearchChoices(){if(document.getElementById("searchTypes").style.visibility=="hidden"||document.getElementById("searchTypes").style.visibility==""){document.getElementById("searchTypes").style.visibility="visible";
document.getElementById("magnifyingGlass").src=scheme+hostname+"/images/s2.png"
}if(document.getElementById("searchType").value==""){document.getElementById("searchArrow").src=scheme+hostname+"/images/d2.png"
}else{document.getElementById("searchArrow").src=scheme+hostname+"/images/r2.png"
}}function freeze(C,A,B){C.style.backgroundColor="#C7B377";
document.getElementById(A).style.backgroundColor="#FFFFFF";
document.getElementById("searchType").value=B;
document.getElementById("searchArrow").src=scheme+hostname+"/images/r2.png";
document.getElementById("keywords").focus()
}function settleSearch(){if(document.getElementById("keywords").value==""){document.getElementById("searchArrow").src=scheme+hostname+"/images/r1.png";
document.getElementById("magnifyingGlass").src=scheme+hostname+"/images/s1.png";
document.getElementById("searchTypes").style.visibility="hidden"
}}function submitSearch(){if(document.getElementById("searchType").value=="google"||document.getElementById("searchType").value==""){googleSearch(document.getElementById("keywords").value);
return false
}if(document.getElementById("searchType").value=="general"){var A=document.getElementById("search");
A.action="http://"+hostname+"/search";
A.submit()
}}function showLayer(B,A){for(i=1;
i<=A;
i++){document.getElementById("level"+i).style.visibility="hidden"
}document.getElementById(B).style.visibility="visible"
}function submitListing(A){document.forms[2].submitVal.value=A;
if((document.forms[2].orgCategory.value=="*")){alert("Please select a category.");
return false
}document.forms[2].submit()
}function setValue(){document.getElementById("fieldValue").value=document.getElementById("fieldName").value
}function confirmSubmit(A){if(confirm(A)){var B=document.getElementById("fieldName");
B.options[B.selectedIndex].value=B.options[B.selectedIndex].text;
document.getElementById("utilities").submit()
}}function validateDate(E){var C=E.split("/");
var D=C[0];
var A=C[1];
var B=C[2];
if(isNaN(D)||isNaN(A)||isNaN(B)){alert("bad numbers");
return false
}if(D<1||D>12){alert("bad month");
return false
}if(A<1||A>31){alert("bad day");
return false
}if(D==2&&A>29&&(B%4==0)){alert("not leap year");
return false
}if(((parseInt(D,10)!=1)&&(parseInt(D,10)!=3)&&(parseInt(D,10)!=5)&&(parseInt(D,10)!=7)&&(parseInt(D,10)!=8)&&(parseInt(D)!=10)&&(parseInt(D)!=12))&&parseInt(A)>30){alert("no such day of month");
return false
}return true
}function validateEmail(A){if(A.value==""){alert("email cannot be blank.");
return false
}if(A.indexOf("@")<0){alert("Email "+A+" must contain the '@' character.\n");
return false
}if(A.indexOf("@")==0){alert("Email  "+A+" cannot start with the '@' character.\n");
return false
}if(A.indexOf("@")!=A.lastIndexOf("@")){alert("Email address "+A+" cannot have more than one '@' character.\n");
return false
}if(A.indexOf(" ")>=0){alert("Email address "+A+" cannot contain a space.\n");
return false
}if(A.lastIndexOf(".")<A.lastIndexOf("@")){alert("Email address "+A+" must contain a domain suffix (i.e. abc@xyz.com)\n");
return false
}if(A.lastIndexOf("@")==(A.length-1)){alert("Email address"+A+" cannot end with the '@'character.\n");
return false
}if(A.lastIndexOf(".")==(A.length-1)){alert("Email address"+A+" cannot end with the '.'character.\n");
return false
}return true
}function validateForm(A){email=A.contactEmail.value;
orgName=A.orgName.value;
orgDescription=A.orgDescription.value;
orgState=A.orgState.value;
orgZip=A.orgZip.value;
orgPhone=A.orgPhone.value;
orgFax=A.orgFax.value;
orgEmail=A.orgEmail.value;
orgURL=A.orgURL.value;
randomText=A.randomText.value;
category=A.category.value;
if(A.newCategory!=undefined){newCategory=A.newCategory.value
}email=email.replace("'","'");
orgName=orgName.replace("'","'");
orgDescription=orgDescription.replace("'","'");
orgState=orgState.replace("'","'");
orgZip=orgZip.replace("'","'");
orgPhone=orgPhone.replace("'","'");
orgFax=orgFax.replace("'","'");
orgEmail=orgEmail.replace("'","'");
orgURL=orgURL.replace("'","'");
if(orgName==""){alert("Organization Name cannot be blank.\n");
return false
}if(!validateEmail(email)){return false
}if(orgDescription==""){alert("Organization Description cannot be blank.\n");
return false
}if(orgState=="*"){alert("You must pick a state.\n");
return false
}if(orgZip!=""){for(i=0;
i<=4;
i++){if(!isDigit(orgZip.charAt(i))){alert("Zipcode must be numeric.\n");
return false
}}}if(randomText==""){alert("security code cannot be empty.");
return false
}if(randomText.length!=6){alert("Please enter valid length for the security code.");
return false
}if(orgPhone!=""){for(i=0;
i<=11;
i++){if(i==3||i==7){if(orgPhone.charAt(i)!="-"){alert("Please user format '999-999-9999' for phone.");
return false
}}else{if(!isDigit(orgPhone.charAt(i))){alert("Please user format '999-999-9999' for phone.");
return false
}}}}if(orgFax!=""){for(i=0;
i<=11;
i++){if(i==3||i==7){if(orgFax.charAt(i)!="-"){alert("Please user format '999-999-9999' for fax.");
return false
}}else{if(!isDigit(orgFax.charAt(i))){alert("Please user format '999-999-9999' for fax.");
return false
}}}}if(orgEmail!=""){if(!validateEmail(orgEmail)){return false
}}if(category=="*"){alert("You must pick a category or recommend a new one.\n");
return false
}if(category=="new"){if(newCategory==""){alert("The category recommendation cannot be empty.\n");
return false
}}A.submit()
}function isDigit(B){if(B.length>1){return false
}var A="1234567890";
if(A.indexOf(B)!=-1){return true
}else{return false
}}function checkForNewCategory(A){if(A=="new"){document.getElementById("newCategory").style.display="block";
document.getElementById("newCategoryLabel").style.display="block"
}else{document.getElementById("newCategory").style.display="none";
document.getElementById("newCategoryLabel").style.display="none"
}}function logStatistic(C){var B=false;
if(window.XMLHttpRequest){B=new XMLHttpRequest();
if(B.overrideMimeType){B.overrideMimeType("text/xml")
}}else{if(window.ActiveXObject){try{B=new ActiveXObject("Msxml2.XMLHTTP")
}catch(D){try{B=new ActiveXObject("Microsoft.XMLHTTP")
}catch(D){}}}}if(!B){alert("Giving up :( Cannot create an XMLHTTP instance");
return false
}B.onreadystatechange=function(){return 
};
var A=top.location.host;
if(A.indexOf("minoritydirectory")==-1){A=A+"/minoritydirectory"
}C=C.replace("&","%26");
var E="http://"+A+"/logStatistic?url="+C;
B.open("GET",E,true);
B.send(null)
}function validateContactForm(A){if(validateEmail(A.email.value)){A.submit()
}}function validateUpdateForm(A){if(validateEmail(A.email.value)){if(document.getElementById("idKey").value==""){alert("The ID Key cannot be blank.\n");
return false
}A.submit()
}}$("a[title]").qtip({position:{corner:{target:"topRight",tooltip:"bottomLeft"}},style:{width:200,padding:5,background:"#B8896A",color:"black",textAlign:"center",border:{width:5,radius:3,color:"#916C54"},tip:{corner:"bottomLeft"}}});
if(hostname.indexOf("minoritydirectory")==-1){hostname=hostname+"/minoritydirectory"
}var aTags=document.getElementsByTagName("a");
if(aTags){for(i=0;
i<aTags.length;
i++){if(aTags[i].href.indexOf(hostname)==-1){aTags[i].target="_blank"
}aTags[i].onclick=function(B){var A;
if(!B){var B=window.event
}if(B.target){A=B.target
}else{if(B.srcElement){A=B.srcElement
}}if(A.nodeType==3){A=A.parentNode
}if(A.href.indexOf("www.nmsdc.org/nmsdc")==-1&&A.href.indexOf("www.wbenc.org")==-1&&A.href.indexOf("www.dotcr.ost.dot.gov")==-1&&A.href.indexOf("www.sba.gov")==-1&&A.href.indexOf("maps.google.com")==-1&&A.href!="http://"+hostname&&A.href!="http://"+hostname+"/"&&A.href!=("http://"+hostname+"/listing")&&A.href!=("http://"+hostname+"/update")&&A.href!=("http://"+hostname+"/contact")&&A.href!=("http://"+hostname+"?whichMenu=stateMenu")&&A.href!=("http://"+hostname+"?whichMenu=categoryMenu")&&A.href!=("http://"+hostname+"/?whichMenu=stateMenu")&&A.href!=("http://"+hostname+"/?whichMenu=categoryMenu")&&A.href.indexOf("?page=")==-1){logStatistic(A.href)
}};
if(aTags[i].captureEvents){aTags[i].captureEvents(Event.CLICK)
}}};