// detect Browser
var is = new detectBrowser();

function detectBrowser() 
{
	this.ns4 = (document.layers)? true:false;
	this.ie = (navigator.appName=='Microsoft Internet Explorer')? true:false;
	this.DOM2 = (document.getElementById)? true:false;
}

// Handle window errors
window.onerror = windowError;
function windowError() {
	return true;
}

//Handle window resize
window.onresize= windowReload;
function windowReload() {
  window.location.reload();
}

// Refresh animated gif
function refreshGif(a) {
		
	if (!is.ns4) {
		document.getElementById(a).src = document.getElementById(a).src;
	//} else {
		//document.layers['home_main'].document.images[a].src=document.layers['home_main'].document.images[a].src; 				
	}
}

// Shows (unhides) given layer
function showLayer(a) 
{		
	if(a) {
		// stop timer if user returned back
		// to the same option		
		if (a == layerToHide)			
			stopTimer();
	
		// NS4
		if (is.ns4) {
			document.layers[a].position = "absolute";
			document.layers[a].visibility = "show";
		}
	 
		// > IE5, NS6
		if(is.DOM2) {
			document.getElementById(a).style.visibility = "visible";
		}
	}	
}

// sets layer to be hidden
var layerToHide = "";
function setLayerToHide()
{
	if (setLayerToHide.arguments[0])
		layerToHide = setLayerToHide.arguments[0];
	else
		layerToHide = "";
}

// Hides given layer
function hideLayer(a) 
{
	if(a) {
		// NS4
		if (is.ns4) {
			document.layers[a].position = "relative";
			document.layers[a].visibility = "hide";
		} 
	
		// > IE5, NS6
		if (is.DOM2) {
			document.getElementById(a).style.visibility = "hidden";
		}
	}	
}

// Variable that holds active timer ID
var timerID = 0;

// Hide layer with delay, used for submenu
function hideLayerDly(a)
{
	if(a) {
		var cmd ="hideLayer('" + a + "')";
		setLayerToHide(a);
		timerID = setTimeout(cmd,300);
	}
}

// Stop timer, used for submenu
function stopTimer()
{
	if(timerID) {
     	clearTimeout(timerID);
      	timerID  = 0;
   	}
}


// Menu variables
var mIndex = 0;
var mItem = 'home';
var menu_on = new Array();
var menu_off = new Array();
var preloadFlag = false;

// Create images
function newImage(arg) 
{
	if (document.images) {
		var newImg = new Image();
		newImg.src = arg;
		return newImg;
	}
}

// Image rollover function
function changeImages() 
{  
	//if (preloadFlag == true) {
		if (mIndex != changeImages.arguments[2]) {			
			if (changeImages.arguments[1] == "off"){
				document[changeImages.arguments[0]].src = menu_off[changeImages.arguments[2]].src;
			} else {
				document[changeImages.arguments[0]].src = menu_on[changeImages.arguments[2]].src;
			}
		}		
	//}
}

// Highlight selected menu item
function selectItem() 
{
	document[mItem].src = menu_off[mIndex].src;	
	mIndex = selectItem.arguments[1];
	mItem = selectItem.arguments[0];
	document[mItem].src = menu_on[mIndex].src;
}


// Preload Menu images
function preloadImages(pItem,pIndex) {
	
	if (document.images) {
		
		menu_on[0] = newImage("../images/menu/training_h.gif");
		menu_on[1] = newImage("../images/menu/services_h.gif");
		menu_on[2] = newImage("../images/menu/photo_h.gif");
		menu_on[3] = newImage("../images/menu/equipment_h.gif");
		menu_on[4] = newImage("../images/menu/misc_h.gif");
		menu_on[5] = newImage("../images/menu/links_h.gif");
		menu_on[6] = newImage("../images/menu/contact_h.gif");
		menu_on[7] = newImage("../images/menu/home_h.gif");
		
		menu_off[0] = newImage("../images/menu/training.gif");
		menu_off[1] = newImage("../images/menu/services.gif");
		menu_off[2] = newImage("../images/menu/photo.gif");
		menu_off[3] = newImage("../images/menu/equipment.gif");
		menu_off[4] = newImage("../images/menu/misc.gif");
		menu_off[5] = newImage("../images/menu/links.gif");
		menu_off[6] = newImage("../images/menu/contact.gif");
		menu_off[7] = newImage("../images/menu/home.gif");
		
		mItem = pItem;
		mIndex = pIndex;
		document[mItem].src = menu_on[mIndex].src;
		
		preloadFlag = true;
	}	
}

