<!--GLOBAL VARIABLES-->
var winHeight;
var seconds=0;
var varx=0;
var vary=0;
<!--END GLOBAL VARIABLES-->

var theViewerObj;
var theViewerName = "floating_viewer";
var floatingTimerId;
var floatingText;
var floatingMenuArray = new Array;
/*
floatingMenuArray[1]="<b><a href='/'>Family Home</a></b>"
Family /tags/family/
floatingMenuArray[2]="<b><a href='/'>About Us</a></b>"
floatingMenuArray[3]="<b><a href='/'>About You</a></b>"
floatingMenuArray[4]="<b><a href='/'>Type of Trips</a></b>"
floatingMenuArray[5]="<b><a href='/'>School Breaks</a></b>"
floatingMenuArray[6]="<b><a href='/'>Resources</a></b>"
*/
floatingMenuArray[1]="<b><a href='/'></a></b>";
floatingMenuArray[2]="<b><a href='/'></a></b>";
floatingMenuArray[3]="<b><a href='/'></a></b>";
floatingMenuArray[4]="<b><a href='/'></a></b>";
floatingMenuArray[5]="<b><a href='/'></a></b>";
floatingMenuArray[6]="<b><a href='/'></a></b>";
<!--PLACE ALL YOUR BOX CONTENT HERE - Make sure you use a += after the first line -->
var floatingMenulinkArray = new Array;
floatingMenulinkArray[1]="<tr><td><a href='/web20/familytrips/home_family.php'></a></td></tr>";
<!-- Family /tags/family/ -->
floatingMenulinkArray[2]="<tr><td><a href='/'>Why JOURNEYS for Families</a></td></tr>";
<!-- Kirsten -->
floatingMenulinkArray[2]+="<tr><td><a href='/'>Meet the Specialists</a></td></tr>";
<!-- Tom -->
floatingMenulinkArray[2]+="<tr><td><a href='/'>Family Awards</a></td></tr>";
<!-- Kirsten -->
floatingMenulinkArray[2]+="<tr><td><a href='/'>Contact Us</a></td></tr>";
<!-- Contac form -->
floatingMenulinkArray[3]="<tr><td><a href='/web20/familytrips/family_travel_with_kids.php'>Travel with Kids</a></td></tr>";
<!-- Family /tags/family_-_traveling_with_kids/-->
floatingMenulinkArray[3]+="<tr><td><a href='/'>Travel with Teens</a></td></tr>";
<!-- Family l/tags/family_-_traveling_with_teens//-->
floatingMenulinkArray[3]+="<tr><td><a href='/'>Grandparent Travel</a></td></tr>";
<!-- Family /tags/family_-_grandparent_travel/-->
floatingMenulinkArray[3]+="<tr><td><a href='/'>Multi-generational Travel</a></td></tr>";
<!-- Family /tags/family_-_multi-generational_travel/-->
floatingMenulinkArray[3]+="<tr><td><a href='/'>Educational Travel</a></td></tr>";
<!-- Family /tags/family_-_educational_travel/-->
floatingMenulinkArray[3]+="<tr><td><a href='/'>Around the World/Multiple Countries</a></td></tr>";
<!-- Family /tags/family_-_traveling_to_multiple_countries/-->
floatingMenulinkArray[4]="<tr><td><a href='/'>Safaris with Families</a></td></tr>";
<!-- Family /tags/family_safaris/-->
floatingMenulinkArray[4]+="<tr><td><a href='/'>Wildlife Trips for Families</a></td></tr>";
<!-- Family /tags/family_wildlife_trips/-->
floatingMenulinkArray[4]+="<tr><td><a href='/'>Trekking for Families</a></td></tr>";
<!-- Family /tags/family_trekking_trips/-->
floatingMenulinkArray[4]+="<tr><td><a href='/'>Adventures for Families</a></td></tr>";
<!-- Family /tags/family_adventure_trips/-->
floatingMenulinkArray[4]+="<tr><td><a href='/'>Rainforest Trips for Families</a></td></tr>";
<!-- Family /tags/family_rain_forest_trips/-->
floatingMenulinkArray[4]+="<tr><td><a href='/'>Signature Family Trips</a></td></tr>";
<!-- Family /tags/family_signature_trips/-->
floatingMenulinkArray[5]="<tr><td><a href='/'>Spring Break Trips</a></td></tr>";
<!-- Family /tags/family_-_spring_break_trips/-->
floatingMenulinkArray[5]+="<tr><td><a href='/'>Christmas Break Trips</a></td></tr>";
<!-- Family /tags/family_-_christmas_break_trips/-->
floatingMenulinkArray[5]+="<tr><td><a href='/'>Summer Vacations</a></td></tr>";
<!-- Family /tags/family_-_summer_vacations/-->
floatingMenulinkArray[6]="<tr><td><a href='/'>Blogs (including Tips)</a></td></tr>";
<!-- Kirsten -->
floatingMenulinkArray[6]+="<tr><td><a href='/'>Trip Reviews</a></td></tr>";
<!-- format like http://www.journeys.travel/reviews/ -->

