<!--

var opened_windows = new Object();

function dynpop(url, name, w, h, t, l, scroll, objectname)
{
    try {
	// default values, if they're left out
	if (name == '') {
	    name = 'lepop';
	}
	if (isNaN(w)) {
	    w = 300;
	}
	if (isNaN(h)) {
	    h = 400;
	}
	if (isNaN(t)) {
	    t = (screen.height - h) / 2;
	}
	if (isNaN(l)) {
	    l = (screen.width - w) / 2;
	}
	if (scroll=='') {
	    scroll = 'no';
	}

	// insert values if any
	props="location=no,toolbar=no,menubar=no,resizable=no";
	props+=",scrollbars="+scroll;
	props+=",width="+w;
	props+=",height="+h;
	props+=",top="+t;
	props+=",left="+l;   

	// open popup
	var myFloater = window.open(url,name,props);
	myFloater.location.href = url;

	if(typeof(objectname) != 'string' || objectname == '') {
	    if (name != '')
		objectname = name;
	}

	if(typeof(objectname) == 'string' && objectname != '') {
	    opened_windows[objectname] = myFloater;
	}
	
	opened_windows[name] = myFloater;
    }
    catch (err) {
	// an error occured somewhere in the block above, and we might
	// not have been able to open the popup!
	//alert('an error occured while opening the popup');
    }
}


/* 
  Function: getArgs v1.0 Anders Lönnberg

  Get the querystring as an object
  Example:
 
  URL:    ?anders=good&jonas=hangover

  CODE:   var my_args = getArgs();
          alert(my_args.anders);
	  alert(typeof(args.anders) == 'undefined');

  OUTPUT: "good"
          "false"
  
*/
function getArgs() 
{
   var args = new Object(); 
   var query = location.search.substring(1); 
   var pairs = query.split("&"); 

   for(var i = 0; i < pairs.length; i++) 
   { 
     var pos = pairs[i].indexOf('='); 
     if (pos == -1) 
       continue; 
     
     var argname = pairs[i].substring(0,pos); 
     var value = pairs[i].substring(pos+1); 
     args[argname] = unescape(value); 
   } 

   return args; 
}

function detectFlash()
{
    // Initialize flash status variables
    var flashEnabled = false;
    
    // If not IE, test for string matching
    if (navigator.mimeTypes 
	&& navigator.mimeTypes["application/x-shockwave-flash"] 
	&& navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
	
	var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	var pluginVersion = 0;
	for (var i = 0; i < words.length; ++i) {
	    if (isNaN(parseInt(words[i]))) continue;
	    pluginVersion = words[i]; 
	}
	flashEnabled = (pluginVersion >= 2);
	
	// If IE, test via VBScript object creation
    } else if (navigator.userAgent 
	       && navigator.userAgent.indexOf("MSIE") >= 0 
	       && navigator.appVersion.indexOf("Win") != -1) {

	var xObj = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");

	flashEnabled = (xObj != null);
    }

    return flashEnabled;
}

function redir_to_script_page(this_filename, this_site, script)
{
   if(location.href.indexOf('//www') >= 0 && location.href.indexOf(script) < 0 && location.href.match('\.([a-z]+)$'))
   {
     // Get this part: /ls/customer_service/faq/?partner=sterling#Flight_link
	var index = location.href.indexOf('/'+this_site+'/');
        if(index < 0)
        {
	    index = location.href.indexOf('/', 7);
        }
	var url=location.href.substr(index);

     // Split into baseurl+querystring   and   anchor
        var split_anchor = url.split('#');  // split_anchor[0] = base+querystr, split_anchor[1] = anchor

     // split into baseurl + querystring          
	var parts=split_anchor[0].split('?');    // parts[0] = base_url, parts[1] = querystring

     // Do not redir if already a cgi 
	if(parts[0].indexOf('.cgi') <= 0)
	{
          if(parts[0].match('^\/'+this_site))
	  {
	     parts[0] = parts[0].substr(3);
	  }

          // Is the path to the script a specified file or just the dir?
          var new_url = '/'+this_site+script+'?template='+parts[0];
          if(parts[0].lastIndexOf(this_filename) < parts[0].length - this_filename.length)
          {
              new_url += '/'+this_filename;
          }
          // add querystring if we got any
          if(parts.length > 1)
          {
              new_url += '&'+parts[1];
          }

          // add anchor if any
          if(split_anchor.length > 1)
          {
              new_url += '#'+split_anchor[1];
          }
          location.href = new_url;
        }
   }
} 

function setTall() {

	if (document.getElementById) {
		
		var divs = new Array(document.getElementById('rightColumnOffers'), document.getElementById('mainContentColumn'),document.getElementById('mainLeftColumn'));
		
		var maxHeight = 0;
		for (var i = 0; i < divs.length; i++) {
			if (divs[i].offsetHeight > maxHeight) maxHeight = divs[i].offsetHeight;
		}
		
		for (var i = 0; i < divs.length; i++) {
			divs[i].style.height = maxHeight + 'px';

			if (divs[i].offsetHeight > maxHeight) {
				divs[i].style.height = (maxHeight - (divs[i].offsetHeight - maxHeight)) +'px';
			}
		}
	}




}

function showChildInfo(age,info)	{
	var one = document.getElementById(age);
	var two = document.getElementById(info);	
	
	//one.toggle();
	//two.toggle();
	if (document.getElementById('children').value != "0")	{
		one.style.visibility = "";
		one.style.display    = "";
		two.style.visibility = "";
		two.style.display    = "";
	}
	else {
		one.style.visibility = "hidden";
		one.style.display    = "none";
		two.style.visibility = "hidden";	
		two.style.display    = "none";
	}
}





function RTeCollector(param) {
	theHeight = 460;
	theWidth  = 640;

	theTop=(screen.height/2)-(theHeight/2)
	theLeft=(screen.width/2)-(theWidth/2)
	features='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,height='+theHeight+',width='+theWidth+',top='+theTop+',left='+theLeft;
	myWindow=window.open('http://ecollector.responsetek.com/eCollector.asp?' + param, 'eCollector', features);

}

function tnDaysBetween(date1, date2){
if (date1.indexOf("-") != -1) { date1 = date1.split("-"); } else if (date1.indexOf("/") != -1) { date1 = date1.split("/"); } else { return 0; }
if (date2.indexOf("-") != -1) { date2 = date2.split("-"); } else if (date2.indexOf("/") != -1) { date2 = date2.split("/"); } else { return 0; }
if (parseInt(date1[0], 10) >= 1000) {
var sDate = new Date(date1[0]+"/"+date1[1]+"/"+date1[2]);
} else if (parseInt(date1[2], 10) >= 1000) {
var sDate = new Date(date1[2]+"/"+date1[0]+"/"+date1[1]);
} else {
return 0;
}
if (parseInt(date2[0], 10) >= 1000) {
var eDate = new Date(date2[0]+"/"+date2[1]+"/"+date2[2]);
} else if (parseInt(date2[2], 10) >= 1000) {
var eDate = new Date(date2[2]+"/"+date2[0]+"/"+date2[1]);
} else {
return 0;
}
var one_day = 1000*60*60*24;
var daysApart = Math.abs(Math.ceil((sDate.getTime()-eDate.getTime())/one_day));
return daysApart;
}

var tnCurrentDate = new Date();
var tnCurrentMonth = tnCurrentDate.getMonth() + 1;
var tnCurrentDay = tnCurrentDate.getDate();
var tnCurrentYear = tnCurrentDate.getFullYear();
var tnDateToday = tnCurrentYear + "-" + tnCurrentMonth + "-" +tnCurrentDay;





//-->		



