// JScript source code
/*
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// JAVASCRIPT by Mark Latimer: Latimer-CAD. www.latimer-cad.com. mark@latimer-cad.com  //
// Code Version 1.1                                                                                                            //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
*/

/*  On resize event handler... */
function resizepage1(){
	var e;
	e = window.event;
	positionLayers(1);
}

/*  On resize event handler... */
function resizepage0(){
	var e;
	e = window.event;
	positionLayers(0);
}

/*  On resize event handler... */
function resizepage2(){
	var e;
	e = window.event;
	positionLayers(2);
}

/*  On resize event handler... */
function resizepage6(){
	var e;
	e = window.event;
	positionLayers(6);
}

/* This function handles moving the layers according to the page size */
function positionLayers(cnt){
	var w, iw, i;
	if(isIE){
		w =document.body.offsetWidth;

		if(w>705){
			divTitle.style.left = (w - 700)/2;
			if(cnt ==0) return;
			div1.style.left = (w - 700)/2;
			if(cnt ==1) return;
			div2.style.left = (w - 700)/2;
			if(cnt ==2) return;
			div3.style.left = (w - 700)/2;
			if(cnt ==3) return;
			div4.style.left = (w - 700)/2;
			if(cnt ==4) return;
			div5.style.left = (w - 700)/2;
			if(cnt ==5) return;
			if(div6 != null) div6.style.left = (w - 700)/2;
		}
		
		status = "Latimer CAD Limited";
		return;
	}
	
	if(isNAV){
		w = window.document.width;

		if(w>705){
			document.getElementById('divTitle').style.left = (w - 690)/2;
			document.getElementById('divTitle').style.top = 25;
			if(cnt ==0) return;
			document.getElementById('div1').style.left = (w - 690)/2;
			if(cnt ==1) return;
			document.getElementById('div2').style.left = (w - 690)/2;
			if(cnt ==2) return;
			document.getElementById('div3').style.left = (w - 690)/2;
			if(cnt ==3) return;
			document.getElementById('div4').style.left = (w - 690)/2;
			if(cnt ==4) return;
			document.getElementById('div5').style.left = (w - 690)/2;
			if(cnt ==5) return;
			document.getElementById('div6').style.left = (w - 690)/2;
		}
	}
	
	status = "Latimer CAD Limited";
}

function goToLink(form){
	location.href=form.options[form.selectedIndex].value;
}

function goToLinkasPopup(form){
	showProductPopup( form.options[form.selectedIndex].value );
}

function goToLinkasSmallPopup(form){
	showSmallProductPopup(form.options[form.selectedIndex].value );
}

function showProductPopup(doc){
	var h, w, feat, win;
// takes the doc as a filename and displays it in a popup window
// which is full desktop height and 100px wide..
// h = desktop height
// w = desktop width
	var txt = doc;
	window.status = txt;

	w = window.screen.width/3;
	h = window.screen.height;
		
	if(isIE){
		feat = "left=" + ((w*2) - 10);
		feat += " height=" + (h-75);
		feat += " top=50";
		feat += " width=" + (w-10);
		feat += " resizable=no";
		feat += " toolbar=no";
		feat += " scrollbars=yes";
		win = window.open(doc, "Product", feat, false);
		win.name = "product";
	}
	
	
	if(isNAV){
		feat = "screenX=" + (w*2);
		feat += " height=" + window.height;
		feat += " screenY=" + window.screenY;
		feat += " outerWidth=" + (w-10);
		feat += " resizable=no";
		feat += " toolbar=no";
		feat += " scrollbars=yes";
		win = window.open(doc, "Product", feat, false);
		win.name = "product";
		win.location = doc;
		document.getElementById('divTitle').style.top = 25;
		win.scrollbars.visible=true;
		
	}
}

function showSmallProductPopup(doc){
	var h, hh, ww, w, feat, win;
// takes the doc as a filename and displays it in a popup window
// which is full desktop height and 250px wide..
// h = desktop height
// w = desktop width

	w = 290;
	h = window.height;

	if(isIE){
		ww =document.body.offsetWidth;
	
		feat = "left=" + (ww - w);
		feat += " height=" + h;
		feat += " top=75";// + window.top;
		feat += " width=" + w;
		feat += " resizable=yes";
		feat += " toolbar=no";
		feat += " scrollbars=yes";
		win = window.open(doc, "Product", feat, false);
		win.name = "Product";
		win.moveTo(ww - w, 100);
		win.focus();
	}
	
	if(isNAV){
		ww = outerWidth + window.screenX;
	
		feat = "screenX=" + (ww - w);
		feat += " height=" + h;
		feat += " screenY=" + window.screenY;
		feat += " outerWidth=" + w;
		feat += " resizable=yes";
		feat += " toolbar=no";
		feat += " scrollbars=yes";
		win = window.open("", "Product", feat, false);
		win.name = "Product";
		win.location = doc; 
		document.getElementById('divTitle').style.top = 25;
		win.outerWidth = w;
		win.focus();
		win.scrollbars.visible=true;
		
	}
}
