
var message="Sorry, that function is disabled.\nThis Page is Copyrighted and all Images and Text are protected!\nALL RIGHTS RESERVED"; 
function click(e) {
	if (document.all) {
	if (event.button == 2) {
	alert(message);
	return false;
	}
}
	if (document.layers) {
	if (e.which == 3) {
	alert(message);
	return false; 
	}
}
}
    if (document.layers) {
    document.captureEvents(Event.MOUSEDOWN);
}
    document.onmousedown=click;
	function errorsuppressor(){
		window.status = 'JavaScript Error';
		return true;
	}
	window.onerror=errorsuppressor
function Goto(windowname,url){
window.open(url, windowname, "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=460,height=460")
}
var br
if(navigator.appName == "Netscape" && navigator.appVersion.charAt(0)=="4"){br="N";}
else if(navigator.appName == "Microsoft Internet Explorer" && document.all != null){br="IE";}
else if(navigator.appName == "Netscape" && document.getElementById != null && navigator.appVersion.charAt(0)=="5"){br="N5";}
else{br=null}

function go(box) {
		var val = box.options[box.selectedIndex].value;
		if (val != "") {
					window.location.href = val;
				}
			}
			
function OpenWindow(page){ var cal = window.open(systranURL(page), "popup", "directories=no,height=500,location=no,menubar=no,scrollbars=yes,status=no,resizable=1,width=600"); 
} 

function OpenCalendar(page){ var cal = window.open(systranURL(page), "AvailCal", "fullscreen,directories=no,location=no,menubar=no,scrollbars=yes,status=yes,resizable=1"); 
} 

function PopUp(URL,Window,w,h,x,y) {
	var popupwin = window.open(URL,Window,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+w+",height="+h+",left="+x+",top="+y);
}
function NLPopUp() {
	PopUp(systranURL('/newsletter_signup.asp'),'NL','450','360','25','25');
}
function OpenTest() {
	PopUp(systranURL('/testimonials.asp'),'Test','590','360','10','10');
}
function OpenFair() {
	PopUp('http://www.nextfares.com/nf/mask.asp?dn=6740528','Test','700','500','100','100');
}
function OpenRes() {
	window.open(systranURL('/reservation_request.asp'),'Res','fullscreen');
}
function OpenVideo() {
	ViewingVideo(systranURL('mms://wn71.reliablehosting.com/customer01/intro.asf'));
}
function Jump(Location) {
	opener.location.href = Location;window.close()
}
function ViewingVideo(sURL) {
        var msg = ("You must have an Internet Connection of 100k or above to view this Streaming Video. If you are on a 56k Modem you will not be able to view this Video..\n\nClick OK to View Video\nClick Cancel to abort viewing")
        if (confirm(msg))
		location.href(sURL);
		
}
// image flip
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
function changeImages() {
	if (document.images) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}
/*var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		index008 = newImage("images/site/index-08.gif");
		index010 = newImage("images/site/index-10.gif");
		index012 = newImage("images/site/index-12.gif");
		index014 = newImage("images/site/index-14.gif");
		index016 = newImage("images/site/index-16.gif");
		index018 = newImage("images/site/index-18.gif");
		index020 = newImage("images/site/index-20.gif");
		panorama002 = newImage("/images/site/menu/panorama-02.gif");
        more_pics002 = newImage("/images/site/menu/more_pics1.gif");
		more_pics1002 = newImage("/images/site/menu/more_pics1-02.gif");
		more_pics002 = newImage("/images/site/menu/more_pics-02.gif");
		more_pics2002 = newImage("/images/site/menu/more_pics2-02.gif");
        more_pics002 = newImage("/images/site/menu/more_pics3.gif");
		more_pics3002 = newImage("/images/site/menu/more_pics3-02.gif");
		id2_3bed002 = newImage("/images/site/menu/2-3bed-02.gif");
		id4bed002 = newImage("/images/site/menu/4bed-02.gif");
		id5_9bed002 = newImage("/images/site/menu/5-9bed-02.gif");
		res_csl002 = newImage("/images/site/menu/button_csl2.gif");
		res_cor002 = newImage("/images/site/menu/button_cor2.gif");
		res_sjc002 = newImage("/images/site/menu/button_scj2.gif");
		view_map002 = newImage("/images/site/menu/view_map2.gif");
		sp_button002 = newImage("/images/site/menu/sp_button2.gif");
		tes_button002 = newImage("/images/site/menu/tes_button2.gif");
		svideo002 = newImage("/images/site/menu/svideo2.gif");
		preloadFlag = true;
	}
}
preloadImages();
*/
// data for the menu
menuData = new Array()
for (i=0; i < 10; i++) {
	menuData[i] = new Array(40)
	for (j=0; j < 20; j++) {
		menuData[i][j] = new Array(2)}}


