var PicWin = "";

function checkWindow(){

if(PicWin != ""){
PicWin.close();
}
}

function dImg(picgoal,width,height,path) {
checkWindow();
var picPath;

if(!path){
picPath = "images/";
}else{
picPath = "images/" + path + "/";
}
var w = 640, h = 480;
var xOfst =window.screenLeft, yOfst=window.screenTop;
if (document.all) {
   w = document.body.clientWidth;
   h = document.body.clientHeight;
}
else if (document.layers || document.width) {
   w = window.innerWidth;
   h = window.innerHeight;
   xOfst = window.screenX;
   yOfst = window.screenY;
}
 var popW = width, popH = height;
 var leftPos = xOfst+5, topPos = yOfst+5; //(h-popH)/2;
  PicWin = window.open("",'eWindow','status=0,scrollbars=0,resizeable=0,width='+popW+',height='+popH+',top='+topPos+',left='+leftPos);
  PicWin.document.open();
  PicWin.document.writeln('<html>');
  PicWin.document.writeln('<head>');
  PicWin.document.writeln('<title>Rocky Branch Resort</title>');
  PicWin.document.writeln('</head>');
  PicWin.document.writeln('<body background="'+picPath+picgoal+'">');
  PicWin.document.writeln('</body>');
  PicWin.document.writeln('</html>');
  PicWin.document.close();
  PicWin.focus();
}

function newwin(filename,title) {
var picPath = "images/trailMaps/";
var picSrc = picPath + filename;

var w = 640, h = 480;
var xOfst =window.screenLeft, yOfst=window.screenTop;
if (document.all) {
   w = document.body.clientWidth;
   h = document.body.clientHeight;
}
else if (document.layers || document.width) {
   w = window.innerWidth;
   h = window.innerHeight;
   xOfst = window.screenX;
   yOfst = window.screenY;
}
 var popW = 600, popH = 400;
 var leftPos = xOfst+5, topPos = yOfst+5; //(h-popH)/2;
  PicWin = window.open("",'rWindow','status=0,scrollbars=1,resizeable=1,width='+popW+',height='+popH+',top='+topPos+',left='+leftPos);
  PicWin.document.open();
  PicWin.document.writeln('<html>');
  PicWin.document.writeln('<head>');
  PicWin.document.writeln('<title>Rocky Branch Resort</title>');
  PicWin.document.writeln('<link rel="stylesheet" href="rockyStyle.css" type="text/css">');
  PicWin.document.writeln('</head>');
  PicWin.document.writeln('<body bgcolor="#738458">');
  PicWin.document.writeln('<table width="90%" align="center" class="imageTable" cellpadding="6" cellspacing="0">');
  PicWin.document.writeln('<tr><td align="center" class="bodyTextBigBold">'+title+'</td></tr>');
  PicWin.document.writeln('<tr><td align="center" valign="middle"><table class="imageTable" cellpadding="0" cellspacing="0" align="center"><tr><td><img src="'+picSrc+'"></td></tr></table></td></tr>');
  PicWin.document.writeln('<tr><td align="center"><a href="javascript:window.close()" class="tableItem">Close Window</a></td></tr></table>');
  PicWin.document.writeln('</body>');
  PicWin.document.writeln('</html>');
  PicWin.document.close();
  PicWin.focus();
}

function valForm(theForm){
var valid = true;
var fix = "";
var msg = "";
if(theForm.Phone.value == "" && theForm.email.value == ""){
valid = false;
fix = theForm.email;
msg = "Please provide either your E-mail Address or Phone Number so we are able to contact you!";
}else if(theForm.Comments.value == ""){
valid = false;
fix = theForm.Comments;
msg = "Please enter text into the Comment field before submitting the form!";
}

if(!valid){
fix.focus();
alert(msg);
}
return valid;
}
function RemoveIEDots() { 
	for (a in document.links) document.links[a].onfocus = document.links[a].blur; 
	}
	
if (document.all) { 
	document.onmousedown = RemoveIEDots;
	}
	
plImg = new Array('about_o.gif','accommodations_o.gif','cabin_o.gif','contact_o.gif','famReu_o.gif','fishGuide_o.gif','hikingTrails_o.gif','lakeHouse_o.gif','rates_o.gif','rooms_o.gif','thingsToDo_o.gif','treeTop_o.gif');
var basePath = 'images/nav/';
	
var nImg = "";
for (tt=0; tt<plImg.length; tt++){
nImg = "pl"+tt;
nImg = new Image;
nImg.src = basePath+plImg[tt];
}
