//javascript functions available in all pages

function newPath(path){
	new_path = path.substring(-3,path.length - 4) + "80.gif";
	//alert(new_path);
	return new_path;
}

function oldPath(path){
	old_path = path.substring(-5,path.length - 6) + ".gif";
	//alert(old_path);
	return old_path;
}

//you can build links to particular destinations in the site by just defining a function
function goHome(){
	document.location.href='index.php';
}

$(document).ready(
	function () {
		$(".sideblock")
			.mouseover( function () {
				$(this).css("background","url('images/button_pressed.png') top left no-repeat");
			}).mouseout(function (){
				$(this).css("background","url('images/button_unpressed.png') top left no-repeat");
			}
		);
		
		
		$("#customer_login")
			.mouseover( function () { $(this).attr("src","images/login_glow.gif") } )
			.mouseout( function () { $(this).attr("src","images/login.gif");});
			
		
	}
);

function glassPane (){
	$("body").css({"overflow":"hidden"});
	/*
	$("#glasspane").css( {	'z-index':200,
							'opacity':0.7,
							'display':''
						}
	);
	*/
	$("#popupForm").css( {	'z-index':300,
							'opacity':1,
							'display':'',
							'left': ($("body").width()/2) - 150
						}
	);
}

function restoreView(){
	//$('#glasspane').css( {	'display': 'none' });
	$("#popupForm").css( {	'display': 'none' });
	$("body").css({"overflow":"auto"});	
}

function ajaxMail(){
	$("#gmyn_form").hide();
	var gmyn_name = $("#gmyn_name").val();
	var gmyn_com = $("#gmyn_com").val();
	var gmyn_email = $("#gmyn_email").val();
	var gmyn_msg = $("#gmyn_msg").val();
	
	$("#popupForm").html("<img src='images/AjaxLoadingIcon.gif' />");
	
	$.post(	"mail.php",
			{ name : gmyn_name, com : gmyn_com, email : gmyn_email, msg: gmyn_msg },
			function(data){
				$("#popupForm").html(data);
			}
	);
}