floatingMenulinkArray[6]+="<tr><td><a href='/'>Games</a></td></tr>";
<!-- Kirsten -->

function WhatBrowser(){
	var ua, s, i;
	this.isIE = false;
	this.isOther = false;
	//var dataBrowser = new Array("MSIE", "Netscape", "Safari", "Firefox", "Chrome", "OmniWeb", "Opera", "iCab", "KDE", "Camino", "Gecko");
	//KDE = Konqueror
	//navigator.platform - Win, Mac, iPhone, Linux
	ua = navigator.userAgent;
	s = "MSIE";
	if ((i = ua.indexOf(s)) >= 0) {
		this.isIE = true;
	}
	else{
		this.isOther = true;
	}
	this.version = parseFloat(ua.substr(i + s.length));
}


function getStyleValue(objId,styleProp){ 
	var curValue = 0; 
	var obj = document.getElementById(objId);
	if ((obj != null) && obj.currentStyle){ //if IE 
		curValue=eval("obj.currentStyle."+styleProp);
		//curValue = obj.currentStyle[styleProp];
	}
	else if (window.getComputedStyle) { //if Mozilla/FF 
		curValue=eval("document.defaultView.getComputedStyle(obj, null)."+styleProp);
		//curValue=document.defaultView.getComputedStyle(obj,null).getPropertyValue(styleProp);
	} 
	//alert('style attribute='+styleProp + '-value=' + curValue) 
	return curValue;
} 
function isMicrosoftIE(){
	var browser=navigator.appName;
    //alert("isMicrosoftIE browser=" + browser);
	if (browser == "Netscape") {
		return false;
	}
	else{
		return true;
	}	
}
function closeFloatingViewer() {
	//alert("closeFloatingViewer");
	if (theViewerObj != null){
		theViewerObj.innerHTML = ""
		theViewerObj.style.visibility="hidden"
	}
}
function floatingViewerTimer(sec) {
	//alert("floatingViewerTimer sec=" + sec);
	seconds=parseInt(sec);
	if(seconds>0) {
		seconds--;
		floatingTimerId=setTimeout("floatingViewerTimer(seconds)",700);
	}
	else{
		closeFloatingViewer();
	}
}
function setFloatingViewerObj(event,textelement,inleft,inwidth,inheight) {
	//clearTimeout(floatingTimerId);
	closeFloatingFamilyMenu();

	winWidth=inwidth;
	winHeight=inheight;
	floatingText=buildFloatingMenuText(textelement);
	var posx = 0;
	var posy = 0;
	
	if (isMicrosoftIE()){
		e = window.event;
		theViewerObj=document.getElementById(theViewerName);
		if (e.pageX || e.pageY) {
			posx = e.pageX;
			posy = e.pageY;
			//alert("pageX posx=" + posx + "-posy=" + posy);
		}
		else if (e.clientX || e.clientY) {
			posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
			posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
			//alert("clientX posx=" + posx + "-posy=" + posy);
		}

		x=posx;
		y=posy;
	}
	else{
		e = event;
		if (textelement == 1) {
			theViewerObj=document.getElementById("floating_family_menu1");		
		}
		else if (textelement == 2) {
			theViewerObj=document.getElementById("floating_family_menu2");		
		}
		else if (textelement == 3) {
			theViewerObj=document.getElementById("floating_family_menu3");		
		}
		else if (textelement == 4) {
			theViewerObj=document.getElementById("floating_family_menu4");		
		}
		else if (textelement == 5) {
			theViewerObj=document.getElementById("floating_family_menu5");		
		}
		else if (textelement == 6) {
			theViewerObj=document.getElementById("floating_family_menu6");		
		}
		else{
			theViewerObj=document.getElementById("floating_family_menu1");		
		}	
	}		
	
	if (theViewerObj != null){
		theViewerObj.style.width=winWidth
		theViewerObj.style.height=winHeight
		var contentText = "<table cellspacing=0 width="+winWidth+" height="+winHeight+" border=0><tr><td width=100% valign=top><font type='times' size='2' style='color:black;font-weight:normal'>"+floatingText+"</font></td></tr></table>"
		if (isMicrosoftIE()){
			theViewerObj.style.left=x
			theViewerObj.style.top=y
		}
		theViewerObj.innerHTML = contentText
		theViewerObj.style.zIndex = 101;	
		theViewerObj.style.visibility="visible"
		theViewerObj.style.display="inline";
	}
	//alert("setFloatingFamilyMenu id_fam_menu_first left=" + getStyleValue("id_fam_menu_first", "left") + "-top=" + getStyleValue("id_fam_menu_first", "top"));
}

