/* 
	Exodus Windows Functions
	
	Copyright (c) 2001 - 2002  All Rights Reserved Worldwide
	Exodus Enterprise Systems - West Chester, PA

	These functions may be used freely as long as the above copyright is attached.
	All Exodus JavaScript functions rely upon this being loaded first.
*/

var isNav4 = isIE4 = false;
ipAddress = 0;
info_topic = getURLTopic(window.location);
url_AdContext = "";

// Simple determination of Navigator type
if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
	isNav4 = (navigator.appName == "Netscape") ? true : false;
	isIE4 = (navigator.appName.indexOf("Microsoft") != -1) ? true : false;
}

// Parse the arguments from a URL string assuming (?) start and (&) separation
function getArgs(act)	{
	var theArgs = new Object();						// Create a new object to hold the args
	var query = location.search.substring(1);		// Extract the search portion of the URL
	var arguments = query.split("&")				// Split into array arguments at the & symbol
	for(var i = 0; i < arguments.length; i++)	{
		var argLoc = arguments[i].indexOf('=');		// Look for name=value pair
		if (argLoc == -1) continue;					// Nothing found, go to next one
		var argName = arguments[i].substring(0,argLoc);		// Extract the name
		var argValue = arguments[i].substring(argLoc+1);	// Extract the value
		theArgs[argName] = unescape(argValue);				// Store in object as full string
		}
	if (query && act=='strip') loadURL(stripArgs());
	return theArgs;
}

function stripArgs()	{
	return location.protocol + '//' + location.host + location.pathname;
}

function emask(end,middle,start,subject){
var one ='mai';
var two='lto:';
var three='?Subject=';
//start,middle,end,subject;
var putogether= one+two+start+middle+end+three+subject;
document.location.href=eval('"'+putogether+'"');
window.status=putogether;
}

var siteAddrs = new Array('info','rentals','owners','villarentals');
var siteDomain = 'vil' + 'laco' + 'stano' + 'rte.c' + 'om';
function m_addr(theType, thePrompt)	{
	return '<a href="mailTo:' + siteAddrs[theType] + '@' + siteDomain + '">' + ((typeof thePrompt == 'undefined') ? 'Send Us Email!' : thePrompt) + '</a>';
}

function setRecipient(aVal)	{
	if((s = MM_findObj('recipient')) != null)	{
		s.value = siteAddrs[aVal] + '@' + siteDomain;
	}
}



// Switch to a specific URL
function loadURL(aURL)	{
	top.window.location = aURL;
}

function getURLTopic(siteURL)	{
	var topic = siteURL;
	return topic;
}


function getPPC()	{
	var urlArgs = getArgs();
	var ac = (urlArgs['source']) ? urlArgs['source'] : '';
	ac += (urlArgs['ad']) ? (',' + urlArgs['ad']) : '';
	ac += (urlArgs['id']) ? (urlArgs['id']) : '';
	return ac;
}

function bookmarkUs(aURL, aTitle)	{
	var aStr = "" + aTitle;
	if (document.all)	{
		window.external.AddFavorite(aURL, aStr);
	}
}

// Return an appropriate greeting
function TODgreeting()	{
	var theDay = new Date();
	var theHour = theDay.getHours();
	if (theHour > 17) return "Good Evening";
	if (theHour < 12) return "Good Morning";
	return "Good Afternoon";
}