// Header
function generate_header() 
{
	document.writeln("<div id=\"top\" class=\"header\">");
	document.writeln("<table HEIGHT=\"110\" BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=\"990\">");
	document.writeln("<tr>");
	document.writeln("<td WIDTH=\"990\" HEIGHT=\"110\"><img SRC=\"../images/top.gif\" height=\"110\" width=\"990\"></td>");
	document.writeln("</tr>");
	document.writeln("</table>");
	document.writeln("</div>");
}

// Animated bar
function generate_anm_bar() 
{
	document.writeln("<div id=\"anm_bar\" class=\"anm\">");
	document.writeln("<table HEIGHT=\"50\" BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=\"317\">");
	document.writeln("<tr>");
	document.writeln("<td WIDTH=\"317\" HEIGHT=\"50\"><img SRC=\"../images/anm11.gif\" height=\"50\" width=\"317\"></td>");
	document.writeln("</tr>");
	document.writeln("</table>");
	document.writeln("</div>");
}

// Main Menu
function generate_menu() 
{
	generate_header();
	generate_anm_bar();
	
	//	
document.writeln("<DIV id=\"menu\" class=\"menu\">");
document.writeln("<TABLE WIDTH=191 BORDER=0 CELLPADDING=0 CELLSPACING=0>");
document.writeln("<TR>");
document.writeln("<TD COLSPAN=3><IMG SRC=\"../images/menu/menu_tac_training_01.gif\" WIDTH=191 HEIGHT=16 BORDER=0></TD>");
document.writeln("</TR>");
document.writeln("<TR>");
document.writeln("<TD><IMG SRC=\"../images/menu/menu_tac_training_03.gif\" WIDTH=17 HEIGHT=34 BORDER=0></TD>");
document.writeln("<TD><A HREF=\"training.htm\"" + 
				"ONMOUSEOVER=\"changeImages('training', 'on',0);\"" +
				"ONMOUSEOUT=\"changeImages('training', 'off',0);\"" +
				"ONCLICK=\"selectItem('training', 0);\">" +
				"<IMG NAME=\"training\" SRC=\"../images/menu/training.gif\" WIDTH=160 HEIGHT=34 BORDER=0></A></TD>");
document.writeln("<TD ROWSPAN=16><IMG SRC=\"../images/spacer.gif\" WIDTH=37  BORDER=0></TD>");				
document.writeln("</TR>");
document.writeln("<TR>");
document.writeln("<TD COLSPAN=2><IMG SRC=\"../images/menu/menu_tac_training_06.gif\" WIDTH=177 HEIGHT=7 BORDER=0></TD>");
document.writeln("</TR>");
document.writeln("<TR>");				
document.writeln("<TD><IMG SRC=\"../images/menu/menu_tac_training_07.gif\" WIDTH=17 HEIGHT=34></TD>");			
document.writeln("<TD><A HREF=\"services.htm\"" +
				"ONMOUSEOVER=\"changeImages('services', 'on',1);\"" +
				"ONMOUSEOUT=\"changeImages('services', 'off',1);\"" +
				"ONCLICK=\"selectItem('services', 1);\">" +
				"<IMG NAME=\"services\" SRC=\"../images/menu/services.gif\" WIDTH=160 HEIGHT=34 BORDER=0></A></TD>");
document.writeln("</TR>");	
document.writeln("<TR>");				
document.writeln("<TD COLSPAN=2><IMG SRC=\"../images/menu/menu_tac_training_09.gif\" WIDTH=177 HEIGHT=5 BORDER=0></TD>");
document.writeln("</TR>");	
document.writeln("<TR>");
document.writeln("<TD><IMG SRC=\"../images/menu/menu_tac_training_10.gif\" WIDTH=17 HEIGHT=34></TD>");
if (is.ns4)
	document.writeln("<TD><A HREF=\"photo1_ns4.htm\"" +
				"ONMOUSEOVER=\"changeImages('photo', 'on',2);\"" +
				"ONMOUSEOUT=\"changeImages('photo', 'off',2);\"" +
				"ONCLICK=\"selectItem('photo', 2);\">" +
				"<IMG NAME=\"photo\" SRC=\"../images/menu/photo.gif\" WIDTH=160 HEIGHT=34 BORDER=0></A></TD>");
else
	document.writeln("<TD><A HREF=\"photo1.htm\"" +
				"ONMOUSEOVER=\"changeImages('photo', 'on',2);\"" +
				"ONMOUSEOUT=\"changeImages('photo', 'off',2);\"" +
				"ONCLICK=\"selectItem('photo', 2);\">" +
				"<IMG NAME=\"photo\" SRC=\"../images/menu/photo.gif\" WIDTH=160 HEIGHT=34 BORDER=0></A></TD>");			
document.writeln("</TR>");	
document.writeln("<TR>");				
document.writeln("<TD COLSPAN=2><IMG SRC=\"../images/menu/menu_tac_training_12.gif\" WIDTH=177 HEIGHT=5 BORDER=0></TD>");
document.writeln("</TR>");	
document.writeln("<TR>");
document.writeln("<TD><IMG SRC=\"../images/menu/menu_tac_training_13.gif\" WIDTH=17 HEIGHT=34></TD>");
document.writeln("<TD><A HREF=\"#\" TARGET=\"_parent\"" +
				"ONMOUSEOVER=\"changeImages('equipment', 'on',3);\"" +
				"ONMOUSEOUT=\"changeImages('equipment', 'off',3);\"" +
				"ONCLICK=\"selectItem('equipment', 3);\">" +
				"<IMG NAME=\"equipment\" SRC=\"../images/menu/equipment.gif\" WIDTH=160 HEIGHT=34 BORDER=0></A></TD>");
document.writeln("</TR>");	
document.writeln("<TR>");
document.writeln("<TD COLSPAN=2><IMG SRC=\"../images/menu/menu_tac_training_15.gif\" WIDTH=177 HEIGHT=5 BORDER=0></TD>");
document.writeln("</TR>");
document.writeln("<TR>");
document.writeln("<TD><IMG SRC=\"../images/menu/menu_tac_training_16.gif\" WIDTH=17 HEIGHT=34></TD>");
document.writeln("<TD><A HREF=\"miscellaneous.htm\"" +
				"ONMOUSEOVER=\"changeImages('misc', 'on',4);\"" +
				"ONMOUSEOUT=\"changeImages('misc', 'off',4);\"" +
				"ONCLICK=\"selectItem('misc', 4);\">" +
				"<IMG NAME=\"misc\" SRC=\"../images/menu/misc.gif\" WIDTH=160 HEIGHT=34 BORDER=0></A></TD>");
document.writeln("</TR>");
document.writeln("<TR>");				
document.writeln("<TD COLSPAN=2><IMG SRC=\"../images/menu/menu_tac_training_18.gif\" WIDTH=177 HEIGHT=5 BORDER=0></TD>");
document.writeln("</TR>");
document.writeln("<TR>");				
document.writeln("<TD><IMG SRC=\"../images/menu/menu_tac_training_19.gif\" WIDTH=17 HEIGHT=34></TD>");
document.writeln("<TD><A HREF=\"links.htm\"" +
				"ONMOUSEOVER=\"changeImages('links', 'on',5);\"" +
				"ONMOUSEOUT=\"changeImages('links', 'off',5);\"" + 
				"ONCLICK=\"selectItem('links', 5);\">" + 
				"<IMG NAME=\"links\" SRC=\"../images/menu/links.gif\" WIDTH=160 HEIGHT=34 BORDER=0></A></TD>");
document.writeln("</TR>");
document.writeln("<TR>");				
document.writeln("<TD COLSPAN=2><IMG SRC=\"../images/menu/menu_tac_training_21.gif\" WIDTH=177 HEIGHT=5 BORDER=0></TD>");
document.writeln("</TR>");
document.writeln("<TR>");					
document.writeln("<TD><IMG SRC=\"../images/menu/menu_tac_training_22.gif\" WIDTH=17 HEIGHT=34></TD>");				
document.writeln("<TD><A HREF=\"contact.htm\"" +
				"ONMOUSEOVER=\"changeImages('contact', 'on',6);\"" +
				"ONMOUSEOUT=\"changeImages('contact', 'off',6);\"" +
				"ONCLICK=\"selectItem('contact',6);\">" +
				"<IMG NAME=\"contact\" SRC=\"../images/menu/contact.gif\" WIDTH=160 HEIGHT=34 BORDER=0></A></TD>");
document.writeln("</TR>");
document.writeln("<TR>");				
document.writeln("<TD COLSPAN=2><IMG SRC=\"../images/menu/menu_tac_training_24.gif\" WIDTH=177 HEIGHT=5 BORDER=0></TD>");
document.writeln("</TR>");
document.writeln("<TR>");					
document.writeln("<TD><IMG SRC=\"../images/menu/menu_tac_training_25.gif\" WIDTH=17 HEIGHT=34></TD>");		
document.writeln("<TD><A HREF=\"home.htm\"" + 
				" ONMOUSEOVER=\"changeImages('home', 'on',7);\"" +
				" ONMOUSEOUT=\"changeImages('home', 'off',7);\"" +
				" ONCLICK=\"selectItem('home', 7);\">" +
				" <IMG NAME=\"home\" SRC=\"../images/menu/home.gif\" WIDTH=160 HEIGHT=34 BORDER=0></A></TD>");
document.writeln("</TR>");
document.writeln("<TR>");				
document.writeln("<TD COLSPAN=2><IMG SRC=\"../images/menu/menu_tac_training_27.gif\" WIDTH=177 HEIGHT=153 BORDER=0></TD>");
document.writeln("</TR>");		
document.writeln("</TABLE>");
document.writeln("</DIV>");
}


