// JavaScript Document

//ajax get page
function getPage(id) {
		
	$("div.content", "div.ajaxreciver").fadeOut(200, function() {
		$("#ajaxloader").fadeIn(150, function() {
		
			$.ajax({
				url: "/wp-content/themes/classic/functions/ajaxrec.php?id="+id,
				cache: false,
				success: function(html){
					$("#ajaxloader").fadeOut(100, function() {
						$("div.content","div.ajaxreciver").html(html).fadeIn(300).addClass("activebox");
					});
				},
				error: function(html) {
					alert("Something went wrong... Please try again!");
				}
			});
			return false;
		}); // ajaxloader fadein
	}); //content fadeout

}

//check new window size
function resizeWindow( e ) {
	var newWindowWidth = $(window).width();
	var newHeight = Math.round(newWindowWidth/3.607);
	
	//alert(newheight);
	$("object[name=host]").attr("height",newHeight);
}

$(document).ready(function () {   
	
	//pngfix
	$(document).pngFix();
	
	//check for resize
	$(window).bind("resize", resizeWindow);
	
	//remove objects for flash to render correctly
	//$('ul#mainmenu li ul').remove();    
	
}); // close doc ready
