//Page titling
var ptl; var sec;

if (ptl) {
	document.title = "Seascape Oceanside Community | "+ ptl;
} else {
	document.title = "Seascape Oceanside Community";
}

var objDiv =  document.getElementById('backgroundright'); //Div holder

function SetImageBg() {
	var iWidthAvail = document.documentElement.clientWidth;

	if 	(iWidthAvail >= 1100) {
		objDiv.innerHTML = "<img src=\"/vimages/house1280right.jpg\" alt=\"\" />";
	}
	else if (iWidthAvail >= 920 && iWidthAvail < 1100)  {
		objDiv.innerHTML = "<img src=\"/vimages/house1024right.jpg\" alt=\"\" />";
	}
	else if (iWidthAvail >= 820 && iWidthAvail < 920) {
		objDiv.innerHTML = "<img src=\"/vimages/house1024right.jpg\" alt=\"\" />";
	} 
	else if (iWidthAvail < 820) {
		objDiv.innerHTML = "<img src=\"/vimages/house800right.jpg\" alt=\"\" />";
	} 
}

//Preload Images
var iPath = '/vimages/';

function preLoad()
{
  if(document.images)
  {
    var argLen = arguments.length;
    for(var i = 0; i < argLen; i++)
    {
      var arg = arguments[i];
      self[arg] = new Image();
      self[arg].src = iPath + arg;
    }
  }
}


function wrtDate() {
	var d = new Date();
	document.write(d.getYear());
}

function EmailFormat(eName,eAddress,eText) {
		var ToName = eName;
		var ToAddress = eAddress;
		var ToDisplayText = eText;
		document.write("<a href=\"mailto:"+eName+"@"+ToAddress+"\">"+eText+"</a>");
	}

function setMenu() {
	if (sec) {
		var s = sec;
		var obj = document.getElementById(s).style;
		obj.background = 'url(/vimages/nav_bullet.gif) no-repeat 3px 5px #E7E3D5';
		obj.textDecorationUnderline = false;
		obj.display = "block";
		obj.color = "#1D4752";
		obj.padding ='4px 4px 4px 24px';
		obj.borderBottom ='1px solid #BBA665';
		obj.width ='140px';
	}
}

function JApplet(vr,title) {
	var vrpath = "http://www.ontheocean.ca/vrs/";
	var targetdiv = document.getElementById('displayVRS');
	var targettitle = document.getElementById('vrtitle');
	
	if (vr) { var vrname = vr; } else { var vrname = "oceanside_showhome"; } //default first load
	if (title) { var vrtitle = title; } else { var vrtitle = "VR view panel:"; } //default title
	
	var japp = "<applet name=\"panoapplet\" codebase=\""+ vrpath +"\" code=\"panoapplet.class\" archive=\"panoapplet.jar\" width=\"360\" height=\"216\">";
		japp += "<param name=file value=\""+ vrpath + vrname + ".ivr\" />";
		japp += "<param name=\"autospin\" value=\"-69\" />";
		japp += "<param name=\"initialView\" VALUE=\"0,180,120\" />";
		japp += "<param name=\"leftMargin\" value=\"0\" />";
		japp += "<param name=\"topMargin\" value=\"0\" />";
		japp += "<param name=\"minZoomAngle\" VALUE=\"30\" />";
		japp += "<param name=\"altSplash\" value=\""+ vrpath +"logo_n.gif\" />";
		japp += "</applet>";
	targetdiv.innerHTML = japp; //spit it out
	targettitle.innerHTML = vrtitle; 
}

function onloader() {
	setMenu();
	SetImageBg();
	if (sec=="nav_vr") JApplet('oceanside_showhome','Oceanside Showhome');
	preLoad("logo.png","house1280right.jpg","house1024right.jpg","house800right.jpg","bottom_swiggles.png","headebar.png","nav_bullet.gif");
}

window.onload = onloader;