function generateEmailLink()
{
	document.writeln("<br><a href=\"mailto:info@malucotactical.com\"><span class=\"s8\">info@malucotactical.com</span></a><br><br>");
}


function generateContactInfo()
{
	document.writeln("<div id=\"main_body\" class=\"main\">");
	document.writeln("<table BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=\"625\">");
	document.writeln("<tr>");
	document.writeln("<td ALIGN=CENTER VALIGN=bottom WIDTH=\"625\" HEIGHT=\"1\" ><img SRC=\"../images/spacer.gif\" height=1 width=625></td>");
	document.writeln("</tr>");
	document.writeln("<tr>");
	document.writeln("<td ALIGN=CENTER VALIGN=bottom WIDTH=\"425\" HEIGHT=\"40\" ><img SRC=\"../images/t_contact.gif\" height=34 width=150></td>");
	document.writeln("</tr>");
	document.writeln("<tr>");
	document.writeln("<td><WIDTH=\"625\"><span class=\"s4\"><br>Maluco Tactical Training receives many inquiries every day - we kindly ask you<br> to make sure that your questions or comments are clearly stated.</span></td>");
	document.writeln("</tr>");
	document.writeln("<tr>");
	document.writeln("<td VALIGN=top ALIGN=left WIDTH=\"425\">");
	document.writeln("<br><a href=\"mailto:info@malucotactical.com\"><span class=\"s8\">info@malucotactical.com<br><br></span></a>");
    document.writeln("<span class=\"s6\"> Telephone / Fax Directory</span><br><br>");
    document.writeln("<span class=\"s6\"> Voice:</span><span class=\"s7\"> 1-530-325-3508<br><br></span>");
    document.writeln("<span class=\"s6\"> Fax:</span><span class=\"s7\">   1-530-325-3504<br><br></span></td>");
	document.writeln("</tr>");
	document.writeln("<TR>");
	document.writeln("<TD VALIGN=CENTER ALIGN=CENTER WIDTH=\"391\" HEIGHT=\"18\"><span class=\"s2\"><br><br>Web design by Maluco. All Rights Reserved. Copyright © 2003.</span></TD>");
	document.writeln("</TR>");
	document.writeln("</table>");
	document.writeln("</div>");
}

