﻿//positioning scripts
function centerMe(){
if(window.window.screen.width > 900){
background.style.left=eval((window.window.screen.width - 850)/2);
}
if(window.window.screen.height > 800) {
background.style.top = eval((window.window.screen.height - 850)/2);
}else{
background.style.top = '10px';
}
}
function fullScreen(){
window.window.moveTo(0,0);
window.resizeTo(window.window.screen.availWidth,window.window.screen.availHeight);
}

//Virtual Earth scripts
var map = null;
var layer;      
var shape;    
function GetMap()         {            
	map = new VEMap('myMap');            
	map.LoadMap(new VELatLong(42.802254,-73.939166), 15, 'r', false);      
  	CreateLayer();                  
  	//Add a pushpin to the new layer
  	         shape = new VEShape(VEShapeType.Pushpin, map.GetCenter());
  	         shape.SetTitle('Pettas Restaurant');         
  	         shape.SetDescription('134 Duane Avenue<br/>Schenectady, NY  12307');         
  	         layer.AddShape(shape);     
}            
function CreateLayer()      {         
	layer = new VEShapeLayer();         
	map.AddShapeLayer(layer);      
	}
	
//Navigation scripts
var cntclk = 0                 
function myNav(n){
this.centerMe()
	switch (n){
		case 'hist':
			cntclk=1;
			leftimg.src = 'images/stirring_the_pot.jpg';
			leftimg.alt = 'Peter Petta stirs a pot of pasta under the watchful eye of his mother, Caroline';
			leftimg.useMap = oEmpty;
			page_content.innerHTML = oHist;
			page_content.style.overflow = 'scroll';
			break
		case 'spec':
			cntclk =4;
			left_col.innerHTML = oMap
			page_content.innerHTML = oSpecial;
			page_content.style.overflow = 'hidden';
			break
		case 'dinner':
			cntclk =3;
			left_col.removeChild
			leftimg.src = 'images/ttdesserts_blk.jpg';
			leftimg.useMap = oEmpty;
			leftimg.alt = 'Join your friends for a really good meal!';
			page_content.innerHTML = oDinner;
			page_content.style.overflow = 'scroll';
			break
		case 'banq':
			cntclk =6;
			leftimg.useMap = oEmpty;
			leftimg.src = 'images/banquet.jpg';
			leftimg.alt = "When one of lifes big or even small events come your way, we're here";
			page_content.innerHTML = oBanquet;
			page_content.style.overflow = 'scroll';			
			break
		case 'take':
			cntclk=8;
			leftimg.src = 'images/setting.jpg';
			leftimg.alt = 'Want to enjoy a quiet dinner at home, or perhaps the office, or maybe before the game?';
			leftimg.useMap = oEmpty;
			page_content.innerHTML = oTakeout;
			page_content.style.overflow = 'scroll';			
			break
		case 'find':
			cntclk=7;
			leftimg.src = 'images/discover.jpg';
			leftimg.alt = 'discover us';
			page_content.innerHTML = ogeoMap;
			GetMap();
			page_content.style.overflow = 'hidden';			
			break
		default:
			cntclk=0;
			leftimg.src = 'images/food.jpg';
			leftimg.alt = 'wine and food sidebar image';
			leftimg.useMap = oEmpty;
			page_content.innerHTML = oDefault;
			page_content.style.overflow = 'scroll';
		}
}


