function popup(url, name, width, height, scroll)
{

// center the window
//var toppos = (screen.availHeight-height)/2;
//var leftpos = (screen.availWidth-width)/2;

// screen resolution
var height = screen.availHeight;
var width = screen.availWidth;

// where to position the window
var toppos = 0;
var leftpos = 0;

// create the window command
command = "aWindow=window.open('" + url + "', '" + name +"', 'width=" + width + ",height=" + height + ",scrollbars=" + scroll + ",toolbar=yes,menubar=no,top=" + toppos +",left="+ leftpos +",screenX="+ toppos +",screenY="+ leftpos +",resizable=yes')";
// execute the command
eval(command);

}

function show_properties(type){

	// alert("showing properties!");

	if(type == "sale"){
		popup("http://www.itrm.co.uk/realestate/search.php?company_id=5&search_type=sale", "window", 750, 550, "yes");
	}
	
	if(type == "lease"){
		popup("http://www.itrm.co.uk/realestate/search.php?company_id=5&search_type=lease", "window", 750, 550, "yes");
	}

}
function newwindow(type){

	if(type == "info"){
		popup("pdf/tenants_info_pack.pdf", "window", 750, 550, "yes");
	}
	
	if(type == "terms"){
		popup("pdf/terms&conditions.pdf", "window", 750, 550, "yes");
	}
	
	if(type == "instruction"){
		popup("pdf/letting_instructions.pdf", "window", 750, 550, "yes");
	}
	
	if(type == "street"){
		popup("http://www.upmystreet.com/overview/?l1=SE18", "window", 750, 550, "yes");
	}

}

/*
Top Navigational Bar II (By Mike Hall)
Last updated: 00/05/08
Permission granted and modified by Dynamicdrive.com to include script in archive
For this and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var myNavBar1 = new NavBar(0);
var dhtmlMenu;

//define menu items (first parameter of NavBarMenu specifies main category width, second specifies sub category width in pixels)
//add more menus simply by adding more "blocks" of same code below

dhtmlMenu = new NavBarMenu(50, 150);
dhtmlMenu.addItem(new NavBarMenuItem("Buyers", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Local properties", "javascript:show_properties('sale');"));
dhtmlMenu.addItem(new NavBarMenuItem("First time buyers", "first_time_buyers.html"));
dhtmlMenu.addItem(new NavBarMenuItem("Legal Process", "legal_process.html"));
dhtmlMenu.addItem(new NavBarMenuItem("Links to solicitors", "under_con.html"));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(50, 160);
dhtmlMenu.addItem(new NavBarMenuItem("Sellers", ""));
dhtmlMenu.addItem(new NavBarMenuItem("How We Advertise", "advertise.html"));
// dhtmlMenu.addItem(new NavBarMenuItem("Benifits of Intstructing", "instructing.html"));
dhtmlMenu.addItem(new NavBarMenuItem("Fees explained", "fees_explained.html"));
dhtmlMenu.addItem(new NavBarMenuItem("What we do", "what_we_do.html"));
dhtmlMenu.addItem(new NavBarMenuItem("For sale boards", "for_sale_boards.html"));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(50, 160);
dhtmlMenu.addItem(new NavBarMenuItem("Tenants", ""));
dhtmlMenu.addItem(new NavBarMenuItem("local properties", "javascript:show_properties('lease');"));
dhtmlMenu.addItem(new NavBarMenuItem("Renting guide", "renting_guide_tenants.html"));
dhtmlMenu.addItem(new NavBarMenuItem("Info pack", "javascript:newwindow('info');"));
dhtmlMenu.addItem(new NavBarMenuItem("dss tenants", "dss_tenants.html"));
dhtmlMenu.addItem(new NavBarMenuItem("Deposits and references", "deposits.html"));
dhtmlMenu.addItem(new NavBarMenuItem("NAEA protection", "naea_protection.html"));
dhtmlMenu.addItem(new NavBarMenuItem("Terms of business", "javascript:newwindow('terms');"));
dhtmlMenu.addItem(new NavBarMenuItem("Info pack", "javascript:newwindow('info');"));
dhtmlMenu.addItem(new NavBarMenuItem("Letting instruction form", "javascript:newwindow('instruction');"));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(80, 150);
dhtmlMenu.addItem(new NavBarMenuItem("Landlords", ""));
dhtmlMenu.addItem(new NavBarMenuItem("How do we advertise", "advertise_landlords.html"));
dhtmlMenu.addItem(new NavBarMenuItem("Buy to let advice", "buy_to_let.html"));
dhtmlMenu.addItem(new NavBarMenuItem("What we do", "what_we_do_rent.html"));
dhtmlMenu.addItem(new NavBarMenuItem("Guide to rents", "rent_guide.html"));
dhtmlMenu.addItem(new NavBarMenuItem("NAEA protection", "naea_protection_landlords.html"));
dhtmlMenu.addItem(new NavBarMenuItem("Terms of business", "javascript: window('terms')"));
dhtmlMenu.addItem(new NavBarMenuItem("Info Pack", "javascript:newwindow('info');"));
dhtmlMenu.addItem(new NavBarMenuItem("Letting Instruction Form", "javascript: window('instruction')"));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(80, 150);
dhtmlMenu.addItem(new NavBarMenuItem("16 Reasons", "16_reasons.html"));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(70, 100);
dhtmlMenu.addItem(new NavBarMenuItem("Our Area", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Up My Street", "javascript:newwindow('street');"));
dhtmlMenu.addItem(new NavBarMenuItem("Overview", "area_overview.html"));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(60, 100);
dhtmlMenu.addItem(new NavBarMenuItem("Contact", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Address", "address.html"));
dhtmlMenu.addItem(new NavBarMenuItem("Map", "map.html"));
dhtmlMenu.addItem(new NavBarMenuItem("Email Link", "mailto:office@alanives.co.uk"));
myNavBar1.addMenu(dhtmlMenu);

//set menu colors
									//bdColor, hdrFgColor, hdrBgColor, hdrHiFgColor, hdrHiBgColor, itmFgColor, itmBgColor, itmHiFgColor, itmHiBgColor
myNavBar1.setColors("#ffffff", "#006666", "#ffffff", "#ffffff", "#006666", "#ffffff", "#006666", "#000000", "#99CCCC")

//uncomment below line to center the menu (valid values are "left", "center", and "right"
//myNavBar1.setAlign("center")

var fullWidth;

function init() {

  // Get width of window, need to account for scrollbar width in Netscape.

  fullWidth = getWindowWidth() 
    - (isMinNS4 && getWindowHeight() < getPageHeight() ? 16 : 0);

  myNavBar1.resize(500);
  myNavBar1.create();
  myNavBar1.setzIndex(2);
  //UNCOMMENT BELOW LINE TO MOVE MENU DOWN 50 pixels
  myNavBar1.moveTo(0, 67);
}