// ID for DIV with small picture
var smallPhotosDiv = 'main_photo';

// ID for DIV with big picture
var bigPhotoDiv = 'big_photo'

// Name for big picture IMG  
var bigPhotoImgName = 'big_img'

// dummy
var dummyImg = "../images/spacer.gif";

// Image info prototype
function imgInfo(imgName,imgWidth,imgHeight) 
{
	this.name = imgName;
	this.width = imgWidth;
	this.height = imgHeight;
}

// Photos
var bigPhotos = new Array();

bigPhotos[0] = new imgInfo("../images/photo/jeep.jpg","360","275");
bigPhotos[1] = new imgInfo("../images/photo/rappel_heli.jpg","356","275");
bigPhotos[2] = new imgInfo("../images/photo/alpine_troup.jpg","373","275");
bigPhotos[3] = new imgInfo("../images/photo/rappel1.jpg","404","275");
bigPhotos[4] = new imgInfo("../images/photo/james_scot.jpg","360","275");
bigPhotos[5] = new imgInfo("../images/photo/martin.jpg","399","275");
bigPhotos[6] = new imgInfo("../images/photo/neba.jpg","375","275");
bigPhotos[7] = new imgInfo("../images/photo/camouflage.jpg","355","275");
bigPhotos[8] = new imgInfo("../images/photo/swat.jpg","360","275");
bigPhotos[9] = new imgInfo("../images/photo/tire.jpg","360","275");
bigPhotos[10] = new imgInfo("../images/photo/rappel2.jpg","404","275");
bigPhotos[11] = new imgInfo("../images/photo/rappel_greg.jpg","185","275");
bigPhotos[12] = new imgInfo("../images/photo/rappel3.jpg","360","275");
bigPhotos[13] = new imgInfo("../images/photo/group.jpg","400","275");
bigPhotos[14] = new imgInfo("../images/photo/alpine.jpg","419","275");
bigPhotos[15] = new imgInfo("../images/photo/shooting_greg_jazz.jpg","394","275");
bigPhotos[16] = new imgInfo("../images/photo/door_jazz.jpg","360","275");
bigPhotos[17] = new imgInfo("../images/photo/fight.jpg","360","275");
bigPhotos[18] = new imgInfo("../images/photo/cutting.jpg","360","275");
bigPhotos[19] = new imgInfo("../images/photo/drive.jpg","371","275");
bigPhotos[20] = new imgInfo("../images/photo/group1.jpg","360","275");
bigPhotos[21] = new imgInfo("../images/photo/window.jpg","402","275");
bigPhotos[22] = new imgInfo("../images/photo/handgun.jpg","362","275");
bigPhotos[23] = new imgInfo("../images/photo/low_light.jpg","421","275");
bigPhotos[24] = new imgInfo("../images/photo/tower.jpg","201","275");
bigPhotos[25] = new imgInfo("../images/photo/helihopter.jpg","360","275");
bigPhotos[26] = new imgInfo("../images/photo/bow.jpg","387","275");
bigPhotos[27] = new imgInfo("../images/photo/car.jpg","360","275");
bigPhotos[28] = new imgInfo("../images/photo/driving.jpg","474","275");
bigPhotos[29] = new imgInfo("../images/photo/mask.jpg","413","275");
bigPhotos[30] = new imgInfo("../images/photo/group2.jpg","459","275");
bigPhotos[31] = new imgInfo("../images/photo/standing.jpg","216","275");
bigPhotos[32] = new imgInfo("../images/photo/group3.jpg","516","275");
bigPhotos[33] = new imgInfo("../images/photo/classroom.jpg","383","275");
bigPhotos[34] = new imgInfo("../images/photo/seating.jpg","412","275");
bigPhotos[35] = new imgInfo("../images/photo/on_knee.jpg","500","275");
bigPhotos[36] = new imgInfo("../images/photo/low_light1.jpg","362","275");
bigPhotos[37] = new imgInfo("../images/photo/black.jpg","362","275");
bigPhotos[38] = new imgInfo("../images/photo/fight1.jpg","362","275");
bigPhotos[39] = new imgInfo("../images/photo/cars.jpg","432","275");
bigPhotos[40] = new imgInfo("../images/photo/neba1.jpg","357","275");

