jQuery.noConflict();

var allowLeave = false;
function goodbye(e) {
	if(allowLeave == false){
		//window.location = '/main-page.php?popup=true';
		openPopup('/popup/popup_exit.php', 850);
		
		if(!e) e = window.event;
		//e.cancelBubble is supported by IE - this will kill the bubbling process.
		e.cancelBubble = true;
		e.returnValue = 'You sure you want to leave! I have a better Offer?'; //This is displayed on the dialog
	
		//e.stopPropagation works in Firefox.
		if (e.stopPropagation) {
			e.stopPropagation();
			e.preventDefault();
		}
	}
		
}

function OutLink(){
	allowLeave = true
}

	
/* POPUP RELATED 
-------------------------------------- */
function openPopup(File, Width){
	jQuery('.popupBorder').css("width", Width+"px")
	jQuery('.popup').load(File, function(response, status, xhr) {
		//alert(response)
		//alert(File+' '+xhr.status + " " + xhr.statusText);
		jQuery('.popupFrame').show();
	});
}

function closeDiv(Div){
	//$('#intro').tinymce().remove();
	jQuery(Div).hide();
}

function openDiv(Div){
	jQuery(Div).show();
}
	
	

