// POSMATIC, INC.  ** Script start***

document.oncontextmenu = function() {return false;};
document.ondragstart = function() {return false;};



    function externalLinks() {
        if (!document.getElementsByTagName) {
            return;
        }
        var anchors = document.getElementsByTagName("a");
        for (var i=0; i<anchors.length; i++) {
            var anchor = anchors[i];
            if (anchor.getAttribute("href") &&
                anchor.getAttribute("rel") == "external") {
                anchor.target = "_blank";
            }
        }
    }
    
    window.onload = externalLinks;


    function printContent(id){
    str=document.getElementById(id).innerHTML
    newwin=window.open('','printwin','left=100,top=100,width=400,height=400')
    newwin.document.write('<HTML>\n<HEAD>\n')
    newwin.document.write('<TITLE>Print Page - Riverview Restaurant & Lounge</TITLE>\n')
    newwin.document.write('<script>\n')
    newwin.document.write('function chkstate(){\n')
    newwin.document.write('if(document.readyState=="complete"){\n')
    newwin.document.write('window.close()\n')
    newwin.document.write('}\n')
    newwin.document.write('else{\n')
    newwin.document.write('setTimeout("chkstate()",2000)\n')
    newwin.document.write('}\n')
    newwin.document.write('}\n')
    newwin.document.write('function print_win(){\n')
    newwin.document.write('window.print();\n')
    newwin.document.write('chkstate();\n')
    newwin.document.write('}\n')
    newwin.document.write('<\/script>\n')
    newwin.document.write('</HEAD>\n')
    newwin.document.write('<BODY onload="print_win()" style="margin:0; padding:10px; background-color:#3b2a0e; color:#8B7651; text-align:center;">\n')
    newwin.document.write('<img src="./images/rvny_logo_main.gif"/>')
    newwin.document.write('<div style="margin:20px 3px 3px 3px; padding:4px; background-color:#ffffff;">')
    newwin.document.write(str)
    newwin.document.write('</div>')
    newwin.document.write('</BODY>\n')
    newwin.document.write('</HTML>\n')
    newwin.document.close()
    }



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 toggleOn( 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 
		
		
			vis.display = 'block';

		}
		
function toggleOff( 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 

			vis.display = 'none';
		}		


function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
		if ( node == null )
		node = document;
		if ( tag == null )
		tag = '*';
		var els = node.getElementsByTagName(tag);
		var elsLen = els.length;
		var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
		for (i = 0, j = 0; i < elsLen; i++) {
			if ( pattern.test(els[i].className) ) {
				classElements[j] = els[i];
				j++;
		}
}
return classElements;
}




/*
	function addEvent( obj, type, fn ) {
		if (obj.addEventListener) {
			obj.addEventListener( type, fn, false );
			EventCache.add(obj, type, fn);
		}
		else if (obj.attachEvent) {
			obj["e"+type+fn] = fn;
			obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
			obj.attachEvent( "on"+type, obj[type+fn] );
			EventCache.add(obj, type, fn);
		}
		else {
			obj["on"+type] = obj["e"+type+fn];
		}
	}
		
	var EventCache = function(){
		var listEvents = [];
		return {
			listEvents : listEvents,
			add : function(node, sEventName, fHandler){
				listEvents.push(arguments);
			},
			flush : function(){
				var i, item;
				for(i = listEvents.length - 1; i >= 0; i = i - 1){
					item = listEvents[i];
					if(item[0].removeEventListener){
						item[0].removeEventListener(item[1], item[2], item[3]);
					};
					if(item[1].substring(0, 2) != "on"){
						item[1] = "on" + item[1];
					};
					if(item[0].detachEvent){
						item[0].detachEvent(item[1], item[2]);
					};
					item[0][item[1]] = null;
				};
			}
		};
	}();
	
	function $() {
		var elements = new Array();
		for (var i = 0; i < arguments.length; i++) {
			var element = arguments[i];
			if (typeof element == 'string')
				element = document.getElementById(element);
			if (arguments.length == 1)
				return element;
			elements.push(element);
		}
		return elements;
	}
	
	function toggle() {
		for ( var i=0; i < arguments.length; i++ ) {
			$(arguments[i]).style.display = ($(arguments[i]).style.display != 'none' ? 'none' : '' );
		}
	}
	
	var togglers = {
		init : function() {
			addEvent($('controller'),'click',this.run);
		},
		run : function() {
			toggle('test2','test4');
		}
	}
	
	function pageLoaders() {
		togglers.init();
	}
	
	addEvent(window,'unload',EventCache.flush);
	addEvent(window,'load',pageLoaders);
	*/