////////// open window for walk details ////////////////////
var screenMargin = 80;
var RandomFactor = 50;

function openWindow(tUrl, W, H){
if (W==null){
	W=360;
	H=480;}
hOffset = (screen.availWidth-(W+screenMargin));
vOffset = screenMargin;
params='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+W+',height='+H+', top='+vOffset+', left='+hOffset ;
var textBox = window.open (tUrl,tUrl.slice(4, -4),params);
//textBox.document.body.onblur = 'self.close()'
}

function openWin(imgName, W, H){
hOffset = screenMargin+(Math.random()*RandomFactor);
vOffset = (screen.availHeight-(H+screenMargin))+(Math.random()*RandomFactor);
if (W==null){
	W=520;
	H=430;
params='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=520,height=430, top='+vOffset+', left='+hOffset;
} else {
W +=40;
H +=70;
params='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+W+',height='+H+', top='+vOffset+', left='+hOffset;
	}
imgBox = window.open (imgName,"", params);
imgBox.document.write ("<HTML><HEAD><TITLE>image</TITLE><link rel='stylesheet' href='walks.css' type='text/css'></HEAD><BODY>") ;
imgBox.document.write ("<CENTER><a href = 'javascript:self.close()'><img src="+imgName+" align='middle'></img></a>") ;
imgBox.document.write ("<br><p><a href = 'javascript:self.close()'>close window</a></p>") ;
imgBox.document.write ("</CENTER></BODY></HTML>") ;
}

function openSwf (vidName){
W =184;
H =166;
hOffset = screenMargin+(Math.random()*RandomFactor);
vOffset = (screen.availHeight-(H+screenMargin))+(Math.random()*RandomFactor);
params='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+W+',height='+H+', top='+vOffset+', left='+hOffset;
swfBox = window.open ("","swfWin",params);
swfBox.document.write ("<HTML><HEAD><TITLE>movie</TITLE><link rel='stylesheet' href='walks.css' type='text/css'></HEAD><BODY onBlur='self.close()'>") ;
swfBox.document.write ('<CENTER>');
swfBox.document.write ('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="160" height="144" id="vidplayer2" align="middle">');
swfBox.document.write ('<param name="movie" value="vidplayer2.swf?vidClip='+vidName+'" />');
swfBox.document.write ('<param name="allowScriptAccess" value="sameDomain" />');
//swfBox.document.write ('<param name="movie" value="vidplayer2.swf?vidClip='+vidName+'" />');
swfBox.document.write ('<param name="quality" value="high" />');
swfBox.document.write ('<param name="bgcolor" value="#fffff4" />');
swfBox.document.write ('<embed src="vidplayer2.swf?vidClip='+vidName+'" quality="high" bgcolor="#ffffff" width="160" height="144" name="vidplayer2" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
swfBox.document.write ('</object>');
swfBox.document.write ('</CENTER></BODY></HTML>') ;

}

//////////////////////////////////////////////// old stuff from unstates /////////////////
function openQtWin(qtName){
browserTest();
if(brow=="Net"){
params='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=120,height=100';
qtBox = window.open (qtName,"qtWindow",params);
}
else{
params='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=140,height=126' ;
qtBox = window.open ("","qtWindow",params);
qtBox.document.write ("<HTML><HEAD><TITLE>_</TITLE></HEAD><BODY onBlur='self.close()'>");
qtBox.document.write ("<EMBED src="+qtName+" width='120' height = '100' controller='false' align = 'LEFT' border='0'></EMBED>");
qtBox.document.write ("</BODY></HTML>");
}
}

function openSwQtWin(qtname){
W = 180;
H = 140;
hOffset = (screen.availWidth-W)/2;
params='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=20, width='+W+',height='+H+', left='+hOffset ;
SWBox = window.open ("","imgWindow",params) ;
SWBox.document.write ("<HTML><HEAD><TITLE></TITLE><link rel='stylesheet' href='unstyle.css' type='text/css'</HEAD><BODY onBlur='self.close()'>") ;
SWBox.document.write ("<CENTER>") ;
SWBox.document.write ("<object classid='clsid:166B1BCA-3F9C-11CF-8075-444553540000'codebase='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,0,0' ID=qtplayer width=160 height=120>") ;
SWBox.document.write ("<param name=src value='../qtplayer.dcr'>");
SWBox.document.write ("<param name=swRemote value='swSaveEnabled=\'true\' swVolume=\'true\' swRestart=\'true\' swPausePlay=\'true\' swFastForward=\'true\' swContextMenu=\'true\' '>");
SWBox.document.write ("<param name=swStretchStyle value=none>");
SWBox.document.write ("<param name=qtFile value="+qtname+">");
SWBox.document.write ("<PARAM NAME=bgColor VALUE=#FFFFFF>");
SWBox.document.write ("<embed src='../qtplayer.dcr' bgColor=#FFFFFF  width=160 height=120 swRemote='swSaveEnabled=\'true\' swVolume=\'true\' swRestart=\'true\' swPausePlay=\'true\' swFastForward=\'true\' swContextMenu=\'true\' ' swStretchStyle=none qtFile="+qtname+" type='application/x-director' pluginspage='http://www.macromedia.com/shockwave/download/'>");
SWBox.document.write ("<PARAM NAME=bgColor VALUE=#FFFFFF>");
SWBox.document.write ("</embed>") ;
SWBox.document.write ("</object>") ;
}

function browserTest(){
brow = navigator.appName.substring(0,3);
return brow;
}

function setTick(str){
msg = str;
defaultStatus = "";
spaces = msg.length
//doTick(msg, msgTemp);
for(i=0; i<spaces; i++){
msg = " "+msg;
}
msgTemp = msg;
pointer = 0;
showTick("");
setTimeout("doTick(msg, msgTemp, pointer)", 200);
}

function doTick(msg, msgTemp, pointer){
if (pointer == msg.length){
newmsgTemp = msg;
newpointer = 0;
}
else{
//msgTemp = msgT;
newpointer = pointer+1;
}
newmsgTemp = msg.substring(pointer,pointer+ (msg.length/2));
showTick(newmsgTemp);
setTimeout("doTick(msg, newmsgTemp, newpointer)", 200);
}

function showTick(stat){
//alert (stat);
status = stat;
//defaultStatus = stat;//only in exploere
return true;
}

function centreWindow(width, height) {//borrowed from choc buddha site
				// function to centre the current window	
				self.resizeTo(width,height);
				midWidth = self.screen.width / 2;
				midHeight = self.screen.height / 2;	
				// remove next line if no resize is required
				self.moveTo((midWidth - (width/2)), (midHeight - (height/2)));	
			}