﻿function modalpopup(strProdType) {

	// Set links
	$("#prodLinkDual1").attr("href", "energy-products/dual.aspx?prodType=" + strProdType);
	$("#prodLinkDual2").attr("href", "energy-products/dual.aspx?prodType=" + strProdType);
	$("#prodLinkGas1").attr("href", "energy-products/gas.aspx?prodType=" + strProdType);
	$("#prodLinkGas2").attr("href", "energy-products/gas.aspx?prodType=" + strProdType);
	$("#prodLinkElec1").attr("href", "energy-products/electricity.aspx?prodType=" + strProdType);
	$("#prodLinkElec2").attr("href", "energy-products/electricity.aspx?prodType=" + strProdType);

	$("#overlay").modal({
		opacity: 65,
		overlayCss: { backgroundColor: "#fff" },
		onClose: function (dialog) {
			dialog.overlay.fadeOut('slow', function () {
				dialog.container.fadeOut('fast', function () {
					$.modal.close();
				});
			});
		}
	});
};

function modalCallBack() {
	$("#callback").modal({
		opacity: 65,
		overlayCss: { backgroundColor: "#fff" },
		onClose: function (dialog) {
			dialog.overlay.fadeOut('slow', function () {
				dialog.container.fadeOut('fast', function () {
					$.modal.close();
				});
			});
		}
	});
};

function modalCallBack2() {
	$("#callback2").modal({
		opacity: 65,
		overlayCss: { backgroundColor: "#fff" },
		onClose: function (dialog) {
			dialog.overlay.fadeOut('slow', function () {
				dialog.container.fadeOut('fast', function () {
					$.modal.close();
				});
			});
		}
	});
};

function modalCustom(strUrl, strId) {
	// populate it
	$.get(strUrl, function (data) {
		//$("#lightbox" + strId).html($(data).children());
		$("#lightboxContent" + strId).html($(data).children());
	});
	
	// show it
	$("#lightbox" + strId).modal({
		opacity: 65,
		overlayCss: { backgroundColor: "#fff" },
		onClose: function (dialog) {
			dialog.overlay.fadeOut('slow', function () {
				dialog.container.fadeOut('fast', function () {
					$.modal.close();
				});
			});
		}
	});
};


function modalCallBackApply() {
	$.modal.close();

	setTimeout('modalCallBack()', 1000);
};


function modalApplyPopup() {
	$("#overlay").modal({
		opacity: 65,
		overlayCss: { backgroundColor: "#fff" },
		onClose: function (dialog) {
			dialog.overlay.fadeOut('slow', function () {
				dialog.container.fadeOut('fast', function () {
					$.modal.close();
				});
			});
		}
	});
};
 