// Set Filters
var filterShadow = "progid:DXImageTransform.Microsoft.Shadow(color='black', Direction=120, Strength=10)";
var photoFilters = new Array();
photoFilters[0] = "progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0, wipeStyle=0, motion='forward')";
photoFilters[1] = "progid:DXImageTransform.Microsoft.RandomDissolve()"; 
photoFilters[2] = "progid:DXImageTransform.Microsoft.Stretch(stretchStyle='push')";
photoFilters[3] = "progid:DXImageTransform.Microsoft.Wheel(spokes=8)"; 
photoFilters[4] = "progid:DXImageTransform.Microsoft.Barn(orientation=vertical, motion=out)";       
photoFilters[5] = "progid:DXImageTransform.Microsoft.Checkerboard(squaresX=12, squaresY=8, direction='right')";
photoFilters[6] = "progid:DXImageTransform.Microsoft.Inset()";                                       
photoFilters[7] = "progid:DXImageTransform.Microsoft.Iris(irisStyle='CIRCLE', motion='out')";
photoFilters[8] = "progid:DXImageTransform.Microsoft.RadialWipe(wipeStyle='wedge')";                                          
photoFilters[9] = "progid:DXImageTransform.Microsoft.Slide(slideStyle='swap', bands=8)";
photoFilters[10] = "progid:DXImageTransform.Microsoft.Spiral(GridSizeX=64, GridSizeY=64)";                             
photoFilters[11] = "progid:DXImageTransform.Microsoft.Strips(Duration=5, Motion='leftdown')";                                     
photoFilters[12] = "progid:DXImageTransform.Microsoft.zigzag(GridSizeX=16, GridSizeY=16)";           
photoFilters[13] = "progid:DXImageTransform.Microsoft.Shadow(color='black', Direction=120, Strength=10)";