// accommodations
menuData[0][0][0]="Chaletes Y Recursos";
menuData[0][0][1]=systranURL("/accommodations.asp");
menuData[0][1][0]="Chaletes";
menuData[0][1][1]=systranURL("/villas.asp");
menuData[0][2][0]="Recursos y hoteles";
menuData[0][2][1]=systranURL("/resorts.asp");
menuData[0][3][0]="Todo Inclusivo Recurso";
menuData[0][3][1]=systranURL("/all_inclusive_resorts.asp");
menuData[0][4][0]="Specials";
menuData[0][4][1]=systranURL("/specials.asp");
menuData[0][5][0]="Sobre Nosotros";
menuData[0][5][1]=systranURL("/about_us.asp");
menuData[0][6][0]="Éntrenos en contacto con";
menuData[0][6][1]=systranURL("/contact_us.asp");
menuData[0][7][0]="Email Nosotros";
menuData[0][7][1]="mailto:info@cabovillas.com";


//activities
menuData[1][0][0]="Pesca";
menuData[1][0][1]=systranURL("/fishing.asp");
menuData[1][1][0]="Golf";
menuData[1][1][1]=systranURL("/golfing.asp");
menuData[1][2][0]="Salto";
menuData[1][2][1]=systranURL("/diving.asp");
menuData[1][3][0]="Viajes y travesías";
menuData[1][3][1]=systranURL("/tours.asp");
menuData[1][4][0]="El cenar";
menuData[1][4][1]=systranURL("/dining.asp");
menuData[1][5][0]="Compras";
menuData[1][5][1]=systranURL("/shopping.asp");
menuData[1][6][0]="Calendario De los Acontecimientos";
menuData[1][6][1]=systranURL("/events.asp");


//information
menuData[2][0][0]="Petición Del Folleto";
menuData[2][0][1]=systranURL("/brochure.asp");
menuData[2][1][0]="Club Del Recorrido De Amigo";
menuData[2][1][1]=systranURL("/amigo_travel_club.asp");
menuData[2][2][0]="Enumere su característica";
menuData[2][2][1]=systranURL("/list_your_property.asp");
menuData[2][3][0]="Mapas";
menuData[2][3][1]=systranURL("/maps.asp");
menuData[2][4][0]="Tiempo";
menuData[2][4][1]=systranURL("/weather.asp");
menuData[2][5][0]="El Conseguir A Cabo";
menuData[2][5][1]=systranURL("/getting_there.asp");
menuData[2][6][0]="Costumbres";
menuData[2][6][1]=systranURL("/customs.asp");
menuData[2][7][0]="Usted Debe Saber";
menuData[2][7][1]=systranURL("/youshouldknow.asp");
menuData[2][8][0]="Preguntas";
menuData[2][8][1]=systranURL("/faq.asp");
menuData[2][9][0]="Galería De la Foto";
menuData[2][9][1]=systranURL("/photo_gallery.asp");
menuData[2][10][0]="Vídeos De Cabo";
menuData[2][10][1]="/videos.asp";
menuData[2][11][0]="Propiedades Inmobiliarias";
menuData[2][11][1]=systranURL("/real_estate.asp");
menuData[2][12][0]="Prensa";
menuData[2][12][1]=systranURL("/press.asp");
menuData[2][13][0]="Boletín de Noticias";
menuData[2][13][1]=systranURL("/newsletters.asp");
menuData[2][14][0]="Términos Y Condiciones";
menuData[2][14][1]=systranURL("/terms.asp");
menuData[2][15][0]="Avisos Legales";
menuData[2][15][1]=systranURL("/legal_notices.asp");


