/*
Thanx @maxvoltar aka Tim Van Damme, http://maxvoltar.com/articles/business-card-websites-part-2
for the code on the roll over. See his Businesscard webste at www.timvandamme.com
//*/


$(document).ready(function() {

	var isHandheld = testMediaQuery("handheld"); // boolean

	if(!isHandheld) {
		$("#phone a").hover(showCallLabel, hideCallLabel);
		$("#phone a").focus(showCallLabel);
		$("#phone a").blur(hideCallLabel);

		$("#email a").hover(showEmailLabel, hideEmailLabel);
		$("#email a").focus(showEmailLabel);
		$("#email a").blur(hideEmailLabel);

		$("#vcard a").hover(showVcardLabel, hideVcardLabel);
		$("#vcard a").focus(showVcardLabel);
		$("#vcard a").blur(hideVcardLabel);

		$("#linkedin a").hover(showLinkedINLabel, hideLinkedINLabel);
		$("#linkedin a").focus(showLinkedINLabel);
		$("#linkedin a").blur(hideLinkedINLabel);

		$("#twitter a").hover(showTwitterLabel, hideTwitterLabel);
		$("#twitter a").focus(showTwitterLabel);
		$("#twitter a").blur(hideTwitterLabel);
	} else {
		
		var width = screen.availWidth;
		var height = screen.availHeight;
		window.resizeTo( width, height ); 
	}

	$("#close a").click(function() {
		window.close();
	});

});




function showCallLabel() {
	$("#phone a span").show();
	$("#phone a span").animate({
		top: "10px",
		opacity: 1
	}, 250 );
}

function hideCallLabel() {
	$("#phone a span").animate({ 
		top: "20px",
		opacity: 0
	}, 250 );
	setTimeout("$('#phone a div').hide();", 250);
	$("#phone a span").animate({ 
		top: "-10px",
	}, 250 );
}




function showEmailLabel() {
	$("#email a span").show();
	$("#email a span").animate({
		top: "-23px",
		opacity: 1
	}, 250 );
}

function hideEmailLabel() {
	$("#email a span").animate({ 
		top: "-3px",
		opacity: 0
	}, 250 );
	setTimeout("$('#email a span').hide();", 250);
	$("#email a span").animate({ 
		top: "-43px",
	}, 250 );
}




function showTwitterLabel() {
	$("#twitter a span").show();
	$("#twitter a span").animate({
		top: "10px",
		opacity: 1
	}, 250 );
}

function hideTwitterLabel() {
	$("#twitter a span").animate({ 
		top: "20px",
		opacity: 0
	}, 250 );
	setTimeout("$('#twitter a span').hide();", 250);
	$("#twitter a span").animate({ 
		top: "-10px",
	}, 250 );
}





function showLinkedINLabel() {
	$("#linkedin a span").show();
	$("#linkedin a span").animate({
		top: "10px",
		opacity: 1
	}, 250 );
}

function hideLinkedINLabel() {
	$("#linkedin a span").animate({ 
		top: "20px",
		opacity: 0
	}, 250 );
	setTimeout("$('#linkedin a div').hide();", 250);
	$("#linkedin a span").animate({ 
		top: "-10px",
	}, 250 );
}



function showVcardLabel() {
	$("#vcard a span").show();
	$("#vcard a span").animate({
		top: "10px",
		opacity: 1
	}, 250 );
}

function hideVcardLabel() {
	$("#vcard a span").animate({ 
		top: "20px",
		opacity: 0
	}, 250 );
	setTimeout("$('#vcard a span').hide();", 250);
	$("#vcard a span").animate({ 
		top: "-10px",
	}, 250 );
}

