share1=new Image();
share2=new Image();
share1.src="http://modelfireboats.com/sys_files/cssfooter/SharePageNormal.png"; 
share2.src="http://modelfireboats.com/sys_files/cssfooter/SharePageHighlighted.png"; 
var share1 = "http://modelfireboats.com/sys_files/cssfooter/SharePageNormal.png";
var share2 = "http://modelfireboats.com/sys_files/cssfooter/SharePageHighlighted.png";
facebook1=new Image();
facebook2=new Image();
facebook1.src="http://modelfireboats.com/sys_files/cssfooter/FacebookNormal.png"; 
facebook2.src="http://modelfireboats.com/sys_files/cssfooter/FacebookHighlighted.png"; 
var facebook1 = "http://modelfireboats.com/sys_files/cssfooter/FacebookNormal.png";
var facebook2 = "http://modelfireboats.com/sys_files/cssfooter/FacebookHighlighted.png";
twitter1=new Image();
twitter2=new Image();
twitter1.src="http://modelfireboats.com/sys_files/cssfooter/TwitterNormal.png"; 
twitter2.src="http://modelfireboats.com/sys_files/cssfooter/TwitterHighlighted.png"; 
var twitter1 = "http://modelfireboats.com/sys_files/cssfooter/TwitterNormal.png";
var twitter2 = "http://modelfireboats.com/sys_files/cssfooter/TwitterHighlighted.png";
feed1=new Image();
feed2=new Image();
feed1.src="http://modelfireboats.com/sys_files/cssfooter/FeedNormal.png"; 
feed2.src="http://modelfireboats.com/sys_files/cssfooter/FeedHighlighted.png"; 
var feed1 = "http://modelfireboats.com/sys_files/cssfooter/FeedNormal.png";
var feed2 = "http://modelfireboats.com/sys_files/cssfooter/FeedHighlighted.png";
function toggleLayer(whichLayer)
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}
function showLayer(whichLayer) {
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'none':'block';
  vis.display = (vis.display==''||vis.display=='block')?'block':'block';
} 
function reloadchat() {
	var timestamp = Number(new Date()); // current time as number
	http.open("GET", "http://modelfireboats.com/sys_files/cssfooter/api.php?type=list&notneeded="+timestamp, true);
      http.onreadystatechange=function() {
        if(http.readyState == 4) {
          var find1=/blah/;
          if (http.responseText.match(find1)) {
            document.getElementById('OnlineMemberMenu').innerHTML = http.responseText.substring(26);
            document.getElementById('OnlineMemberMenuCount').innerHTML = http.responseText.substring(0,2).replace(/^\s*|\s*$/g,'').replace(' ','');
            var CHAT_REQUEST = http.responseText.substring(2,6).replace(/^\s*|\s*$/g,'').replace(' ','');
            var CHAT_USERNAME = http.responseText.substring(6,26).replace(/^\s*|\s*$/g,'').replace(' ','');
            var CHAT_CHATID = http.responseText.substring(26,36).replace(/^\s*|\s*$/g,'').replace(' ','');
            if (http.responseText.substring(0,2).replace(/^\s*|\s*$/g,'').replace(' ','') > "0") {
            	//alert("YUP");
            		showLayer('OnlineMemberMenu');
            }
            if (CHAT_REQUEST >= "1") {
          	//alert("CHAT REQUESTED!");
          	
          	var answer = confirm(CHAT_USERNAME+' has sent you an instant message. Click OK below to read and accept.');
          	if (answer) {
          		startLyteFrame('Fireboat Website Live Chat!','http://modelfireboats.com/sys_files/chat.php?type=private&user='+CHAT_REQUEST+'&chatid='+CHAT_CHATID);
          	} 
            }
          }
        }
      }
    http.send(null);
    setTimeout("reloadchat()",4000); // 3 seconds
}




function startLyteFrame(title, url) {
	var anchor = this.document.createElement('a');
	anchor.setAttribute('rev', 'width: 600px; height: 480px; scrolling: auto;');
	anchor.setAttribute('title', title);
	anchor.setAttribute('href', url);
	anchor.setAttribute('rel', 'lyteframe');
	//alert(anchor.getAttrbute('title'));
	myLytebox.start(anchor, false, true);
	return false;
}