//reservations
menuData[3][0][0]="Petición De la Reservación";
menuData[3][0][1]="javascript:OpenRes();";
menuData[3][1][0]="Compruebe Airfare";
menuData[3][1][1]="javascript:OpenFair();";
//menuData[3][2][0]="Cartas Del Jet";
//menuData[3][2][1]="jet_charters.asp";
menuData[3][2][0]="Specials";
menuData[3][2][1]=systranURL("/specials.asp");
menuData[3][3][0]="Alquileres de coches";
menuData[3][3][1]=systranURL("/carrentals.asp");
menuData[3][4][0]="Transporte";
menuData[3][4][1]=systranURL("/transportation.asp");
//menuDat[3][6][0]="Muestra-Para arriba Del Boletín de noticias";
//menuData[3][6][1]="javascript:NLPopUp()";


//services
menuData[4][0][0]="Servicios Del Chalet";
menuData[4][0][1]=systranURL("/special_services.asp");
menuData[4][1][0]="Servicios del cocinero";
menuData[4][1][1]=systranURL("/chefs_menu.asp");
menuData[4][2][0]="Servicios Del Balneario";
menuData[4][2][1]=systranURL("/spa_services.asp");
menuData[4][3][0]="Servicios De la Boda";
menuData[4][3][1]=systranURL("/weddings.asp");
menuData[4][7][0]="Club Del Cabrito";
menuData[4][7][1]=systranURL("/kidsclub.asp");
menuData[4][8][0]="Seguro Del Recorrido";
menuData[4][8][1]=systranURL("/travel_guard.asp");


// notepad
menuData[5][0][0]="Abra La Libreta";
menuData[5][0][1]="javascript:OpenNotePade();";
menuData[5][1][0]="Cierre La Libreta";
menuData[5][1][1]="javascript:objNotePad.Hide();";
menuData[5][2][0]="Sobre La Libreta";
menuData[5][2][1]=systranURL("/about_notepad.asp");


