﻿	// Detect if the browser is IE or not.
	// If it is not IE, we assume that the browser is NS.
	var IE = document.all?true:false

	// If NS -- that is, !IE -- then set up for mouse capture
	if (!IE) document.captureEvents(Event.MOUSEMOVE)

	// Set-up to use getMouseXY function onMouseMove
	document.onmousemove = getMouseXY;
	// Temporary variables to hold mouse x-y pos.s
	var tempX = 0;
	var tempY = 0;
	var id_div= null;

function getMouseXY(e) {

  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft;
    tempY = event.clientY + document.body.scrollTop;
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX;
    tempY = e.pageY;
  }  
  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  if (id_div!=null)
  {
	
	if (IE) {tempX = (tempX + 15)}
	else  {tempX = (tempX + 17)}

	id_div.style.left = tempX + 'px';	
	
		//wH = ((GetWindowHeight() / 2) + GetScrollY() - (id_div.offsetHeight / 2));		
        //id_div.style.top  = wH + 'px';		
        id_div.style.top  = tempY + 'px';	
        id_div.style.display='';	
  }
  return true
}
		
/* Set Menu Definition */
    var timeout = 500;
    var closetimer = 0;
    var ddmenuitem = 0;

    function jsddm_open() {
        jsddm_canceltimer();
        jsddm_close();
        ddmenuitem = $(this).find('ul').css('visibility', 'visible');
    }

    function jsddm_close()
    { if (ddmenuitem) ddmenuitem.css('visibility', 'hidden'); }

    function jsddm_timer()
    { closetimer = window.setTimeout(jsddm_close, timeout); }

    function jsddm_canceltimer() {
        if (closetimer) {
            window.clearTimeout(closetimer);
            closetimer = null;
        } 
    }

    //$(document).ready(function() {$('#jsddm > li').bind('mouseover', jsddm_open);$('#jsddm > li').bind('mouseout', jsddm_timer);});
    window.onload = function() {$('#jsddm > li').bind('mouseover', jsddm_open);$('#jsddm > li').bind('mouseout', jsddm_timer);};

    document.onclick = jsddm_close;
/* Set Menu Definition */

/* Set Search input to empty in get focus */
function emptySearch(el) {
    if (!el) return false;

    if (el.value == "search") {
        el.value = "";
    } else if (el.value == "") {
        el.value = "search";
    }
}
/* Set Search input to empty in get focus */

/* BEGIN LivePerson Monitor. */
var isHTTPS = (("https:" == document.location.protocol) ? "https" : "http");

if (isHTTPS=='https')
	{var lpMTagConfig = { 'lpServer': "server.iad.liveperson.net", 'lpNumber': "17283664", 'lpProtocol': "https"};}
else
	{var lpMTagConfig = { 'lpServer': "server.iad.liveperson.net", 'lpNumber': "17283664", 'lpProtocol': "http"};}

function lpAddMonitorTag(src) {
    if (typeof (src) == 'undefined' || typeof (src) == 'object') {
        src = lpMTagConfig.lpMTagSrc ? lpMTagConfig.lpMTagSrc : '/hcp/html/mTag.js';
    }
    
    if (src.indexOf('http') != 0) {
        src = lpMTagConfig.lpProtocol + "://" + lpMTagConfig.lpServer + src + '?site=' + lpMTagConfig.lpNumber;
    } else {
        if (src.indexOf('site=') < 0) {
            if (src.indexOf('?') < 0) src = src + '?';
            else src = src + '&';
            src = src + 'site=' + lpMTagConfig.lpNumber;
        }
    };
    
    var s = document.createElement('script');
    s.setAttribute('type', 'text/javascript');
    s.setAttribute('charset', 'iso-8859-1');
    s.setAttribute('src', src);
    document.getElementsByTagName('head').item(0).appendChild(s);
}

if (window.attachEvent) window.attachEvent('onload', lpAddMonitorTag);
else window.addEventListener("load", lpAddMonitorTag, false);
/* END LivePerson Monitor. */



/* modalMe */
var durl='';
function modalMe() {
	elmt = document.getElementById("modalMe");
	elmt.style.visibility = (elmt.style.visibility == "visible") ? "hidden" : "visible";

}
function ShowModal(tid)
{
    try
    {
        /*
            -Create the backdrop
            -Show the backdrop
            -Show the requested element
            -Center the requested element
        */
        if (!document.getElementById('divbackdrop'))
        {
            //Create a new backdrop div
            var t = document.createElement('div');
            t.id = 'divbackdrop';
            document.body.appendChild(t)
        }
        var b = document.getElementById('divbackdrop');
        b.style.opacity = '.75';
        b.style.filter = 'alpha(opacity=75)';
        b.style.position = 'absolute';
        b.style.backgroundColor = '#000000';
        b.innerHTML = '&nbsp;';
        b.style.zIndex = 100;
        b.style.left = 0;
        b.style.top = 0;
        b.style.float = 'left';
        b.style.display = 'block';
        b.style.width = GetPageWidth() + 'px';
        b.style.height = GetPageHeight() + 'px';
       
        //b.style.left = GetScrollX();
        //b.style.top = GetScrollY();
        CenterDisplay('divbackdrop');
        CenterDisplay(tid);
        document.getElementById(tid).style.display = 'inline';
        document.getElementById(tid).style.zIndex = 1000;
        document.body.style.overflow="hidden";
        HideElement('APPLET', tid);
        HideElement('SELECT', tid);
        
        //alert('Backdrop: ' + document.getElementById('divbackdrop').style.zIndex + '\nItem (' + tid + '): ' + document.getElementById(tid).style.zIndex);
    }
    catch (ex)
    {
        //There was an error
        //alert('Overlay(' + tid + ') Failed: \n' + ex.description);
    }
}

