//Local Javascript Functions
function biz_quickjump(business_id) {
   var jumpto= '/biz_list2.asp?sub=biz_listing2&business_id='+business_id;
   if (business_id !='') location.href=jumpto;
}

function bizcatmap_quickjump(bus_category_cd) {
   var jumpto= '/campus_map2.asp?sub=map&bus_category_cd='+bus_category_cd;
   if (bus_category_cd !='') location.href=jumpto;
}

function emailFriend() { 
var href =  (escape(window.location.href));
//alert (href);
emailWindow = 
window.open('http://thesaver.com/email_friend.asp?geturl=' + href, 
'emailWin', 
'top=30,screeny=30,left=30,screenx=30,width=620,height=600,resizable=yes,scrollbars=no'); 
emailWindow.focus();
 }


//Security
function validategetpass(strForm) {
//validate appropriate fields for password lookup
    var	user_id = trimAll(document[strForm].user_id.value)

    //check that email is valid
    if (!validateNotEmpty(user_id)) {
    			alert ('Please Enter Your User ID. Thanks.')
    			document[strForm].user_id.focus();
    			return false;
    		}
    /*
    if (validateNotEmpty(currEmail)) {
    		if (isEmail(currEmail)== false) {
    		
    			alert ('The Email Address Has An Invalid Format. Please Try Again')
    			document[strForm].user_id.focus();
    			return false;
    		}
    	}	
    */

    document[strForm].blngetpass.value='1'; //turn on the password lookupfield
    document[strForm].submit();
    return true;
}

function validatelogin(strForm) {
var	user_id = trimAll(document[strForm].user_id.value)
var	password = trimAll(document[strForm].password.value)


//check that email is valid
if (!validateNotEmpty(user_id)) {
			alert ('Please Enter A User ID. Thanks.')
			document[strForm].user_id.focus();
			return false;
		}


//check that password is OK
if (!validateNotEmpty(password)) {
			alert ('Please Enter A Password. Thanks.')
			document[strForm].password.focus();
			return false;
		}
		
//ensure password is 6 to 15 characters
		var strLen = password.length;
		if (strLen < 6 || strLen > 15) {
		  alert ('Password Must be Between 6 and 15 Characters.');
		  document[strForm].password.focus();
			return false;
		}
		 
document[strForm].submit();
}//end Validator





function img_act(imgName) {
     if (document.images) {
             imgOn = eval(imgName + "on.src");
             document [imgName].src = imgOn;
     }
}

function img_inact(imgName) {
     if (document.images) {
             imgOff = eval(imgName + "off.src");
             document [imgName].src = imgOff;
     }
}

function downloadSaver(url){
  //called when 
  if (url=='') { alert ('Sorry, No Downloadable Saver Available at This Time.');
    } else {
    
        if (confirm("You Are About to Download The Entire Saver in PDF Format. \nTo Continue Click [Ok], to View Specific Ads Online Click [Cancel] and go to The Browse by Business Section.")) {
            alert ("You Have Selected to Continue With The Download.\n This Will Open in a Seperate Window So You Can Continue Browsing.");
          var page2call = url;
 	        objWin = window.open(page2call, 'PDF_Saver', 'width=640,height=550,scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes');
	        objWin.focus();
        }
        else {
          alert ("OK, The Download Has Been Cancelled.");
        return false;
           }   
          
	  }
}
function no_dsplyAddress(){
alert ('Sorry, No Business Address to Map at This Time.');
}	 

function dsplyWebSite(url){
  //called when 
  if (url=='') { alert ('Sorry, No Web Site to Display at This Time.');
    } else {
        var page2call = url;
 	      objWin = window.open(page2call, 'Co_Web', 'width=640,height=550,scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes');
	      objWin.focus();
	  }
}	 

function dsplyPDF_Ad(url){
  //called when 
  if (url=='') { alert ('Sorry, No PDF Ad Available to Display at This Time.');
    } else {
        var page2call = url;
        //var page2call = 'http://thesaver.com/pdfs/'+filename;
 	      objWin = window.open(page2call, 'PDF_AD', 'width=640,height=550,scrollbars=yes,resizable=yes,toolbar=yes,menubar=no');
	      objWin.focus();
	  }
}	  
	  
