var emailValidation = 0;
$(document).ready(function() {

	//alert($("#header #menu").height());
	$("#kjyuly-kjyuly").focus(function() {
		if ($(this).attr("rel") == $(this).val()) {
			$(this).val("");
		};
	}).blur(function() {
		if (!$(this).val()) {
			$(this).val($(this).attr("rel"));
		};
	});
	$("#subForm a").click(function() {
		$("#subForm").trigger("submit");
		return false;
	});
	
	$("#subForm").submit(function() {
		var filter = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
		if (!filter.test($("#kjyuly-kjyuly").val())) {
			if (!emailValidation) {
				$("#newsletter p:eq(1)").append("<big style='display:block;color:red'>Invalid Email Address</big>");
				emailValidation = 1;
			};
			return false;
		};
	});
	
	$("img.bigImage").parent("p").css("margin", "0");

});

function getCalendar(month, year) {

	$.get("/inc/calendar.php?month="+month+"&year="+year, function(data) {
		$("#calendar").html(data);
	});
	
	return false;
};

var rosewood = {
	src: '/inc/js/rosef.swf'
};
sIFR.activate(rosewood);

sIFR.replace(rosewood, {
	selector: '#menu li span.level1',
	css: {
		'.sIFR-root': {'color': '#ffffff', 'background-color':'#707772', 'letter-spacing':'-1'},
		'a, a:link': {'text-decoration': 'none', 'color': '#ffffff'},
		'a:hover': {'color': '#cccccc'}
	},
	wmode: 'transparent',
	fitExactly: true
	//forceSingleLine: true
});

sIFR.replace(rosewood, {
	selector: '#menu li span.level2',
	css: {
		'.sIFR-root': {'color': '#343434', 'background-color':'#848b84'},
		'a, a:link': {'text-decoration': 'none', 'color': '#343434'},
		'a:hover': {'color': '#555555'}
	},
	wmode: 'opaque',
	tuneHeight: -8,
	//fitExactly: true,
	forceSingleLine: true
});

sIFR.replace(rosewood, {
	selector: '#bar p.title',
	css: {
		'.sIFR-root': {'color': '#545652', 'background-color':'#262725', 'letter-spacing':'-1'}
	},
	wmode: 'transparent',
	tuneHeight: -8,
	//fitExactly: true,
	forceSingleLine: true
});

sIFR.replace(rosewood, {
	selector: '#content h1',
	css: {
		'.sIFR-root': {'color': '#dce0dc', 'background-color':'#757f73', 'letter-spacing':'-3.5'}
	},
	wmode: 'transparent',
	tuneHeight: -12,
	fitExactly: true
	//forceSingleLine: true
});

sIFR.replace(rosewood, {
	selector: '#side p.title',
	css: {
		'.sIFR-root': {'color': '#2e2f2d', 'background-color':'#696f6a', 'letter-spacing':'-1'}
	},
	wmode: 'transparent',
	tuneHeight: -8,
	//fitExactly: true,
	forceSingleLine: true
});

sIFR.replace(rosewood, {
	selector: '#footer span.title',
	css: {
		'.sIFR-root': {'color': '#ffffff', 'background-color':'#322216', 'letter-spacing':'-1'}
	},
	wmode: 'transparent',
	tuneHeight: -8,
	//fitExactly: true,
	forceSingleLine: true
});

sIFR.replace(rosewood, {
	selector: '#footer #designby',
	css: {
		'.sIFR-root': {'color': '#918376', 'background-color':'#322216', 'letter-spacing':'0'},
		'a, a:link': {'text-decoration': 'none', 'color': '#918376'},
		'a:hover': {'color': '#ffffff'}
	},
	wmode: 'transparent',
	//tuneHeight: -8,
	//fitExactly: true,
	forceSingleLine: true
});
