// Cookie retrieval// name - name of the desired cookie// * return string containing value of specified cookie or null if cookie does not existfunction getCookie(name) {    var dc = document.cookie;    var prefix = name + "=";    var begin = dc.indexOf("; " + prefix);    if (begin == -1) {        begin = dc.indexOf(prefix);        if (begin != 0) return null;    } else        begin += 2;    var end = document.cookie.indexOf(";", begin);    if (end == -1)        end = dc.length;    return unescape(dc.substring(begin + prefix.length, end));}// Search Selector -- Randall D. Ryan 1999// Paste the following search code into the document's body:j/*<FORM NAME="searchform" onSubmit="return processSearch()" ACTION="/archive" target="_top"><INPUT TYPE="radio" NAME="rsearch" checked><A href="http://juneauempire.com/smart_search">Juneauempire.com</a><BR><INPUT TYPE="radio" NAME="rsearch"><a href="http://classifieds.juneauempire.com/classifieds-bin/classifieds?">Classifieds</a><BR><INPUT TYPE="radio" NAME="rsearch"><a href="http://juneauempire.com/movies">Today's Movies</a><BR><BR><INPUT TYPE="text"  NAME="search" SIZE="12" MAXLENGTH="25"><INPUT TYPE="submit" VALUE="search"></FORM>*/function processSearch(){      formObj = document.searchform;// Capture the Data Entered in Text Field      myQuery = formObj.search.value;      myMaxHits = "6";//      SearchEngines = document.searchform.location.value;  SearchEngines = "&search=" + myQuery + "&maxhits=" + myMaxHits + "&location=Yahoo&location=AltaVista&location=Google" // Make Sure They Entered a search to Search For      if (myQuery == "") {         alert ("Please enter a search value first!");         formObj.search.focus();      } else {// Determine Which Radio Button Was Selected         for (count=0;count<3;count++) {            if (formObj.rsearch[count].checked) {                Selected = count;            }         }// Perform Action Based on What Was Selected         if (Selected == "0") {             myQuery ='http://www.juneauempire.com/cgi-bin/smart_search/cqcgi/@jun_stories.env?CQ_LOGIN=&CQ_DTF_SIMPLE_RESULTS=YES&CQ_USER_NAME=guest&CQ_PASSWORD=guest&CQ_DO_QUERY=YES&CQ_CUR_LIBRARY=jun_stories&CQ_QUERY_TYPE=smart&CQ_EXPANSION_LEVEL=3&CQ_MAX_WILDCARD=1000&CQ_MAX_FUZZY_SPELLING=50&CQ_MAX_DOCS=50&CQ_DOC_MARKUP_STYLE=7&CQ_QUERY_STRING='+myQuery;              location.href=(myQuery);         }         else if (Selected == "1") {             myQuery ='http://classifieds.juneauempire.com/classifieds-bin/classifieds?classification=CLASSIFIEDS&temp_type=detail&date=today&keywords='+myQuery;             location.href=(myQuery);         }         else if (Selected == "2") {             myQuery = 'http://calendar.juneauempire.com/ptemp?tp=JUNEAU+AK&property=JUNEAU+AK&category=movies&temp_type=detail&date=today&display=Movie+List&keywords='+myQuery;             location.href=(myQuery);         }               }      return false;} /************************************************ Amazon style Drop-in content box- � Dynamic Drive DHTML code library (www.dynamicdrive.com)* Visit DynamicDrive.com for hundreds of DHTML scripts* This notice must stay intact for legal use* Go to http://www.dynamicdrive.com/ for full source code***********************************************/// Customize the following code and paste at the bottom of the HTML body:/******** BEGIN HTML **********<style type="text/css">#dropinboxv2cover{width: 320px; //change width to desired // height: 320px;  change height to desired. REMOVE if you wish box to be content's natural heightposition:absolute; //Don't change below 4 rulesz-index: 100;overflow:hidden;visibility: hidden;}#dropinboxv2{width: 300px; // change width to above width-20. height: 300px; // change height to above height-20. REMOVE if you wish box to be content's natural heightborder: 2px solid black; // Customize box appearancebackground-color: #000000;padding: 0px;position:absolute; // Don't change below 3 rules left: 0;top: 0;}</style><!-- DROP DOWN BOX --><div id="dropinboxv2cover"><div id="dropinboxv2"><TABLE WIDTH=300 BORDER=0 CELLPADDING=0 CELLSPACING=0>	<TR>		<TD>			<A HREF="#" onClick="dismissboxv2();return false">				<IMG SRC="/stickynote/lovestickie/images/Lovestickie_close.jpg" WIDTH=300 HEIGHT=16 BORDER=0 ALT="Close Sticky-note"></A>		</TD>	</TR>	<TR>		<TD>			<A HREF="http://www.juneauempire.com/weddings/ballot" TARGET="_NEW">				<IMG SRC="/stickynote/lovestickie/images/Lovestory_vote.jpg" WIDTH=300 HEIGHT=284 BORDER=0 ALT="Vote for your favorite love story"></A>		</TD>	</TR></TABLE></div></div><!-- /DROP DOWN BOX -->******** END HTML **********//**** Begin Drop-Box Javavar dropboxleft=200 //set left position of box (in px)var dropboxtop=100 //set top position of box (in px)var dropspeed=15 //set speed of drop animation (larger=faster)//Specify display mode. 3 possible values are://1) "always"- This makes the fade-in box load each time the page is displayed//2) "oncepersession"- This uses cookies to display the fade-in box only once per browser session//3) integer (ie: 5)- Finally, you can specify an integer to display the box randomly via a frequency of 1/integer...// For example, 2 would display the box about (1/2) 50% of the time the page loads.var displaymode="oncepersession"///Don't edit beyond here///////////if (parseInt(displaymode)!=NaN)var random_num=Math.floor(Math.random()*displaymode)var ie=document.allvar dom=document.getElementByIdfunction initboxv2(){	if (!dom&&!ie)	return		crossboxcover=(dom)?document.getElementById("dropinboxv2cover") : document.all.dropinboxv2cover		crossbox=(dom)?document.getElementById("dropinboxv2"): document.all.dropinboxv2		scroll_top=(ie)? truebody().scrollTop : window.pageYOffset		crossbox.height=crossbox.offsetHeight		crossboxcover.style.height=parseInt(crossbox.height)+"px"		crossbox.style.top=crossbox.height*(-1)+"px"		crossboxcover.style.left=dropboxleft+"px"		crossboxcover.style.top=dropboxtop+"px"		crossboxcover.style.visibility=(dom||ie)? "visible" : "show"		dropstart=setInterval("dropinv2()",50)}function dropinv2(){	scroll_top=(ie)? truebody().scrollTop : window.pageYOffset	if (parseInt(crossbox.style.top)<0){		crossboxcover.style.top=scroll_top+dropboxtop+"px"		crossbox.style.top=parseInt(crossbox.style.top)+dropspeed+"px"	}	else{		clearInterval(dropstart)		crossbox.style.top=0	}}function dismissboxv2(){	if (window.dropstart) clearInterval(dropstart)	crossboxcover.style.visibility="hidden"}function truebody(){	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body}function get_cookie(Name) {	var search = Name + "="	var returnvalue = ""	if (document.cookie.length > 0) {		offset = document.cookie.indexOf(search)		if (offset != -1) {			offset += search.length			end = document.cookie.indexOf(";", offset)			if (end == -1)				end = document.cookie.length;			returnvalue=unescape(document.cookie.substring(offset, end))		}	}	return returnvalue;}if (displaymode=="oncepersession" && get_cookie("droppedinv2")=="" || displaymode=="always" || parseInt(displaymode)!=NaN && random_num==0){	if (window.addEventListener)		window.addEventListener("load", initboxv2, false)	else if (window.attachEvent)		window.attachEvent("onload", initboxv2)	else if (document.getElementById || document.all)		window.onload=initboxv2	if (displaymode=="oncepersession")		document.cookie="droppedinv2=yes"}** End drop-box Java ****//***********************************************///********** Image rollover code **********//******** HTML EXAMPLE **********	Replace [bracketed] text	**	and paste into HTML body	* *******************************<a href="[target URL]" onMouseOut="swapImgRestore()" onMouseOver="swapImage('[Image label]','','[second image URL]',1)"><img src="[first image URL]" name="[image label]" width="[]" height="[]" border="0" id="[Image label]"></a>******* END HTML EXAMPLE *******/// Returns the last two swapped images to their original state// Use: No argumentsfunction swapImgRestore() { //v3.0	var i,x,a=document.sr;	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)  		x.src=x.oSrc;}// Place in <BODY> tag, preloads rollover images// Use: preloadImages(Image_url_1,[Image_url_2, ... ,Image_url_N]);function preloadImages() { //v3.0	var d=document;	if(d.images){ if(!d.p) d.p=new Array();    	var i,j=d.p.length,a=preloadImages.arguments;		for(i=0; i<a.length; i++)    	if (a[i].indexOf("#")!=0){    		d.p[j]=new Image;    		d.p[j++].src=a[i];    	}    }}// Function used by swapImage()function 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=findObj(n,d.layers[i].document);	if(!x && d.getElementById)		x=d.getElementById(n);	return x;}// Replaces one image with another// Use: swapImage('Label (ID) of image to be swapped','','URL of replacement image',1)function swapImage() { //v3.0	var i,j=0,x,a=swapImage.arguments;	document.sr=new Array;	for(i=0;i<(a.length-2);i+=3)		if ((x=findObj(a[i]))!=null){			document.sr[j++]=x;			if(!x.oSrc)				x.oSrc=x.src;			x.src=a[i+2];		}}// POP-UP/* This script and many more are available free online atThe JavaScript Source!! http://javascript.internet.com */// Add <BODY OnLoad="checkCount()"var expDays = 1; // number of days the cookie should last// Set page URL and details here.var page = "http://juneauempire.com/goodmorning/hoopshysteria.shtml";var windowprops = "width=500,height=700,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes";function GetCookie (name) {	var arg = name + "=";	var alen = arg.length;	var clen = document.cookie.length;	var i = 0;  	while (i < clen) { 		var j = i + alen;  		if (document.cookie.substring(i, j) == arg)			return getCookieVal (j);		i = document.cookie.indexOf(" ", i) + 1;		if (i == 0) break; 	}  	return null;}function SetCookie (name, value) {	var argv = SetCookie.arguments;	var argc = SetCookie.arguments.length;	var expires = (argc > 2) ? argv[2] : null;	var path = (argc > 3) ? argv[3] : null;	var domain = (argc > 4) ? argv[4] : null;	var secure = (argc > 5) ? argv[5] : false;	document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : "");}function DeleteCookie (name) {	var exp = new Date();	exp.setTime (exp.getTime() - 1);	var cval = GetCookie (name);	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();}var exp = new Date();exp.setTime(exp.getTime() + (expDays*24*60*60*1000));function amt(){	var count = GetCookie('count');	if(count == null) {		SetCookie('count','1');		return 1;	}	else {		var newcount = parseInt(count) + 1;		DeleteCookie('count');		SetCookie('count',newcount,exp);		return count;	}}function getCookieVal(offset) {	var endstr = document.cookie.indexOf (";", offset);	if (endstr == -1)		endstr = document.cookie.length;	return unescape(document.cookie.substring(offset, endstr));}function checkCount() {	var count = GetCookie('count');	if (count == null) {		count=1;		SetCookie('count', count, exp);		window.open(page, "", windowprops);		}	else {		count++;		SetCookie('count', count, exp);	}}/**************************************/