var CartID = "";

function GetCartID() {
    $.ajax({
        type: "POST",
        url: "/scripts/handlers/GetSession.ashx",
        data: { "VariableName": "CartID" },
        dataType: "text",
        async: false,
        error: function(XMLHttpRequest, textStatus, errorThrown) {
            N17Box.toggle('<p style="color: #FF0000; font-weight: bold;">' + textStatus + '<br />' + errorThrown + '</p>', true);
        },
        success: function(data, textStatus) {
            CartID = data;
        }
    });
}

function ShowPopup(thePopup, speed)
{
	// Re-position to centered
	thePopup.centerInClient();

	// Show the Popup
	thePopup.show(speed);
}

function DevelopmentPlatform(theValue, theTextbox)
{
	$.ajax({
		type: "GET",
		url: "/base/AjaxLibrary/WebDevelopment_Platform/" + theValue + ".aspx",
		dataType: "xml",
		async: false,
		error: function(XMLHttpRequest, textStatus, errorThrown) {
			N17Box.toggle('<p style="color: Red; font-weight: bold;">' + textStatus + '<br />' + errorThrown + '</p>', true);
		},
		success: function(data, textStatus) {
			if ($("value", data).text() == "True")
			{
				theTextbox.val('Other');
				theTextbox.blur(function() { if (theTextbox.val() == "") theTextbox.val('Other'); });
				$('#pnlPlatform').css('display', 'block');
				$('#txtOtherPlatform').focus();
			}
			else
			{
				theTextbox.blur(function() { });
				theTextbox.val('');
				$('#pnlPlatform').hide();
			}
		}
	});
}

function InputTypeClasses()
{
	var inputs = $('input');
	$.each(inputs, function(index, value) {
		if ($(value).attr('type'))
			$(value).addClass($(value).attr('type'));
	});
}

function ImageToggle(theImage, pathToNewImage)
{
	$(theImage).attr('src', pathToNewImage);
}

$(function() {
    GetCartID();
    InputTypeClasses();
    $.preloadImages("/media/images2/home_rollover.jpg", "/media/images2/client_rollover.jpg", "/media/images2/contact_rollover.jpg");
});


