var siteStr = window.location.toString();
var site = (siteStr.match(/hikewnc/i) ? 'hikewnc.info' : 'mtbikewnc.com');

function newPlainWindow(url) {
plainwindow = window.open(url,'newWindowName');
}

function newWindow(url)	{

imagewindow = window.open(url,'newWindowName','width=1000,height=700,toolbar=no,location=no,resizable=yes,scrollbars=yes,left=0,top=0')
imagewindow.focus()
}
	
function HelpWindow(help)	{

helpwindow = window.open(help,'thiswindow','width=285,height=700,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=no,left=0,top=0')
helpwindow.focus()
}

function openRatingWindow(url) {
hikeRideRatingWindow = window.open(url,'name','width=350,height=375,toolbar=no,location=no,resizable=yes,scrollbars=yes,left=0,top=0')
hikeRideRatingWindow.focus()
}

function mapLyteframe(dir) {
  var standardMap = document.getElementById('standardMap');
  standardMap.style.display = 'None';
  
  var a = document.createElement("a");
  a.href = "http://maps.wncoutdoors.info/map.php?map=" + dir;
  a.rel = "lyteframe";
  a.title = "WNCOutdoors.info Interactive Map Browser";
  a.rev = "width:1000px; height:700px;";
  myLytebox.start( a, false, true);
}

function rate( value ) {
      new Ajax.Updater( 'rating', 'http://' + site + '/rate.php?hikeRideID=$bestHikeRide&value='+value );
}

function addcomment(){
  $('commentStatus').update('Comment submitted. Please allow a few minutes to process ' +
    ' for comment to appear.');
  $('commentButton').disabled = true;
  new Ajax.Updater( 'comments', 'http://' + site + '/comment.php',
    {
      method: 'post',
      parameters: $('cform').serialize()
    } 
  );
}
