// change page on links view if not a pid
function changePage() {
		if (self.parent.frames.length != 0)
			self.parent.location = ('http://www.ivacationrentals.com/');		
		}
// drop down menu navigation
function go(box) {
		var val = box.options[box.selectedIndex].value;
		if (val != "") {
					window.parent.location.href = val;
				}
			}

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.ivacationrentals.com' ? '' : '')
			+ (strExp == '' ? '' : ';expires=' + strExp);
}


function setCookieWithPath(strName, strValue, strPath, strExp) {
	document.cookie = strName + '=' + strValue
			+ (document.location.hostname == 'www.ivacationrentals.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 -----




function ViewImage(page) {var cal = window.open(page, "view_image", "directories=no,height=400,location=no,menubar=No,resizable=Yes,scrollbars=yes,status=no,width=600"); 
}

function ViewCalendar(page) {var cal = window.open(page, "calendar", "directories=No,location=No,resizable=Yes,menubar=No,scrollbars=yes,status=No,width=600,height=450"); 
} 

function ViewContact(page) {var cal = window.open(page, "contact", "directories=no,height=400,location=no,toolbar=No,menubar=no,scrollbars=yes,status=no,resizable=1,width=600"); } 

function ViewReviews(page) {var cal = window.open(page, "reviews", "directories=no,height=400,location=no,menubar=no,scrollbars=yes,status=no,resizable=1,width=600"); } 

function ViewInquiries(page) {var cal = window.open(page, "inquiries", "directories=no,height=300,location=no,menubar=no,scrollbars=yes,status=no,resizable=1,width=300"); } 


function OpenWindow(page,width,height) {var cal = window.open(page, "popup", "directories=no,height=" + height + ",location=no,menubar=no,scrollbars=yes,status=no,resizable=1,width=" + width + ""); } 


var notepad_page
	var paddir
	// BROWSER CHECK
	browser = navigator.appName;
	appVer = parseInt(navigator.appVersion);
	ie = "Microsoft Internet Explorer";
	ns = "Netscape";
	if (browser == ns) {
			notepad_page = "_ns";
		}
	if (browser == ie) {
	        notepad_page = "_ie";
			
	} 

if(document.all || document.layers || document.getElementById) {
	document.write('<' + 'SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="http://www.ivacationrentals.com/inc/js/notepad'+notepad_page+'.js"></' + 'SCRIPT>');
	document.write('<' + 'SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="http://www.ivacationrentals.com/inc/js/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();
}
}


// google keyword scripts

google_ad_client = "pub-8753942663724567";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "427608";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
// end google information





