///////////////////////////////////
//		Global functions		 //	
///////////////////////////////////
$(document).ready(function () {
	/*
	if(navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/RIM/i)){
		if(window.location == applicationURL){
			window.location = applicationURL + "/787/firstDelivery/";
		}
	}
	*/
});

function swfObjectResize(swfObject, swfObjectNewWidth, swfObjectNewHeight) {
    var swfObjectEmbed = document.getElementById(swfObject);
    if(swfObjectEmbed != null){
        if (swfObjectNewWidth != null && swfObjectNewWidth != "") {
            swfObjectEmbed.style.width = swfObjectNewWidth;
        }
        if (swfObjectNewHeight != null && swfObjectNewHeight != "") {
            swfObjectEmbed.style.height = swfObjectNewHeight;
			$(swfObjectEmbed).parent().css("height", swfObjectNewHeight);
        }
    }
    //onPageResize(window.event);
    $(window).trigger('pushFooter');
}

function openFullWindow(url) {
	var windowprops = 'top=0,left=0,toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,menubar=yes,resizable=yes';
	var popup = window.open(url,'NewAirplanePop',windowprops);
	var intWidth = document.documentElement.clientWidth;
	var intHeight = document.documentElement.clientHeight;
    if(popup == null){
        alert("Please disable your popup blocker to view this portion of the site."); 
    }else{
		var resizeWidth = intWidth;
		var resizeHeight = intHeight + 50;
	    popup.resizeTo(resizeWidth, resizeHeight);
        popup.outerWidth = resizeWidth;
	    popup.outerHeight = resizeHeight;
    }
}

function isValidEmail(strEmail){
	validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
	if (strEmail.search(validRegExp) == -1){
		return false;
	} 
	return true; 
}

