var MGBOX_ASSIST_CGI_TEMPLATE="/index/ajaxsearch.php?type=@&s=";

var CURRENT_SIMPLE_SEARCH_ID = "origSimpleSearch";

function simpleSearchCheck(simpleSearchType) {

  document.getElementById('searchAdvFrmSurfBreak').style.display = 'none';
  document.getElementById('searchAdvFrmCelltographer').style.display = 'none';
  document.getElementById('searchAdvFrmMsgText').style.display = 'none';
  document.getElementById('searchAdvFrmDate').style.display = 'none';

  switch (simpleSearchType.options[simpleSearchType.selectedIndex].value) {
    case 'celltographer' :
      document.getElementById('searchAdvFrmCelltographer').style.display = 'block';
      break;
    case 'date' :
      document.getElementById('searchAdvFrmDate').style.display = 'block';
      break;
    case 'msgtext' :
      document.getElementById('searchAdvFrmMsgText').style.display = 'block';
      break;
    case 'surfbreak' :
      document.getElementById('searchAdvFrmSurfBreak').style.display = 'block';
      break;
    case 'all' :
      document.getElementById('searchAdvFrmSurfBreak').style.display = 'block';
      document.getElementById('searchAdvFrmCelltographer').style.display = 'block';
      document.getElementById('searchAdvFrmMsgText').style.display = 'block';
      document.getElementById('searchAdvFrmDate').style.display = 'block';
      break;
  }
}

function updateSimpleSearchInput(newID, isMsgBox) {
  var searchEl = document.getElementById(CURRENT_SIMPLE_SEARCH_ID);
  if (isMsgBox) {
    searchEl.onfocus = theMgBox.onFocus;
    searchEl.onblur = theMgBox.onBlur;
  } else {
    searchEl.onfocus = undefined;
    searchEl.onblur = undefined;
  }
  searchEl.value = '';
  searchEl.id = newID;
  CURRENT_SIMPLE_SEARCH_ID = newID;
}

function showHide(inID) {
    if (document.getElementById(inID).style.display == 'none') {
        document.getElementById(inID).style.display = 'block';
    } else {
        document.getElementById(inID).style.display = 'none';
    }
}

/** Rollover Images **/

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		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) {

    // Beginning of image inserts

    //Top Nav
	sccphot_rollover_01_over = newImage("images/sccphot-rollover_01-over.gif");



	 //Log in
	enter_button_01_over = newImage("images/enter_button_01-over.gif");



	  //Search
search_button_01_over = newImage("images/search_button_01-over.gif");




     // End of image inserts

		preloadFlag = true;
	}
}


/** Drop down menus - Transmenus **/

		function init() {
			if (TransMenu.isSupported()) {
				TransMenu.initialize();

//Menu 1
				//menu1.onactivate = function() { document.getElementById("AfricanTravel").className = "other"; };
				//menu1.ondeactivate = function() { document.getElementById("AfricanTravel").className = "other"; };

//Menu 2
				//menu2.onactivate = function() { document.getElementById("About_Us-over").className = "other"; };
				//menu2.ondeactivate = function() { document.getElementById("About_Us-over").className = "other"; };

//Menu 3
				menu3.onactivate = function() { document.getElementById("About_Us").className = ""; };
				menu3.ondeactivate = function() { document.getElementById("About_Us").className = ""; };








								menu2.onactivate = function() { document.getElementById("Adventure").className = ""; };
				menu2.ondeactivate = function() { document.getElementById("Adventure").className = ""; };

//Menu 4
				//menu4.onactivate = function() { document.getElementById("IndianOceanIslands").className = "other"; };
				//menu4.ondeactivate = function() { document.getElementById("IndianOceanIslands").className = "other"; };


//Menu 5
				//menu5.onactivate = function() { document.getElementById("Honeymoons").className = "other"; };
				//menu5.ondeactivate = function() { document.getElementById("Honeymoons").className = "other"; };

//Menu 6
				//menu6.onactivate = function() { document.getElementById("WorldTravel").className = "other"; };
				//menu6.ondeactivate = function() { document.getElementById("WorldTravel").className = "other"; };
		}
}





/** Pop up Window **/

	var detailsWindow1a;
    var detailsWindow1b;
    var detailsWindow2;
    var timerID1a;
    var timerID1b;
    var timerID2;

    function openPortrait(theURL)
	{

        clearTimeout(timerID1a);

        detailsWindow1a=window.open (theURL,"PortWindow1a","width=510,height=771");
        detailsWindow1a.focus();

        timerID1a = setTimeout("detailsWindow1a.close()",30000);



	}
        function openPortrait2(theURL)
	{
		clearTimeout(timerID1b);

        detailsWindow1b=window.open (theURL,"PortWindow1b","width=265,height=400");
        detailsWindow1b.focus();

        timerID1b = setTimeout("detailsWindow1b.close()",30000);

	}
    function openLandscape(theURL)
	{
		clearTimeout(timerID2);

        detailsWindow2=window.open (theURL,"LandWindow2","width=660,height=295");
        detailsWindow2.focus();

        timerID2 = setTimeout("detailsWindow2.close()",30000);

	}



function makeBMark(title,url)
{
    if (window.sidebar)
    {
        window.sidebar.addPanel(title, url,"");
        alert("Firefox users: This link will open in your Sidebar\nrather than the main page!\nTo prevent this please right click the link and choose\n'Properties' and then uncheck the box marked:\n'Load This Bookmark in the Sidebar'\n\nSorry about this, but it is unavoidable with Firefox");

    } else if( window.opera && window.print )
    {
    alert("Opera users: By Default this link will open in your Sidebar\nrather than the main page!\nTo prevent this please uncheck the box marked\n'Show in Panel' that appears on the Add Bookmark window\n\nSorry about this, but it is currently unavoidable with Opera");
    var mbm = document.createElement('a');
    mbm.setAttribute('rel','sidebar');
    mbm.setAttribute('href',url);
    mbm.setAttribute('title',title);
    mbm.click();
    } else if( document.all )
    {
    window.external.AddFavorite( url, title);
    }
}

/* Message appear for right click, doesn't really work!!

function click(e) 
{
var message = "No!";

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;

*/



// Disable Select
// document.onselectstart=function(){return false};

// Disable Right Click
document.oncontextmenu=function(){return false};
if(navigator.appName=="Netscape"){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=function(e)
{if(e.which==2||e.which==3)return false}
};