// drop down functions
// define menu attributes hereF"
menuColor="#006CAA"
menuColorOn="#FCD832"
fontColorOn="#006CAA"
fontColorOff="#FFFFFF"
lineColor = "#006CAA"
separator="<img src=/images/site/spacer.gif height=1 width=1>"
// shows the drop down menu expected arg is active div
function showDDNav(){
	args = showDDNav.arguments;
	var divName = args[0];
	var divRef;
	
	if(br=="N"){
		divRef=eval("document." + divName);
		if(divRef.visibility=='hide'){
			divRef.visibility = 'show';
		}
	} else {
		if (br=="NS6") {
			divRef=eval("document.getElementById('" + divName + "')");
		} else {
			divRef=eval("document.all." + divName);
		}
		if(divRef.style.visibility=='hidden'){
			divRef.style.visibility = 'visible';
		}
	}
}
// hides the drop down menu 
// expected arg is active div 
function hideDDNav(){
	args = hideDDNav.arguments;
	var divName = args[0];
	var divRef;
	
	if(br=="N"){
		divRef=eval("document." + divName);
		if(divRef.visibility=='show'){
			divRef.visibility = 'hide';
		}
	} else {
		if (br=="NS6") {
			divRef=eval("document.getElementById('" + divName + "')");
		} else {
			divRef=eval("document.all." + divName);
		}
		if(divRef.style.visibility=='visible'){
			divRef.style.visibility = 'hidden';
		}
	}
}
// hides drop down menu when menu is active IE & NS6
// expected arg is active menu
function hideDiv(){
	args = hideDiv.arguments;
	var divName = args[0];
	var divRef;
	// fix menu flicker problem in IE
	if(br=="IE"){
		divRef=eval("document.all." + divName);
		// calculate active size of menu
		leftDiv=divRef.offsetLeft +2
		rightDiv=divRef.offsetLeft + divRef.clientWidth -2
		topDiv=divRef.offsetTop +2
		bottomDiv=divRef.offsetTop + divRef.clientHeight -2		
		if(window.event.clientY > bottomDiv || 
			window.event.clientY < topDiv || 
			window.event.clientX < leftDiv || 
			window.event.clientX > rightDiv){
				divRef.style.visibility = 'hidden';
		}
	// NS6
	} else {
		divRef=eval("document.getElementById('" + divName + "')");
		divRef.style.visibility = 'hidden';
	}	
}
// highlight menuitem in IE & NS6
// expected arg is active menuitem
function divOver(){
	args = divOver.arguments;
	var divName = args[0];
	var divRef;
	
	if (br=="NS6") {
		divRef=eval("document.getElementById('" + divName + "')");
		divRef.style.cursor = "pointer";
	} else {
		divRef=eval("document.all." + divName);
	}
	divRef.style.backgroundColor = menuColorOn;
	divRef.style.color = fontColorOn;
	divRef.style.fontWeight = "bold";
}
// highlight off menuitem in IE & NS6
// expected arg is active menuitem
function divOut(){
	args = divOut.arguments;
	var divName = args[0];
	var divRef;
	
	if (br=="NS6") {
		divRef=eval("document.getElementById('" + divName + "')");
	} else {
		divRef=eval("document.all." + divName);
	}
	divRef.style.backgroundColor=menuColor;
	divRef.style.color = fontColorOff;
	divRef.style.fontWeight = "normal";
}
// highlight on menuitem in netscape 4.x expected arg is active menuitem
function menuOver(){
	var args, theMenu;
	args = menuOver.arguments;
	theMenu = eval(args[0]);
	theMenu.bgColor=menuColorOn 
}
// highlight off menuitem in netscape 4.x expected arg is active menuitem
function menuOut(){
	var args, theMenu;
	args = menuOut.arguments;
	theMenu = eval(args[0]);
	theMenu.bgColor=menuColor 
}
// goes to specified url expected arg is url 
function gotoUrl(){
	args = gotoUrl.arguments;
	var CM_Location, CM_Javascript;
	if (CM_Javascript != -1) {CM_Location = args[0]}
	location.href = (CM_Location)
}
// hides specified tag
function hideElement(HTMLtag)
{
	for (i = 0; i < document.all.tags(HTMLtag).length; i++)
	{
		obj = document.all.tags(HTMLtag)[i];
		obj.style.visibility = "hidden";
	}
}
// shows specified tag
function showElement(HTMLtag)
{
	for (i = 1; i < document.all.tags(HTMLtag).length; i++)
	{
		obj = document.all.tags(HTMLtag)[i];
		obj.style.visibility = "visible";
	}
}
// build the divs for IE & Netscape 6
// expected args are 'div name','x in menudata aray','menu left coord','top in pixels' 
var tdID = 0
function doDiv(){
	args = doDiv.arguments;
	var divID = args[0];
	var x = args[1];
	var divLeft = args[2];
	var divTop = args[3];
	var divWidth = args[4];
	objDiv = "<div id=\"" + divID + "\" style=\"position:absolute; width:" + divWidth + "px; z-index:2; top:"+ divTop +"px; left: " + divLeft + "; background-color: #006CAA; border:1 solid #FFFFFF; visibility: hidden;\" onMouseover=\"showDDNav('"+ divID +"')\" onMouseout=\"hideDiv('"+ divID +"')\">"
	objDiv += "<div id=\"spacer\" style=\"position:relative; height:6px; width:" + eval(divWidth - 10) + "px; z-index:3; left: 5; font-size:1;\"></div>"
	
	for (y = 0; y < 17; y++){
	    if(menuData[x][y][0]!=null){
		
		   if(menuData[x][y][0]=="bar"){
		   
		   objDiv += "<div id=\"spacer\" style=\"position:relative; height:3px; width:" + eval(divWidth - 10) + "px; z-index:3; left: 5; font-size:1;\"></div>"
		   objDiv += "<div id=\"bar\" style=\"position:relative; height:1; width:" + eval(divWidth - 10) + "px; z-index:3; left: 5; background-color:#CCCCCC;\">" + separator + "</div>"
           objDiv += "<div id=\"spacer\" style=\"position:relative; height:3px; width:" + eval(divWidth - 10) + "px; z-index:3; left: 5; font-size:1;\"></div>"
		
		   } else {
		   
		   objDiv += "<div id=\"x" + tdID + "\" style=\"position:relative; background-color:"+ menuColor +"; width:" + eval(divWidth - 10) + "px; z-index:3; left: 5;\" onMouseover=\"divOver('x" + tdID + "')\" onMouseout=\"divOut('x" + tdID + "')\" class=\"dhtmlNav\" onClick=\"gotoUrl('"+menuData[x][y][1]+"')\">&nbsp;"+ menuData[x][y][0] +"&nbsp;</div>"
		   
		   }
		
		tdID = tdID +1
		}
	}
	objDiv += "<div id=\"bar\" style=\"position:relative; height:1; width:" + eval(divWidth - 10) + "px; z-index:3; left: 5; background-color:" + lineColor + ";\">" + separator + "</div>"
	objDiv += "<div id=\"spacer\" style=\"position:relative; height:6px; width:" + eval(divWidth - 10) + "px; z-index:3; left: 5; font-size:1;\"></div></div>"
	
	document.write(objDiv);
}
// build the layers for netscape4 expected args are 'div name','x in menudata aray','menu left coord','top in pixels' 
function doLayer(){
	args = doLayer.arguments;
	var nestLayerID=0
	var layerID = args[0];
	var x = args[1];
	var layerLeft = args[2];
	var layerTop = args[3];
	var layerWidth = args[4];
	if(navigator.platform.indexOf("Win") < 0){layerInc=16;layerStyle="netMenuMac";}
	else{layerInc=15;layerStyle="netMenu";}	
		
	objDiv = "<layer id=\""+ layerID +"\" Z-INDEX=1 BGCOLOR=\""+ menuColor +"\" WIDTH=" + layerWidth + " LEFT="+ layerLeft +" TOP="+ layerTop +" VISIBILITY=HIDE onmouseover=\"showDDNav('"+ layerID +"')\" onmouseout=\"hideDDNav('"+ layerID +"')\">"
	
	var nestTop=10
		for (y = 0; y < 17; y++){
				
		    if(menuData[x][y][0]!=null){
				if(menuData[x][y][0]=="bar"){
		   
			    objDiv += "<layer id=\"spacer\" BGCOLOR=\""+ menuColor +"\" WIDTH=" + eval(layerWidth - 10) + " HEIGHT=5 Z-INDEX=8 LEFT=5 TOP="+ nestTop +">"+ separator +"</layer>"
				nestLayerID=nestLayerID+1
				nestTop=nestTop+5			    
				
				objDiv += "<layer id=\"line2\" BGCOLOR=#CCCCCC WIDTH=" + eval(layerWidth - 10) + " HEIGHT=1 Z-INDEX=11 LEFT=5 TOP="+ nestTop +">"+ separator +"</layer>"
				nestLayerID=nestLayerID+1
				nestTop=nestTop+1
				
				objDiv += "<layer id=\"spacer2\" BGCOLOR=\""+ menuColor +"\" WIDTH=" + eval(layerWidth - 10) + " HEIGHT=5 Z-INDEX=8 LEFT=5 TOP="+ nestTop +">"+ separator +"</layer>"				
				nestLayerID=nestLayerID+1
				nestTop=nestTop+5
				
				} else {
		   			    
				objDiv += "<layer id=\"x"+nestLayerID+"\" class=\""+ layerStyle +"\" Z-INDEX=7 BGCOLOR=\""+ menuColor +"\" HEIGHT=19 WIDTH=" + eval(layerWidth - 10) + " LEFT=5 TOP="+ nestTop +" onmouseover=\"menuOver('document.layers[\\'"+ layerID +"\\'].document.layers[\\'x"+nestLayerID+"\\']')\" onmouseout=\"menuOut('document.layers[\\'"+ layerID +"\\'].document.layers[\\'x"+nestLayerID+"\\']')\"><a id=navstyle  href=javascript:gotoUrl('"+menuData[x][y][1]+"')><font color=" + fontColorOff + ">"+ menuData[x][y][0]
				objDiv +="</font></a></layer>"		
				nestLayerID=nestLayerID+1
				nestTop=nestTop+layerInc+1
							
				}
			
			}
		}
		//objDiv += "<layer id=\"line2\" BGCOLOR=\""+ lineColor +"\" WIDTH=" + eval(layerWidth - 10) + " LEFT=5 HEIGHT=1 Z-INDEX=8 TOP="+ nestTop +">"+ separator +"</layer>"
		objDiv +="<layer id=\"lineEnd\" BGCOLOR=\""+ menuColor +"\" WIDTH=" + layerWidth + " HEIGHT=8 Z-INDEX=7 TOP="+ nestTop +"></layer></layer>"
	document.write(objDiv)
}
// Netscape Resize Function for Layers
//function reDo(){window.location.reload()}
//function setResize(){setTimeout("window.onresize=reDo",500);}
//	if(br=="N"){
//	window.onload = setResize;
//}
// layers
if(br=="N"){
	doDiv('accommodations',0,15,125,150)
	doDiv('activities',1,312,125,150)
	doDiv('information',2,387,125,150)
	doDiv('reservations',3,140,125,150)
	doDiv('specials',4,242,125,150)
	doDiv('NotePad',5,475,125,105)
}
else {
	doDiv('accommodations',0,15,125,150)
	doDiv('activities',1,312,125,150)
	doDiv('information',2,387,125,150)
	doDiv('reservations',3,140,125,150)
	doDiv('specials',4,242,125,150)
	doDiv('NotePad',5,475,125,105)
}
// style sheets info
browser = navigator.appName;
  version = navigator.appVersion;
  os = navigator.platform;
  ie = "Microsoft Internet Explorer";
  nn = "Netscape";
    // sniff for netscape
  if (browser == nn) {
  	// sniff for Mac and give them the default stylesheet
    if (os == "MacPPC") {
  	  document.write('<link href="/css/default.css" rel="stylesheet" type="text/css" title="master">');
	}
	// sniff for anything greater than version 4 of Netscape and give them the default stylesheet
	if (version.charAt(0) > 4) {
	  document.write('<link href="/css/default.css" rel="stylesheet" type="text/css" title="master">');
	}
	// give Netscape 4.x users the netscape stylesheet
	else {
	  document.write('<link href="/css/netscape.css" rel="stylesheet" type="text/css" title="master">');
  	}
  }
  // give everyone else (IE) the default stylesheet
  else {
    document.write('<link href="/css/default.css" rel="stylesheet" type="text/css" title="master">');
  }
// reload the window upon resize to fix a bug in Netscape 4.x
var br
if(navigator.appName == 'Netscape') {
	if(document.layers) {br="N"}
	else if(document.getElementById) {br="NS6"}
} else{br="IE";}
function reDo(){window.location.reload()}
function setResize(){setTimeout("window.onresize=reDo",500);}
	if(br=="N"){
	window.onload = setResize;
}
//if (browser == nn) {
//	document.write('<link rel=stylesheet type="text/css" href="/css/netscape.css" title=master>');
//} 
//else {
//	document.write('<link rel=stylesheet type="text/css" href="/css/default.css" title=master>');
//}
//js library
function OpenScrollingPopup(URL, width, height) {
	window.self.name = "main";
	var now = new Date();
	var remote = window.open(systranURL(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.cabovillas.com' ? '' : '')
			+ (strExp == '' ? '' : ';expires=' + strExp);
}
function setCookieWithPath(strName, strValue, strPath, strExp) {
	document.cookie = strName + '=' + strValue
			+ (document.location.hostname == 'www.cabovillas.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 -----