// Load and Show Big Photo
function showBigPhoto(photoIndex) {
                    
    // Replace Big Picture    
    if (is.ns4)    	
    	document.layers[bigPhotoDiv].document[bigPhotoImgName].src = bigPhotos[photoIndex].name;
    
    if (is.DOM2)
    	document[bigPhotoImgName].src = bigPhotos[photoIndex].name;
             
    // Set filter, IE only
    if (is.ie) {
        // var photoFilter = photoFilters[0] + ' ' + filterShadow;
        var photoFilter = photoFilters[0];
    	document.getElementById(bigPhotoDiv).style.filter = photoFilter;
    	document.getElementById(bigPhotoDiv).filters[0].Apply();
    }
    
    // Show Big Photo	
   	if (is.ns4) {
   		document.layers[smallPhotosDiv].visibility = "hide";    	    
		document.layers[bigPhotoDiv].visibility = "show";
	}
						
	if (is.DOM2) {			
        document.getElementById(bigPhotoDiv).style.visibility = "visible"; 
		document.getElementById(smallPhotosDiv).style.visibility = "hidden";
	}   

	// Play filter, IE only
	if (is.ie)
   		document.getElementById(bigPhotoDiv).filters[0].Play(duration=1);          	                   	
}

// Hide Big Photo
function hideBigPhoto() {
        
    // Switch slides	
   	if (is.ns4) {   		   	    
		document.layers[bigPhotoDiv].visibility = "hide";
		document.layers[smallPhotosDiv].visibility = "show";			
	}
	 
	if (is.DOM2) {			
        document.getElementById(bigPhotoDiv).style.visibility = "hidden";
        document[bigPhotoImgName].src = dummyImg;
		document.getElementById(smallPhotosDiv).style.visibility = "visible";
	}   	         	                   	
}