function buildFloatingMenuText(value) {
	text="<table class='cls_float' width='"+(winWidth-4)+"'>"
	text+="<tr><td width='"+(winWidth-4)+"'>"
	text+=floatingMenuArray[value]
	text+="</td></tr>"
	text+="<tr><td width='"+winWidth+"'>"
	text+= floatingMenulinkArray[value]
	text+="</td></tr>"
	text+="</table>"
	return text
}

function setFloatingFamilyMenu(event,textelement,inleft,inwidth,inheight) {
	closeFloatingFamilyMenu();
	
	winWidth=inwidth;
	winHeight=inheight;	
	floatingText=buildFloatingMenuText(textelement);

	//theViewerObj=document.getElementById("floating_family_menu");
	if (textelement == 1) {
		theViewerObj=document.getElementById("floating_family_menu1");		
	}
	else if (textelement == 2) {
		theViewerObj=document.getElementById("floating_family_menu2");		
	}
	else if (textelement == 3) {
		theViewerObj=document.getElementById("floating_family_menu3");		
	}
	else if (textelement == 4) {
		theViewerObj=document.getElementById("floating_family_menu4");		
	}
	else if (textelement == 5) {
		theViewerObj=document.getElementById("floating_family_menu5");		
	}
	else if (textelement == 6) {
		theViewerObj=document.getElementById("floating_family_menu6");		
	}
	else{
		theViewerObj=document.getElementById("floating_family_menu1");		
	}	
	theViewerObj.style.width=inwidth;
	theViewerObj.style.height=inheight;
	var contentText = "<table cellspacing=0 width="+winWidth+" height="+winHeight+" border=0><tr><td width=100% valign=top><font type='times' size='2' style='color:black;font-weight:normal'>"+floatingText+"</font></td></tr></table>"
	theViewerObj.innerHTML = contentText;
	if (textelement < 2) {
		theViewerObj.innerHTML = "";
	}
	theViewerObj.style.zIndex = 101;	
	theViewerObj.style.visibility="visible";
	theViewerObj.style.display="inline";
	//alert("setFloatingFamilyMenu id_fam_menu left=" + getStyleValue("id_fam_menu", "left") + "-top=" + getStyleValue("id_fam_menu", "top"));
	//alert("setFloatingFamilyMenu id_all_fam_menu left=" + getStyleValue("id_all_fam_menu", "left") + "-top=" + getStyleValue("id_all_fam_menu", "top"));
	//alert("setFloatingFamilyMenu floating_family_menu1 left=" + getStyleValue("floating_family_menu1", "left") + "-top=" + getStyleValue("floating_family_menu1", "top"));
}
function closeFloatingFamilyMenu() {
	//alert("closeFloatingFamilyMenu closeFloatingViewer1");
	for (var textelement = 1; textelement <= 6; textelement=textelement+1){
		if (textelement == 1) {
			theViewerObj=document.getElementById("floating_family_menu1");		
		}
		else if (textelement == 2) {
			theViewerObj=document.getElementById("floating_family_menu2");		
		}
		else if (textelement == 3) {
			theViewerObj=document.getElementById("floating_family_menu3");		
		}
		else if (textelement == 4) {
			theViewerObj=document.getElementById("floating_family_menu4");		
		}
		else if (textelement == 5) {
			theViewerObj=document.getElementById("floating_family_menu5");		
		}
		else if (textelement == 6) {
			theViewerObj=document.getElementById("floating_family_menu6");		
		}
		else{
			theViewerObj=document.getElementById("floating_family_menu1");		
		}
		
		if (theViewerObj != null){
			theViewerObj.innerHTML = "";
			theViewerObj.style.height = 0;
			theViewerObj.style.width = 0;
			theViewerObj.style.zIndex = -10;
			theViewerObj.style.visibility="hidden";
			theViewerObj.style.display="none";
		}
		//alert("closeFloatingViewer2 textelement=" + textelement + "-theViewerObj=" + theViewerObj);
	}
	var theFloatingViewerObj=document.getElementById(theViewerName);		
	if (theFloatingViewerObj != null){
		theFloatingViewerObj.innerHTML = "";
		theFloatingViewerObj.style.height = 0;
		theFloatingViewerObj.style.width = 0;
		theFloatingViewerObj.style.zIndex = -10;
		theFloatingViewerObj.style.visibility="hidden";
		theFloatingViewerObj.style.display="none";
	}
}
function showSubmenu(objName, menuClciked){
	var mnuObj=null;
	var submnuObj=null;
	if (objName == "mmnu_about_us"){
		mnuObj = document.getElementById("mmnu_about_us");
		submnuObj = document.getElementById("submnu_about_us");
	}
	else if (objName == "mmnu_about_you"){
		mnuObj = document.getElementById("mmnu_about_you");
		submnuObj = document.getElementById("submnu_about_you");
	}
	else if (objName == "mmnu_type_of_trips"){
		mnuObj = document.getElementById("mmnu_type_of_trips");
		submnuObj = document.getElementById("submnu_type_of_trips");
	}
	else if (objName == "mmnu_school_breaks"){
		mnuObj = document.getElementById("mmnu_school_breaks");
		submnuObj = document.getElementById("submnu_school_breaks");
	}
	else {
		mnuObj = document.getElementById("mmnu_resources");
		submnuObj = document.getElementById("submnu_resources");
	}
	
	if (mnuObj != null){
		if (objName == menuClciked) {
			mnuObj.style.backgroundColor = "#330099";
		}
		else{
			mnuObj.style.backgroundColor = "#5c439b";
		}
		//alert("objName=" + objName + "-menuClciked=" + menuClciked + "-bcolor=" + mnuObj.style.backgroundColor);
	}
	if (submnuObj != null){
		submnuObj.style.visibility="visible";
		submnuObj.style.display="inline";
	}
}	
function closeSubmenu(objName, menuClciked){
	var mnuObj=null;
	var submnuObj=null;
	if (objName == "mmnu_about_us"){
		mnuObj = document.getElementById("mmnu_about_us");
		submnuObj = document.getElementById("submnu_about_us");
	}
	else if (objName == "mmnu_about_you"){
		mnuObj = document.getElementById("mmnu_about_you");
		submnuObj = document.getElementById("submnu_about_you");
	}
	else if (objName == "mmnu_type_of_trips"){
		mnuObj = document.getElementById("mmnu_type_of_trips");
		submnuObj = document.getElementById("submnu_type_of_trips");
	}
	else if (objName == "mmnu_school_breaks"){
		mnuObj = document.getElementById("mmnu_school_breaks");
		submnuObj = document.getElementById("submnu_school_breaks");
	}
	else {
		mnuObj = document.getElementById("mmnu_resources");
		submnuObj = document.getElementById("submnu_resources");
	}
	
	if (mnuObj != null){
		if (objName == menuClciked) {
			mnuObj.style.backgroundColor = "#330099";
		}
		else{
			mnuObj.style.backgroundColor = "#94ab6f";
		}
		//alert("objName=" + objName + "-menuClciked=" + menuClciked + "-bcolor=" + mnuObj.style.backgroundColor);
	}
	if (submnuObj != null){
		submnuObj.style.visibility="hidden";
		submnuObj.style.display="none";
	}
}	
function highlightMainMenu(objName){
	var mnuObj=null;
	if (objName == "mmnu_about_us"){
		mnuObj = document.getElementById("mmnu_about_us");
	}
	else if (objName == "mmnu_about_you"){
		mnuObj = document.getElementById("mmnu_about_you");
	}
	else if (objName == "mmnu_type_of_trips"){
		mnuObj = document.getElementById("mmnu_type_of_trips");
	}
	else if (objName == "mmnu_school_breaks"){
		mnuObj = document.getElementById("mmnu_school_breaks");
	}
	else {
		mnuObj = document.getElementById("mmnu_resources");
	}
	
	if (mnuObj != null){
		//mnuObj.style.backgroundColor = "#94ab6f";
		mnuObj.style.backgroundColor = "#330099";
	}
	//alert("objName=" + objName + "-mnuObj=" + mnuObj + "-color=" + mnuObj.style.backgroundColor);
}	
function toggleSpecialist(specialistId){
	var theObj = null;	
	for (var i=1; i <= 4; i++){
		theObj = eval("document.getElementById('main" + i + "')");
		if (theObj != null){
			theObj.style.display="none";
		}
	}
	
	theObj = eval("document.getElementById('" + specialistId + "')");	
	//alert("specialistId=" + specialistId +"-theObj=" + theObj);
	if (theObj != null){
		theObj.style.display="inline";
	}
}

