$(function(){

  $('a.showContentBig').each(function(i){
    // Get the content
    var $title = $(this).next('div.stopOverInfo').find('p.title').html();
    var $content = $(this).next('div.stopOverInfo').children('div.hideShow').html();
    var hb = new Array();
    hb[i] = new HelpBalloon({
        container: this, 
        title: $title,
        content: $content
    });
  });
  
  $('a.showContentSmall').each(function(i){
    // Get the content
    var $title = $(this).next('div.stopOverInfo').find('p.title').html();
    var $content = $(this).next('div.stopOverInfo').children('div.hideShow').html();
    var hb = new Array();
    hb[i] = new HelpBalloon({
        size: 'small',
        container: this, 
        title: $title,
        content: $content
    });
  });  
});

function getCharCodeFromEvent(evt)
{
    var evt  = (evt) ? evt : ((event) ? event : null);
    return evt.charCode;
}

// Calculate Fare
function calculate() 
{
    var nTotal =
        parseFloat(document.getElementById("taxesfees").value) +
        parseFloat(document.getElementById("airfare").value) +
	    parseFloat(document.getElementById("fare").value) + 
	    parseFloat(document.getElementById("insurance").value);
	
	document.getElementById("total").value = nTotal;
	document.getElementById("totaldue").value = nTotal;
}

function calculate_subtractadd(obj,obj2)
{
    var el = document.getElementById(obj);
	if ( el.style.display != 'none' ) 
	{
	    var nTotal  =
	        parseFloat(document.getElementById("total").value) + 
	        parseFloat(document.getElementById(obj2).value);
	    document.getElementById("total").value = nTotal;
    	document.getElementById("totaldue").value = nTotal;
	}
	else 
	{
        var nTotal   =
	        parseFloat(document.getElementById("total").value) -
	        parseFloat(document.getElementById(obj2).value);
	    document.getElementById("total").value = nTotal;
	    document.getElementById("totaldue").value = nTotal;
	}
}

function delCookie(name)
{
	setCookie(name, "", -1);
}

function setCookie(name, value, days)
{
	var expires
	if (days)
	{
		var date = new Date();
		date.setTime (date.getTime() + (days * 24 * 60 * 60 * 1000));
		expires = "; expires=" + date.toGMTString();
	}
	else expires = "";
	document.cookie = name + "=" + value + expires + "; path=/";
}

function getCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for (var i=0; i < ca.length; i++)
	{
		var c = ca[i]; 
		while (c.charAt(0) == ' ') c = c.substring(1, c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
	}
	return null;
}

function CheckTermsAndConditions(controlId, warning)
{
    if( $('#'+controlId).is(':checked') )
    {   return true;  }
    else
    {    
        alert(warning);
		$('#'+controlId).focus();
        return false;
	}
}

eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('4 j(a,b){1 c=(c)?c:((a)?a:2);1 d=(c.5)?c.5:((c.6)?c.6:2);3((c.k==l)){1 e=$(\'#\'+b);3(e.m){1 g=e.7(\'n\');1 h=e.7(\'o\');1 i=8;3(g!=2){1 f=p(g)==\'4\'?g:9("4(){"+g+"}");i=f.q(e[0])}3(h!=2){i&&9(h)}}c.r=8}}',28,28,'|var|null|if|function|target|srcElement|attr|true|eval||||||||||checkEnter|keyCode|13|length|onclick|href|typeof|apply|cancelBubble'.split('|'),0,{}))