// Photo Album Big Picture, Netscape 4 workaround
// Required as Netscape 4 can't dinamicaly change image size
var imgIndex;
var parentIndex;

// Get big photo index and parent page
function getRetInfo()
{
	// Get passed variables
	var retInfo = window.location.search.substring(1);
	
	// split retInfo string into an array
	var splitRetInfo = retInfo.split("&");

	// caller page index
	parentIndex = splitRetInfo[0];
	
	// image index
	imgIndex = parseInt(splitRetInfo[1],10);		
}


// generate div for big photo	
function generateBigPhoto()
{
	getRetInfo();	
	var photo = bigPhotos[imgIndex];
	var parentPage = "photo" + parentIndex + "_ns4.htm";
	
	document.writeln("<div id=\"big_photo\" class=\"main_big_photo1\">");
	document.writeln("<center>");
	document.writeln("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
	document.writeln("<tr>");
	document.writeln("<td><img src=\"../images/spacer.gif\" height=\"1\" border=\"0\"></td>");
	document.writeln("</tr>");
	document.writeln("<tr>");		
	document.writeln("<td align=\"center\" valign=\"center\"><img src=\"" + photo.name + "\" width=" + photo.width + " height=" + photo.height + " name=\"big_img\" alt=\"Big Photo\" border=\"0\"></td>");
	document.writeln("</tr>");
	document.writeln("<tr>");
	document.writeln("<td><img src=\"../images/spacer.gif\" height=\"20\" border=\"0\"></td>");
	document.writeln("</tr>");
	document.writeln("<tr>");
	document.writeln("<td align=\"center\" valign=\"center\"><a href=\"" + parentPage + "\"><img src=\"../images/photo/close_btn.gif\" width=\"80\" height=\"30\" alt=\"Close\" border=\"0\"></a></td>");
	document.writeln("</tr>");	
	document.writeln("</table>");
	document.writeln("</center>");
	document.writeln("</div>");
}

function sndMail(a)
{
	a.href='mailto:info@malucotactical.com'
}
        
function chkForm(formPtr)
{	
	if(formPtr.name.value == "")
	{
		alert("Please enter your full name!");
  		formPtr.name.focus();
  		return false;
 	}
 	
 	if (formPtr.home_phone.value == "")
 	{
  		alert("Please enter your contact phone number!");
  		formPtr.home_phone.focus();
  		return false;
 	}
 	
 	
 	if(formPtr.email.value == "")
 	{
  		alert("Please enter your email address!");
  		formPtr.email.focus();
  		return false;
  	} 
 	else
 	{
  		idx1 = formPtr.email.value.indexOf('@', 0);
  		idx2 = formPtr.email.value.indexOf('.', 0);
  		if (idx1 == -1 || idx2 == -1 || idx1 > idx2) { 
	 		alert("This is not a correct email address!");
	 		formPtr.email.focus();
  			return false;
		}
  	}
  	 		
 	if (formPtr.emergency_contact.value == "")
 	{
  		alert("Please enter contact phone number in case of an emergency!");
  		formPtr.emergency_contact.focus();   
  		return false;
 	}
 	
 	alert("You will be now forwarded to your email application from which you can send this application form.");  
 	formPtr.action = "mailto:info@malucotactical.com?subject=Student Application Form";
 	//formPtr.action = "mailto:pkostic@telus.net?subject=Student Application Form";
 	formPtr.submit();
 	document.location ="#Top";
 	formPtr.reset();
	return true;
}	