function toggleSpecialistImage(specialistId){
	
	var theObj = null;	
	var idpartial = specialistId.substring(1)
	for (var i=1; i <= 4; i++){
		theObj = eval("document.getElementById('id_fam_specialist" + i + idpartial + "')");
		if (theObj != null){
			theObj.style.display="none";
		}
	}

	theObj = eval("document.getElementById('id_fam_specialist" + specialistId + "')");	
	//alert("specialistId=" + specialistId +"-theObj=" + theObj);
	if (theObj != null){
		theObj.style.display="inline";
	}
}

function familyBlogPopup(url, name, w, h, scroll, pos){
	url = "http://journeysforfamilies.journeysblog.com/";
	name = "Journeys Blogs (including Tips)";
	w = 1200;
	h = 700;
	scroll = 'yes';
	pos = 'center';
	
	var LeftPosition = 0;
	var TopPosition = 0;
	if(pos == "random"){
    	LeftPosition = (screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
    	TopPosition = (screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
  	}
  	if(pos == "center"){
    	LeftPosition = (screen.width)?(screen.width-w)/2:100;
    	TopPosition = (screen.height)?(screen.height-h)/2:100;
  	}
	else if((pos !="center" && pos !="random") || pos==null){
      	LeftPosition=0;
      	TopPosition=20;
    }
  
  	var settings = "width="+w+",height="+h+",top="+TopPosition+",left="+LeftPosition+",scrollbars="+scroll+",location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes";
  	//var settings = "width="+w+",height="+h+",top="+TopPosition+",left="+LeftPosition+",location=no,directories=no,status=no,menubar=no,toolbar=no";

  	var win = window.open("http://journeysforfamilies.journeysblog.com", "Journeys_Blogs", settings);

  	if(!win.focus()){
    	win.focus();
  	}
  	return win;
 }
function amazonStorePopup(url){
	name = "Journeys Amazon Store";
	var w = 1000;
	var h = 750;
	var scroll = 'yes';
	var pos = 'center';
	
    var LeftPosition = (screen.width)?(screen.width-w)/2:100;
    var TopPosition = (screen.height)?(screen.height-h)/2:100;
  
  	var settings = "width="+w+",height="+h+",top="+TopPosition+",left="+LeftPosition+",scrollbars="+scroll+",location=yes,directories=yes,status=yes,menubar=yes,toolbar=yes,resizable=yes";
  	var win = window.open(url, "Journeys_Amazon_Store", settings);
  	if(!win.focus()){
    	win.focus();
  	}
  	return win;
 }	
 
<!--END GLOBAL FUNCTIONS-->
