

function OpenScrollingPopup(URL, width, height) {
	window.self.name = "main";
	var now = new Date();
	var remote = window.open(URL, "popup" + now.getTime(), "width=" + width + ",height=" + height + ",toolbar=0,location=0,directories=0,resizable=1,status=1,menubar=0,scrollbars=yes");
}
// ----- END: FOR OPENING GENERAL POPUP WINDOWS -----



// ----- BEGIN: FOR HIDING/SHOWING LAYERS -----
function showLayer(strLayerName) {
	if(document.all)
		document.all[strLayerName].style.display = 'block';
	else if(document.layers)
		document.layers[strLayerName].display = 'block';
}
function hideLayer(strLayerName) {
	if(document.all)
		document.all[strLayerName].style.display = 'none';
	else if(document.layers)
		document.layers[strLayerName].display = 'none';
}
// ----- END: FOR HIDING/SHOWING LAYERS -----



function swapImage(strImgName, strImgSrc) {
	if(document.images)
		document.images[strImgName].src = strImgSrc;
}




// ----- BEGIN: FOR GETTING COOKIES -----
function getCookie(strName) {
	var strCookie = document.cookie;
	if(strCookie.length == 0) return '';
	var strValue = '';
	var intStart = strCookie.indexOf(strName + '=');
	if(intStart > -1) {
		intStart += strName.length + 1;
		var intEnd = strCookie.indexOf(';', intStart + 1);
		if(intEnd == -1) intEnd = strCookie.length;
		strValue = strCookie.substring(intStart, intEnd);
	}
	return strValue;
}

function setCookie(strName, strValue, strExp) {
	document.cookie = strName + '=' + strValue
			+ (document.location.hostname == 'www.allstarvacationhomes.com' ? '' : '')
			+ (strExp == '' ? '' : ';expires=' + strExp);
}


function setCookieWithPath(strName, strValue, strPath, strExp) {
	document.cookie = strName + '=' + strValue
			+ (document.location.hostname == 'www.allstarvacationhomes.com' ? '' : '')
			//+ (strPath == '' ? '' : ';path=' + strPath)
			+ (strExp == '' ? '' : ';expires=' + strExp);
}

function deleteCookie(strName) {
	var dtmExp = new Date();
	dtmExp.setTime(dtmExp.getTime() - 3600000); // 1 hr ago
	setCookieWithPath(strName, '', '/', dtmExp.toGMTString())
}
// ----- END: FOR GETTING COOKIES -----





// ----- BEGIN: FOR STRING/NUMBER CONVERSIONS -----
function isNumericString(strOrig) {
	if(strOrig.length==0) return false;

	var strChar;
	var strValidChars = "1234567890$,";
	for (var i = 0; i < strOrig.length; i++) {
		strChar = strOrig.substring(i, i+1);
		if (strValidChars.indexOf(strChar, 0) == -1)
			return false;
	}
	return true;
}

function isValidEmail(strEmail) {
	var strBadChars, strChar, strSuffix, intNumBadChars, intCount, intPos, intPosPeriod

	// --- CHECKING FOR BAD CHARACTERS ---
	strBadChars = ' /:,#\'"`$~!%^&*();<>?\\|{}[]';
	intNumBadChars = strBadChars.length
	for(intCount = 0;  intCount < intNumBadChars;  ++intCount) {
		strChar = strBadChars.substring(intCount, 1);
		if(strEmail.indexOf(strChar) > 0)
			return false;
	}

	// --- CHECKING FOR THE @ SIGN ---
	intPos = strEmail.indexOf('@')
	if(intPos == -1)
		return false;

	// --- CHECKING FOR A . AFTER THE @ SIGN ---
	intPosPeriod = strEmail.indexOf('.', intPos);
	if(intPosPeriod == -1)
		return false;

	// --- CHECKING FOR AT LEAST 2 AFTER THE PERIOD ---
	if(strEmail.length - intPosPeriod < 3)
		return false;

	// --- ALL CHECKS OUT - MUST BE OKAY ---
	return true;
}
// ----- END: FOR STRING/NUMBER CONVERSIONS -----


// load into head of page

  var notepad_page
	var paddir
	// BROWSER CHECK
	browser = navigator.appName;
	appVer = parseInt(navigator.appVersion);
	ie = "Microsoft Internet Explorer";
	ns = "Netscape";
	if (browser == ns && appVer < 5) {
			notepad_page = "_ns";
	}else{
	        notepad_page = "_ie";
			
	} 

if(document.all || document.layers || document.getElementById) {
	document.write('<' + 'SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="/js/notepad/notepad'+notepad_page+'.js"></' + 'SCRIPT>');
	document.write('<' + 'SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="/js/notepad/listing.js"></' + 'SCRIPT>');
}


var objNotePad = null, divSP = null, imgPreloads;
function loadNotePadObj() {
	if(blnNotePadJSLoaded)
		objNotePad = new jsNotePad('objNotePad', divSP);
	else
		setTimeout('loadNotePadObj()', 1111);
}
function initNotePad() {
	if(document.getElementById)
		divSP = document.getElementById('divNotePad');
	else if(document.all)
		divSP = document.all('divNotePad');
	else if(document.layers)
		divSP = document.layers['divNotePad'];
	if(divSP != null) {
		loadNotePadObj();

		
	}
}





