String.prototype.trim = function() 
{return( this.replace(/^\s*([\s\S]*\S+)\s*$|^\s*$/,'$1') );}
function validEmail( email )
{   
   var reEmail = /^([0-9A-Za-z\._-]+[']*)+\@[0-9A-Za-z\._-]+\.[A-Za-z]+$/;
   return reEmail.test( email );
}

function showLyrics()
{var cSoonWindow=window.open("/lyrics.htm","cSoon","width=350,height=500,scrollbars=yes,menubar=no,toolbar=no");cSoonWindow.focus();}
function explainGabZone()
{var cExplainWindow=window.open("explainLayout.htm","explain","width=680,height=375,scrollbars=yes,menubar=no,toolbar=no");cExplainWindow.focus();}
function playSong()
{var cPlayWindow=window.open("/cbcom.mp3","cPlay","width=250,height=250,menubar=no,toolbar=no");cPlayWindow.focus();}
function playSong2()
{var cPlayWindow=window.open("/cbhomebound.mp3","cPlay","width=250,height=250,menubar=no,toolbar=no");cPlayWindow.focus();}
function openEdit(id)
{open("editThread.aro?id="+id,"edit","width=575,height=580,scrollbars=yes,resizable=yes");}
function UserInfo( u )
{
   var w = window.open( "userInfo.aro?u=" + u, "uInfo", "width=525,height=400,toolbars=no,resizable=1" );
   w.focus();
}
function IpAddressInfo( ip )
{
   var w = window.open( "IPAddressInfo.aro?ip=" + ip, "ipInfo", "width=525,height=400,toolbars=no,resizable=1" );
   w.focus();
}
function suggest(id)
{
   var win=window.open( '/localbiz/suggest.aro?id='+id,'suggest','width=525,height=465,resizable=1');
   win.focus();
}
function reportBadItem(id,msg,url)
{
   if( confirm("Click this link to report an item that is not suitable for this site.\nYour IP address will be sent with this notification.\nToo many false notifications will result in your IP being banned.\n\nSend Notification?" ) )
   {
      var v = new Image();
      v.src = "/reportItem.aro?i="+id+"&msg="+escape(msg)+"&url="+escape(url);

      alert("Notification sent.\nThank you for your assistance in maintaining CapeBreton.com" );
   }
}
function openWin(url)
{
   var w=window.open('uploads/'+url,'upload','width=550,height=450,scrollbars=1,resizable=1');
   w.focus();
}
