// Copyright Acro Media Inc. 1998-2010, www.acromediainc.com 

var copyrightYear = {
	init: function(){
		if(document.getElementById('insertYear')) document.getElementById('insertYear').innerHTML = new Date().getFullYear();
	}
}

var externalLinks = {
	init: function(){
		if (!document.getElementsByTagName) return;
		var anchors = document.getElementsByTagName("a");
		for (var i=0; i<anchors.length; i++) {
			if (anchors[i].getAttribute("href") && anchors[i].getAttribute("rel") == "external") anchors[i].target = "_blank";
		}
	}
}

function siteOnload(){
	copyrightYear.init();
	externalLinks.init();
}

function addLoadEvent(func){
	var oldOnLoad = window.onload;
	if(typeof window.onload != 'function'){
		window.onload = func;
	}
	else{
		window.onload = function(){
			oldOnLoad();
			func();
		}
	}
}

addLoadEvent(siteOnload);

// ADD HOVERS
$(function(){
  $('#secNav').hover(function(){
    $(this).toggleClass('hover');
  }, function(){
    $(this).toggleClass('hover'); 
  });
});


function callFlashGunShots() {
	//var flashMovie=getFlashMovie("fl_3d_game_animation_bullets");
	//flashMovie.firegunshots();
	//$(".bulletDiv").show();	
}

function getFlashMovie(movieName) {
	var isIE = navigator.appName.indexOf("Microsoft Internet") != -1;
	return (isIE) ? window[movieName] : document[movieName];
}

function takePicture() {
	$("#cameraFlash").show();
	$.timer(10, function (timer) {
		$("#cameraFlash").fadeOut(550);
		
			timer.stop();
	});
}

function clearBulletHoles() {
	$("#bulletsCont").empty();
}

var bNum = 0;
function newBulletHole(XPOS, YPOS) {
	
	$("#bulletsCont").append('<div class="bulletDiv bullet' + bNum + '"style="left: ' + XPOS + 'px; ' + 'top: ' + YPOS + 'px; "></div>');

	$(".bullet" + bNum).show();
	$(".bullet" + bNum).fadeOut(6250);
	bNum++;
}

