$(document).ready(function() {
// Create event listeners for the 3 points
$('.threePtsP').bind('mouseenter', function(e) {
	$(this).toggleClass("over", true);
	$(e.target).children('a').toggleClass("over", true);
	if ($(e.target) != null && $(e.target).children('img') != null && $(e.target).children('img').attr('src') != null) {
	var src = $(e.target).children('img').attr('src').replace('_normal', '_over');
	$(e.target).children('img').attr('src', src);
	}
})
$('.threePtsP').bind('mouseleave', function(e) {
	$(this).toggleClass("over", false);
	$(e.target).children('a').toggleClass("over", false);
	if ($(e.target) != null && $(e.target).children('img') != null && $(e.target).children('img').attr('src') != null) {
	var src = $(e.target).children('img').attr('src').replace('_over', '_normal');
	$(e.target).children('img').attr('src', src);
	}
})
	
$('#threePtsP2').bind('click', function(e) { window.location = $(e.target).children('a').attr('href'); });
$('#threePtsP3').bind('click', function(e) { window.location = $(e.target).children('a').attr('href'); });
	
// Quotes
var quoteIndex = 0;
var quotes = [
	'"Quote 1" <small>- Name Surname, <a href="#">Company</a></small>',
	'"Quote 2" <small>- Company, <a href="#">Company</a></small>',
	'"Quote 3" <small>- <a href="#">Website</a></small>'
];
	
setInterval(changeQuote, 8000);
	
function changeQuote() {
	$('#quote').fadeOut(function() {
	$(this).html(quotes[quoteIndex]).fadeIn();
	if (quoteIndex == quotes.length - 1) {
quoteIndex = 0;
	} else {
quoteIndex++;
	}
	});
}
	
$('#threePtsP1').click(function() { vshowPopup(630, 850); });
	
//CLOSING POPUP: Click the x event!, Click out event!, Press Escape event!
$("#vboxImg").click(function() { vdisablePopup(); });
$("#vboxClose").click(function() { vdisablePopup(); });
$("#vbackgroundPopup").click(function() { vdisablePopup(); });
$(document).keypress(function(e) { if (e.keyCode == 27 && vpopupStatus == 1) { vdisablePopup(); } });
});