function loadContent(page, titleSuffix) {
$('#content').load("content/" + page + ".html", function(response, status, xmlHttpRequest) {
if (status == "error") window.location = page + ".html";
});
document.title = "The Tech Shop" + titleSuffix;
}

function loadIndex() {
loadContent("index", "");
}

function loadRepair() {
loadContent("repair", " - Computer Repair");
}

function loadVirusRemoval() {
loadContent("virusremoval", " - Virus Removal");
}

function loadHouseCalls() {
loadContent("housecalls", " - House Calls");
}

function loadBusinessServices() {
loadContent("businessservices", " - Business Services");
}

function updateLayout() {
var documentWidth = $(document).width();
if (documentWidth >= 688) {
$("#content").css("display", "inline-block");
$("#content").css("float", "left");
$("#content").width(documentWidth - 388);
$("#location").css("display", "inline-block");
$("#location").width(240);
} else {
$("#content").css("display", "block");
$("#content").css("float", "none");
$("#content").width("auto");
$("#location").css("display", "block");
$("#location").width("auto");
}
}

function loadMap() {
var latlng = new google.maps.LatLng(41.752379, -124.196891);
var mapOptions = {
center:latlng,
mapTypeId:google.maps.MapTypeId.ROADMAP,
zoom:16
};
var map = new google.maps.Map(document.getElementById("map"),mapOptions);
var marker = new google.maps.Marker({
map:map,
position:latlng,
title:"The Tech Shop"
});
}

$(document).ready(function() {
updateLayout();
loadMap();
});
$(window).resize(updateLayout);
