﻿/// <reference path="/Scripts/jquery-1.4.1.js" />

//$(document).ready(function () {
////	$('<div><a href="whatever.aspx">edit</a></div>').appendTo('#MainContent_ctrlTestimonials div').parent().hover(function() {
////		$(this).show();
////		}, function() {
////			$(this).hide();
//	//		})
//});
$(document).ready(function () {
	function LaunchLocationWindow(id) {
		//Get the window height and width
		var winH = $(window).height();
		var winW = $(window).width();

		//Set the popup window to center
		$(id).css('top', winH / 2 - $(id).height() / 2);
		$(id).css('left', winW / 2 - $(id).width() / 2);

		//transition effect        
		$(id).fadeIn('normal');
	}

	//if close button is clicked    
	$('.window .close').click(function (e) {
		//Cancel the link behavior        
		e.preventDefault();
		$('#mask, .window').hide();
	});

	//if mask is clicked    
	$('#mask').click(function () {
		$(this).hide();
		$('.window').hide();
	});

	$('#changeLocation').click(function () {
		LaunchLocationWindow('#dialog');
	});

	if ($.browser.version == "7.0") {
		$('#logo').removeClass('logo').addClass('logoIE7');
		$('#tabLinks').removeClass('tabLinks').addClass('tabLinksIE7');
	}

	//	$('<div id="manageAds">Manage Ads</div>').prependTo($('#ads')).hide();
	//	$('#ads').hover(function () {
	//		$('#manageAds').slideDown('fast');
	//	}, function () {
	//		$('#manageAds').slideUp('fast');
	//	});

//		$.ajax({
//			type: "POST",
//			dataType: "json",
//			contentType: "application/json",
//			url: "Sandbox.aspx/CheckLoginStatus",
//			success: function (data) {
//				alert('data from web method: ' + data);
//			},
//			error: function () {
//				alert("The call to the web service failed.");
//			}
//		});

	$('#NewAdForm').hide();
	$('#btnToggleAdForm').toggle(function () {
		$('#btnToggleAdForm').val('Cancel');
		$('#NewAdForm').slideDown('fast');
	}, function () {
		$('#btnToggleAdForm').val('Upload a New Ad');
		$('#NewAdForm').slideUp('fast');
	});

});