function dsplyHTML_Ad(blob_id){
  //called when 
  if (blob_id=='') { alert ('Sorry, No HTML Ad Available to Display at This Time.');
    } else {
        var page2call = 'http://thesaver.com/f_/f_preview.asp?usecss=1&b_id='+blob_id;
 	      objWin = window.open(page2call, 'HTML_AD', 'width=640,height=550,scrollbars=yes,resizable=yes,toolbar=yes,menubar=no');
	      objWin.focus();
	  }
}	  
function dsplyJPG_Ad(url){
  //called when 
  if (url=='') { alert ('Sorry, No Ad Available To Display At This Time.');
    } else {
        var page2call = url;
        //var page2call = 'http://thesaver.com/images/jpgs/'+jpg_file;
 	      objWin = window.open(page2call, 'JPG_AD', 'width=640,height=550,scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes');
	      objWin.focus();
	  }
}	  
function dsplyItinerary(event_id){
  //called when 
  var page2call = '/content/c_event_itin.asp?id='+event_id;
 	objWin = window.open(page2call, 'Itinerary', 'width=600,height=500,scrollbars=yes,resizable=yes,toolbar=yes,menubar=no');
	objWin.focus();
	}
	
function dsplyDirections(event_id){
  //called when 
  var page2call = '/content/c_event_directions.asp?id='+event_id;
 	objWin = window.open(page2call, 'Directions', 'width=600,height=500,scrollbars=yes,resizable=yes,toolbar=yes,menubar=no');
	objWin.focus();
	}	
function dsplyEvent_Reminder(event_id){
  //called when 
  
  //var page2call = '/content/event_reminder.asp?id='+event_id;
  
  //objWin = window.open(page2call, 'Reminder', 'width=10,height=10,scrollbars=no,resizable=no,toolbar=no,menubar=no'); 
	//objWin.focus();
	
	location.href = '/content/event_reminder.asp?id='+event_id;
}

function dsplyEvent_Reminder_pop(event_id){
  //called when 
  var pop_page2call = '/content/event_reminder_pop.asp?id='+event_id;
  
  //open pop up window with instructions
 	objWin_pop = window.open(pop_page2call, 'Event_Reminder', 'width=250,height=175,scrollbars=no,resizable=yes,toolbar=no,menubar=no');
  
	objWin_pop.focus();
}		
//Mary Lou Cerami Functions


 var BrowserOK = parseFloat(navigator.appVersion) >= 3.5;
 function MouseOverInfo(on,off,alt) {
  if (BrowserOK) {
   this.on = new Image();
   this.off = new Image();
   this.alt = alt;
   this.on.src = on;
   this.off.src = off;
   }
  }
 function MouseEvent(iobjname,stat) {
  if (BrowserOK) {
   var iobj = MouseOverObject[iobjname];
   if (stat == 1) {
    document.images[iobjname].src = iobj.on.src;
    if (iobj.alt) window.status = iobj.alt;
    }
   else {
    document.images[iobjname].src = iobj.off.src;
    window.status = '';
    }
   }
  return true;
  }
 MouseOverObject = new Object();
 MouseOverObject['business'] = new MouseOverInfo('images/1_on.gif','images/1_off.gif','business')
 MouseOverObject['food'] = new MouseOverInfo('images/2_on.gif','images/2_off.gif','food')
 MouseOverObject['flipthru'] = new MouseOverInfo('images/3_on.gif','images/3_off.gif','flipthru')
 MouseOverObject['apartment'] = new MouseOverInfo('images/4_on.gif','images/4_off.gif','apartment')
 MouseOverObject['subscribe'] = new MouseOverInfo('images/5_on.gif','images/5_off.gif','subscribe')   
  


// Cool CSS Menu- By JavaScriptKit.com (http://www.javascriptkit.com)
// For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/
// Fading routine based on Dynamic Drive script: http://www.dynamicdrive.com/dynamicindex4/highlightgrad.htm
// This notice must stay intact for use

var baseopacity=0

function showtext(thetext){
if (!document.getElementById)
return
textcontainerobj=document.getElementById("tabledescription")
browserdetect=textcontainerobj.filters? "ie" : typeof textcontainerobj.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
document.getElementById("tabledescription").innerHTML=thetext
highlighting=setInterval("gradualfade(textcontainerobj)",50)
}

function hidetext(){
cleartimer()
instantset(baseopacity)
}

function instantset(degree){
if (browserdetect=="mozilla")
textcontainerobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
textcontainerobj.filters.alpha.opacity=degree
else if (document.getElementById && baseopacity==0)
document.getElementById("tabledescription").innerHTML=""
}

function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.2, 0.99)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=20
else if (window.highlighting)
clearInterval(highlighting)
}




