function openPictureWindow_Fever(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop) {  // v4.01
	var imageWidth2 = 700;	
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><head>'); 
	newWindow.document.write('<meta http-equiv="imagetoolbar" content="no">'); 
	newWindow.document.write('<title>'+alt+'</title>'); 
	newWindow.document.write('<script language="JavaScript">');
	newWindow.document.write('var message="Function Disabled!";');
	newWindow.document.write('function clickIE() {if (document.all) {alert(message);return false;}}');
	newWindow.document.write('function clickNS(e) {if ');
	newWindow.document.write('(document.layers||(document.getElementById&&!document.all)) {');
	newWindow.document.write('if (e.which==2||e.which==3) {alert(message);return false;}}}');
	newWindow.document.write('if (document.layers) ');
	newWindow.document.write('{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}');
	newWindow.document.write('else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}');
	newWindow.document.write('document.oncontextmenu=new Function("return false")');
	newWindow.document.write('</script>');
	newWindow.document.write('</head>'); 
	newWindow.document.write('<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' alt=\"'+alt+'\">');
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->

var message="Function Disabled!";
///////////////////////////////////
function clickIE() {if (document.all) {alert(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {alert(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")

<!-- ############################################################################### -->
<!-- ############################################################################### -->

//** Featured Content Slider script- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
//** Last updated: Oct 28th, 06

////Ajax related settings
var csbustcachevar=0 //bust potential caching of external pages after initial Ajax request? (1=yes, 0=no)
var csloadstatustext="<img src='loading.gif' /> Requesting content..." //HTML to indicate Ajax page is being fetched
var csexternalfiles=[] //External .css or .js files to load to style the external content(s), if any. Separate multiple files with comma ie: ["cat.css", dog.js"]

////NO NEED TO EDIT BELOW////////////////////////
var enablepersist=true
var slidernodes=new Object() //Object array to store references to each content slider's DIV containers (<div class="contentdiv">)
var csloadedobjects="" //Variable to store file names of .js/.css files already loaded (if Ajax is used)

function ContentSlider(sliderid, autorun){
var slider=document.getElementById(sliderid)
slidernodes[sliderid]=[] //Array to store references to this content slider's DIV containers (<div class="contentdiv">)
ContentSlider.loadobjects(csexternalfiles) //Load external .js and .css files, if any
var alldivs=slider.getElementsByTagName("div")
for (var i=0; i<alldivs.length; i++){
if (alldivs[i].className=="contentdiv"){
slidernodes[sliderid].push(alldivs[i]) //add this DIV reference to array
if (typeof alldivs[i].getAttribute("rel")=="string") //If get this DIV's content via Ajax (rel attr contains path to external page)
ContentSlider.ajaxpage(alldivs[i].getAttribute("rel"), alldivs[i])
}
}
ContentSlider.buildpagination(sliderid)
var loadfirstcontent=true
if (enablepersist && getCookie(sliderid)!=""){ //if enablepersist is true and cookie contains corresponding value for slider
var cookieval=getCookie(sliderid).split(":") //process cookie value ([sliderid, int_pagenumber (div content to jump to)]
if (document.getElementById(cookieval[0])!=null && typeof slidernodes[sliderid][cookieval[1]]!="undefined"){ //check cookie value for validity
ContentSlider.turnpage(cookieval[0], parseInt(cookieval[1])) //restore content slider's last shown DIV
loadfirstcontent=false
}
}
if (loadfirstcontent==true) //if enablepersist is false, or cookie value doesn't contain valid value for some reason (ie: user modified the structure of the HTML)
ContentSlider.turnpage(sliderid, 0) //Display first DIV within slider
if (typeof autorun=="number" && autorun>0) //if autorun parameter (int_miliseconds) is defined, fire auto run sequence
window[sliderid+"timer"]=setTimeout(function(){ContentSlider.autoturnpage(sliderid, autorun)}, autorun)
}

ContentSlider.buildpagination=function(sliderid){
var paginatediv=document.getElementById("paginate-"+sliderid) //reference corresponding pagination DIV for slider
var pcontent=""
for (var i=0; i<slidernodes[sliderid].length; i++) //For each DIV within slider, generate a pagination link
pcontent+='<a href="#" onClick=\"ContentSlider.turnpage(\''+sliderid+'\', '+i+'); return false\">'+(i+1)+'</a> '
pcontent+='<a href="#" style="font-weight: bold;" onClick=\"ContentSlider.turnpage(\''+sliderid+'\', parseInt(this.getAttribute(\'rel\'))); return false\">Next</a>'
paginatediv.innerHTML=pcontent
paginatediv.onclick=function(){ //cancel auto run sequence (if defined) when user clicks on pagination DIV
if (typeof window[sliderid+"timer"]!="undefined")
clearTimeout(window[sliderid+"timer"])
}
}

ContentSlider.turnpage=function(sliderid, thepage){
var paginatelinks=document.getElementById("paginate-"+sliderid).getElementsByTagName("a") //gather pagination links
for (var i=0; i<slidernodes[sliderid].length; i++){ //For each DIV within slider
paginatelinks[i].className="" //empty corresponding pagination link's class name
slidernodes[sliderid][i].style.display="none" //hide DIV
}
paginatelinks[thepage].className="selected" //for selected DIV, set corresponding pagination link's class name
slidernodes[sliderid][thepage].style.display="block" //show selected DIV
//Set "Next" pagination link's (last link within pagination DIV) "rel" attribute to the next DIV number to show
paginatelinks[paginatelinks.length-1].setAttribute("rel", thenextpage=(thepage<paginatelinks.length-2)? thepage+1 : 0)
if (enablepersist)
setCookie(sliderid, sliderid+":"+thepage)
}

ContentSlider.autoturnpage=function(sliderid, autorunperiod){
var paginatelinks=document.getElementById("paginate-"+sliderid).getElementsByTagName("a") //Get pagination links
var nextpagenumber=parseInt(paginatelinks[paginatelinks.length-1].getAttribute("rel")) //Get page number of next DIV to show
ContentSlider.turnpage(sliderid, nextpagenumber) //Show that DIV
window[sliderid+"timer"]=setTimeout(function(){ContentSlider.autoturnpage(sliderid, autorunperiod)}, autorunperiod)
}

function getCookie(Name){ 
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return ""
}

function setCookie(name, value){
document.cookie = name+"="+value
}

////////////////Ajax Related functions //////////////////////////////////

ContentSlider.ajaxpage=function(url, thediv){
var page_request = false
var bustcacheparameter=""
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
thediv.innerHTML=csloadstatustext
page_request.onreadystatechange=function(){
ContentSlider.loadpage(page_request, thediv)
}
if (csbustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}

ContentSlider.loadpage=function(page_request, thediv){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
thediv.innerHTML=page_request.responseText
}

ContentSlider.loadobjects=function(externalfiles){ //function to load external .js and .css files. Parameter accepts a list of external files to load (array)
for (var i=0; i<externalfiles.length; i++){
var file=externalfiles[i]
var fileref=""
if (csloadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
csloadedobjects+=file+" " //Remember this object as being already added to page
}
}
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->

var emailgood=true;
var verifygood=true;
var phonegood=true;
var zipcodegood=true;
var otherfieldsgood=true;
var securitygood=true;
var invalidemail = "Invalid Email Address";
var invalidverify = "Failed Email Verification";
var invalidphone = "Invalid Phone Number";
var invalidzipcode = "Invalid Zip Code";
var invalidentry = "Complete Required Item";
var invalidsecurity = "Invalid Security Code";
var errormessage = "Please Fix Error Indicated Above";
var errorcount = 0;

<!-- ############################################################################### -->
<!-- ############################################################################### -->

function checkemail(eemail,vemail){

   var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i

   eemail.value = eemail.value.toLowerCase();
   vemail.value = vemail.value.toLowerCase();
   
   if (filter.test(eemail.value))
   {
      emailgood=true;
      clearErrorMessage('emessage');
      
      if (vemail.value != "")
      {
      	  verifyemail(eemail,vemail);
      }
   }
   else
   {
      submitErrorMessage('emessage',invalidemail);
      emailgood=false;
   }
    return (emailgood);
}

<!-- ############################################################################### -->

function verifyemail(eemail,vemail)
{
   var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i

   eemail.value = eemail.value.toLowerCase();
   vemail.value = vemail.value.toLowerCase();

   if (filter.test(vemail.value))
   {
	    if (eemail.value == vemail.value)
	    {
         verifygood=true;
         clearErrorMessage('vmessage');
	    }
	    else
	  	{
         submitErrorMessage('vmessage',invalidverify);
         verifygood=false;
	    }
	 }
	 else
	 {
      submitErrorMessage('vmessage',invalidemail);
      emailgood=false;
	 }
   return (verifygood);
}

<!-- ############################################################################### -->

function checkPhone(phone)
{
   var filter = /^\s*\(?\d{3}\)?[\-\ ]?\d{3}[\-\ ]?\d{4}\s*$/;
   var phoneLn = phone.value.length;
   var phoneDigit;
   var phoneString ="";
   var app =  document.getElementById("contactApp");
  
   if (filter.test(phone.value))
   {
      phonegood=true;
      clearErrorMessage('pmessage');
      
      for (var i=0; i<phoneLn; i++)
      {
      	 phoneDigit = parseInt(phone.value.substr(i,1));

         if (phoneDigit <= 9)      	 
         {
      	 	  phoneString += phoneDigit.toString();
      	 } 
      }
      
      app.phone.value = "(" + phoneString.substr(0,3) + ") " + phoneString.substr(3,3) + "-" + phoneString.substr(6,4);
   }
   else
   {
      submitErrorMessage('pmessage',invalidphone);
      phonegood=false;
   }
    return (phonegood);
}

<!-- ############################################################################### -->

function checkZipCode(zipcode)
{
   var filter = /^\d{5}(\-\d{4})?$/;

   if (filter.test(zipcode.value))
   {
      zipcodegood=true;
      clearErrorMessage('zmessage');
   }
   else
   {
      submitErrorMessage('zmessage',invalidzipcode);
      zipcodegood=false;
   }
    return (zipcodegood);
}

<!-- ############################################################################### -->

function clearErrorMessage(messageArea)
{
	document.getElementById(messageArea).innerHTML= "";

  if ((emailgood) && (verifygood) && (phonegood) && (zipcodegood) && (otherfieldsgood) && (securitygood)) 
  {
  	  document.getElementById('erroralert').innerHTML= ""; 
  }
  
  return;
}

<!-- ############################################################################### -->

function submitErrorMessage(messageArea,message)
{
     document.getElementById(messageArea).innerHTML= message;
     document.getElementById(messageArea).style.color="red";

     document.getElementById('erroralert').innerHTML= errormessage;
     document.getElementById('erroralert').style.color="red";

  return;
}

<!-- ############################################################################### -->

var xmlhttp=false;
var pageResponse=null;
var rootdomain="http://"+window.location.hostname;

function checkSecurity(s_code)
{
	    var security_code = s_code.value;
	    
      xmlhttp=GetXmlHttpObject();
      if (xmlhttp==null) {alert ("Browser does not support HTTP Request"); return; }	
      xmlhttp.open('get', rootdomain+'/phpClasses/Mel_Security.php?security_code='+security_code, true);
   
      xmlhttp.onreadystatechange = function (){
   	     if (xmlhttp.readyState == 4) 
         {
            if (xmlhttp.status == 200) 
            {
               security = xmlhttp.responseText; 

               if (security == 1)
               {
                  securitygood=true;
                  clearErrorMessage('securitym');
               }
               else
               {
                  submitErrorMessage('securitym',invalidsecurity);
                  securitygood=false;
               }
            }
         }
    	};

      xmlhttp.send(null);	

      return(securitygood);
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->

function checkContactOtherFields()
{
   var app =  document.getElementById("contactApp");
   
   otherfieldsgood=true;
   
   if (app.firstname.value =="")    {otherfieldsgood=false; submitErrorMessage('firstnamem',invalidentry);}  else {clearErrorMessage('firstnamem');}
   if (app.lastname.value =="")     {otherfieldsgood=false; submitErrorMessage('lastnamem',invalidentry);}   else {clearErrorMessage('lastnamem');}
   if (app.email.value =="")        {otherfieldsgood=false; submitErrorMessage('emessage',invalidentry);}    else {checkemail(app.email,app.emailverify);}
   if (app.emailverify.value =="")  {otherfieldsgood=false; submitErrorMessage('vmessage',invalidentry);}    else {verifyemail(app.email,app.emailverify);}
   if (app.phone.value =="")        {otherfieldsgood=false; submitErrorMessage('pmessage',invalidentry);}    else {checkPhone(app.phone);}
   if (app.address.value =="")      {otherfieldsgood=false; submitErrorMessage('addressm',invalidentry);}    else {clearErrorMessage('addressm');}
   if (app.city.value =="")         {otherfieldsgood=false; submitErrorMessage('citym',invalidentry);}       else {clearErrorMessage('citym');}
   if (app.state.value =="")        {otherfieldsgood=false; submitErrorMessage('statem',invalidentry);}      else {clearErrorMessage('statem');}
   if (app.zipcode.value =="")      {otherfieldsgood=false; submitErrorMessage('zmessage',invalidentry);}    else {checkZipCode(app.zipcode);}
   if (app.country.value =="")      {otherfieldsgood=false; submitErrorMessage('countrym',invalidentry);}    else {clearErrorMessage('countrym');}
   if (app.source.value =="")       {otherfieldsgood=false; submitErrorMessage('sourcem',invalidentry);}     else {clearErrorMessage('sourcem');}
   if (app.contact.value =="")      {otherfieldsgood=false; submitErrorMessage('contactm',invalidentry);}    else {clearErrorMessage('contactm');}
   if (app.security_code.value ==""){otherfieldsgood=false; submitErrorMessage('securitym',invalidentry);}   else {checkSecurity(app.security_code);}

}

<!-- ############################################################################### -->

var goodSubmit;
function confirmContactSubmit()
{
	//idform = document.modelapp;
	
	checkContactOtherFields();

  if ((emailgood) && (verifygood) && (phonegood) && (zipcodegood) && (otherfieldsgood) && (securitygood)) 
	{
	   goodSubmit=true;
     //idform.submit();
	}
	else
	{
		 goodSubmit=false;
	}
  return goodSubmit;
}

<!-- ############################################################################### -->

function confirmSubmit()
{
	
	   goodSubmit=true;

  return goodSubmit;
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->

function opn(link, theHeight, theWidth,type)
{
      open(link, type,'toolbar=no,height=' + theHeight + ',width=' + theWidth + ',directories=no,status=no,scrollbars=no,resize=no,menubar=no');
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->

function shortCut(ddl)
{
   if(ddl == null){return;}
	 
	 if(!ddl.selectedIndex && !(ddl.selectedIndex > 0)){return;}
	 
	 var selectedVal = ddl.options[ddl.selectedIndex].value.toLowerCase();
   var sTargetUrl  = '';                      
   
   switch(selectedVal)
   {   
      case 'home':           sTargetUrl = 'http://www.mel-inc.org'; break;                                
      case 'aboutus':        sTargetUrl = 'http://www.mel-inc.org/AboutUs.php'; break;                                
      case 'campinfo':       sTargetUrl = 'http://www.mel-inc.org/Camp.php'; break;                                
      case 'ourmentoring':   sTargetUrl = 'http://www.mel-inc.org/Mentoring.php'; break;                                
      case 'mentortraining': sTargetUrl = 'javascript:;'; break;                                
      case 'seminars':       sTargetUrl = 'javascript:;'; break;                                
      case 'newsletter':     sTargetUrl = 'javascript:;'; break;                                
      case 'contact':        sTargetUrl = 'http://www.mel-inc.org/Contact.php'; break;                                
      default:
   } 

	location.href = sTargetUrl;
}

<!-- ############################################################################### -->

function GetXmlHttpObject()
{

//Try to set up an IE XMLHTTP Request Object
 try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (error) {
try {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (error) {
      xmlhttp = false;
}
}
//Try to set up Mozilla and Safari XMLHTTP Request Object
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
      try {
            xmlhttp = new XMLHttpRequest();
      } catch (error) {
            xmlhttp=false;
      }
}
//Try to set up IceBrowser XMLHTTP Request Object
if (!xmlhttp && window.createRequest) {
      try {
            xmlhttp = window.createRequest();
      } catch (error) {
            xmlhttp=false;
      }
}
  
   return xmlhttp;
}

<!-- ############################################################################### -->

function textCounter(field, countfield, maxlimit) 
{
   if (field.value.length > maxlimit)
   {
      field.value = field.value.substring(0, maxlimit);
   }
   else 
   {
      countfield.value = maxlimit - field.value.length;
   }
}

<!-- ############################################################################### -->


function setVideoLink(videolink)
{
  var setMoreLink;
      
   ajaxpage(rootdomain+'/VideoPages/VideoPage.php?vlink='+videolink+'&auto=true', 'videoArea');

   setMoreLink = "Video Comments <a href=\'javascript:ViewAddComment(%27"+videolink+"%27,1)\'>[Post A Comment]</a>";
   document.getElementById('videoCommentAddText').innerHTML= setMoreLink;
   
   ViewAddComment(videolink, 0);
   GetTotalCommentCount(videolink);
}

<!-- ############################################################################### -->

function setPreview(playlist,pageNum)
{
   ajaxpage(rootdomain+'/VideoPages/BuildSingleVideo.php?rowNav='+pageNum+'&plist='+playlist, 'videoPreviewArea');
}

<!-- ############################################################################### -->

function addComment(videolink)
{

	 var app =  document.getElementById("addcomment");
	 var username = app.username.value;
	 var comments = app.comments.value;
	  
	 if (comments == "")
	 {
      ViewAddComment(videolink, 0)
      return;
	 }

   xmlhttp=GetXmlHttpObject();
	 if (xmlhttp==null) {alert ("Browser does not support HTTP Request"); return; }

   xmlhttp.open('get', rootdomain+'/Comments/AddComment.php?vlink='+videolink+'&username='+username+'&comments='+comments, false);
   xmlhttp.onreadystatechange = function (){
	    if (xmlhttp.readyState == 4) 
      {
         if (xmlhttp.status == 200) 
         {
            ViewAddComment(videolink, 0);
         }
      }
   };
   
   xmlhttp.send(null);
}

<!-- #################### -->

function ViewAddComment(videolink, comType)
{
   ajaxpage(rootdomain+'/Comments/VideoComments.php?vlink='+videolink+'&cbox='+comType, 'commentAreaWrap');
}

<!-- #################### -->

function GetTotalCommentCount(videolink)
{
   ajaxpage(rootdomain+'/Comments/VideoCommentsCount.php?vlink='+videolink, 'videoCommentTotalText');
}

<!-- ############################################################################### -->

function setPlaylist(playlist)
{
	var playlistType;
	var playlistVideo;
	
	var selectobj=document.getElementById? document.getElementById(playlist) : ""
  if (selectobj!="" && selectobj.options[selectobj.selectedIndex].value!="")
  {
     playlistType = selectobj.options[selectobj.selectedIndex].value;
  
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null) {alert ("Browser does not support HTTP Request"); return; }
	 
      xmlhttp.open('get', rootdomain+'/VideoPages/GetPlayListVideo.php?plist='+playlistType, false);
      xmlhttp.onreadystatechange = function (){
   	     if (xmlhttp.readyState == 4) 
         {
            if (xmlhttp.status == 200) 
            {
              playlistVideo = xmlhttp.responseText; 
              setVideoLink(playlistVideo);
              setPreview(playlistType,0);
            }
         }
    	};
   
   xmlhttp.send(null);
  }

}