//addEvent(window, 'load', Initialize);

if (window.attachEvent) {
    window.attachEvent("onload", Initialize);
    //window.attachEvent("onunload", Page_Unload);
} else {
    window.addEventListener("DOMContentLoaded", Initialize, false);
    //window.addEventListener("unload", Page_Unload, false);
}

var settings5, settings10, settings20, settingsTopOnly10;

function Initialize(){
	initCorners();
	DetectBrowser();
	curvyCorners(settings20, "#mainContent");
	curvyCorners(settings10, "#mcLeftPanel");
	
// Google Maps Code
    //var myLatlng = new google.maps.LatLng(33.893395, -84.381354);
	var myLatlng = new google.maps.LatLng(33.893050, -84.381800);
    var myOptions = {
      zoom: 10,
      center: myLatlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
	var image = 'images/gemcorp_icon.png';
	var officeMarker = new google.maps.Marker({
		position: myLatlng,
		map: map,
		icon: image	
	});	
/*	var contentString = '<div id="content">'+
		'<div id="siteNotice">'+
		'</div>'+
		'<h1 id="firstHeading" class="firstHeading">Gemcorp, Inc.</h1>'+
		'<div id="bodyContent">'+
		'<p>5064 Roswell Rd<br />'+
		'Building B Suite 101<br />'+
		'Hardeman Square<br>'+
		'Atlanta, GA 30342<br />'+
		'<b>(404) 851-9489</b></p>'+
		'<p>Free Parking. Enter through center courtyard.</p>'+
		'<p><b>Google Map:</b> Switch to Satellite view and zoom in to see exact building location.</p>'+
		'</div>'+
		'</div>';
*/
	var contentString = '<div id="content">'+
		'<div id="siteNotice">'+
		'</div>'+
		'<h1 id="firstHeading" class="firstHeading">Gemcorp, Inc.</h1>'+
		'<div id="bodyContent">'+
		'<table><tr><td width="150">5064 Roswell Rd<br />'+
		'Building B Suite 101<br />'+
		'Hardeman Square<br>'+
		'Atlanta, GA 30342<br />'+
		'<b>(404) 851-9489</b></td><td width="300"><b>Free Parking:</b> Enter the office through center courtyard at rear of buildings.<br /><br />'+
		'<b>Google Map:</b> Switch to Satellite view and zoom in to see exact office location.</td></tr></table>'+
		'</div>'+
		'</div>';		
	var infowindow = new google.maps.InfoWindow({
		content: contentString});
	google.maps.event.addListener(officeMarker, 'click', function() {
		infowindow.open(map,officeMarker);});	
}
function DetectBrowser() {
    var br = new Array(4);
    br = getBrowser();
    if ((br[0] == "msie" && getMajorVersion(br[1]) == "7") || (br[0] == "msie" && getMajorVersion(br[1]) == "6")) {
        adapt2OldVerIE();
    }
    if ((br[0] == "msie" && getMajorVersion(br[1]) == "6")) {
        adapt2Ver6IE();
    }	
    if (br[0] == "firefox" || br[0] == "safari") {
		adapt2Firefox();
    }
}
function adapt2Ver6IE(){
	Reclass("BannerContact","header_contact_info_oldIE");
	Reclass("mainContent","main_content_oldIE");
}
function adapt2OldVerIE(){
	Reclass("mainContent","main_content_oldIE");
	Reclass("doubleWidePanel", "double_wide_panel_oldIE");
}
function adapt2Firefox(){
	ReclassFF("mcLeftPanel","mc_left_panel_FF");
}
function Reclass(id, newClassName)			{
	obj = document.getElementById(id);
	if(obj){
		obj.setAttribute("className", newClassName);
	}
}
function ReclassFF(id, newClassName)			{
	obj = document.getElementById(id);
	if(obj){
		obj.setAttribute("class", newClassName);
	}
}

function initCorners() {
	settings20 = {
	  tl: { radius: 20 },
	  tr: { radius: 20 },
	  bl: { radius: 20 },
	  br: { radius: 20 },
	  antiAlias: true
	}
	
	settings10 = {
	  tl: { radius: 10 },
	  tr: { radius: 10 },
	  bl: { radius: 10 },
	  br: { radius: 10 },
	  antiAlias: true
	}
	
	settings5 = {
	  tl: { radius: 5 },
	  tr: { radius: 5 },
	  bl: { radius: 5 },
	  br: { radius: 5 },
	  antiAlias: true
	}
	settingsTopOnly10 = {
	  tl: { radius: 10 },
	  tr: { radius: 10 },
	  bl: { radius: 0 },
	  br: { radius: 0 },
	  antiAlias: true
	}
}