function HideModal(tid)
{
    try
    {
        document.getElementById('divbackdrop').style.display = 'none';
        //document.getElementById('divbackdrop').style.overflow-x = 'auto';
        //document.getElementById('divbackdrop').style.overflow-y = 'auto';
        document.getElementById(tid).style.display = 'none';
        document.body.style.overflow="auto";
        ShowElement('APPLET');
        ShowElement('SELECT');
    }
    catch (ex)
    {
        //There was an error
        //alert('HideOverlay(' + tid + ') Failed: \n' + ex.description);
    }
}

function showsplash()
{
    CenterDisplay('idsplash');
    document.getElementById('idsplash').className = 'Splash-show'
}

function srciframe(idFrame,ihtml)
{
    var f = document.getElementById(idFrame);
    var a=new Date()
    var t=a.getTime();
    //load the url to iframe
    if (f.src != ihtml)
    {
        f.src = '';
        f.src = ihtml+'&'+t;
    }
}
function loadiframe(idDiv, idFrame,w,h,ihtml)
{
    
    var d = document.getElementById(idDiv);
    var f = document.getElementById(idFrame);
    var a=new Date()
    var t=a.getTime();

    //load the url to iframe
    f.src = ihtml+'&'+t;

    //frame style
    f.style.width = w + 'px';
    f.style.height = h + 'px';
    f.style.display = 'none';
    f.style.zIndex = 1000;
    
    //Set DIV style
    d.style.width = w + 'px';
    d.style.height = h + 'px';
    d.style.display = 'none';
    d.style.zIndex = 1000;
    
    ShowModal(idDiv);    
    d.style.display = '';
    f.style.display = '';
    
}
function hideiframe(idDiv, idFrame)
{
    var d = document.getElementById(idDiv);
    var f = document.getElementById(idFrame);
    var b = document.getElementById('divbackdrop');

    //Set frame style
    //f.style.width = '0px';
    //f.style.height = '0px';
    f.style.display = 'none';
   
    //set div style
    //d.style.width = '0px';
    //d.style.height = '0px';
    d.style.display = 'none';

    HideModal(idDiv);
    if (b)
        b.style.display='none';
    
    f.src = '';
}

function createDiv(idiv)
{
	if (!document.getElementById(idiv))
	{
		//Create a new backdrop div
		var t = document.createElement('div');
		t.id = idiv;
		document.main_form.appendChild(t);
	}
}


function ShowDIV(idiv,w,h)
{
    var d = document.getElementById(idiv);
    
    d.style.width = w + 'px';
    d.style.height = h + 'px';
    
    ShowModal(idiv);
}

function HideDIV(idiv)
{
    var d = document.getElementById(idiv);
    
    d.style.width = '0px';
    d.style.height = '0px';
    HideModal(idiv);
    HideProgram(idiv);
}

function ShowProgram(idiv,w,h)
{
    var a = document.getElementById('idItin');
    var d = document.getElementById(idiv);
    var i = document.getElementById('idHtlItem');
    var p = document.getElementById('id_Program');
    
    //i.style.display = 'none';
    //alert(a.innerHTML);
    d.innertHTML = a.innerHTML; 
    p.style.display = 'block';
    d.style.width = w + 'px';
    d.style.height = h + 'px';
    d.style.display = 'block';
    ShowModal(d);
    //alert(d.innerHTML);
    
}
function HideProgram(idiv)
{
    var d = document.getElementById(idiv);
    var i = document.getElementById('idHtlItem');
    var p = document.getElementById('id_Program');
    
    
    i.style.display = 'block';
    p.style.display = 'none';
    p.innertHTML = '';
    d.style.width = '0px';
    d.style.height = '0px';
    HideModal(idiv);
}

function execOurTrips(shref,grpid)
{
    var str = grpid.substring(1);

    if (str=='CONTACTUS')
        loadiframe('idModal','idIFrame','767','347',shref + str);
    else 
        document.location=shref + str;
}
function OpenNewWindow(turl,name)
{
    var wi=screen.width; //'width=100%,';       //width
    var he=screen.height; //'height=100%,';      //height
    var re='resizable=yes,';    //set if window is resizable
    var sc='scrollbars=yes,';   //set scrollbar
    var tb='toolbar=no,';       //set toolbar
    var lo='location=no,';       //display url location
    var di='directories=no,';
    var st='status=no,';
    var mn='menubar=no,';
    var ch='copyhistory=no';
    var a=wi+he+re+sc+tb+lo+di+st+mn+ch;
    window.open(turl,name,a);
}

function sq(a,b,c,d,e,f,g)
{
		var ul=durl+'&action='+a;
		ul+='&fromaddress='+b;
		ul+='&txtreplyto='+c;
		ul+='&txtfromname='+d;
		ul+='&txtbody='+e;
		ul+='&txttoaddress='+f;
		ul+='&txtsubject='+g;
		ul+='&emailinfo=send';
		var s=includeURL(ul); //just to execute the email subcription
}







