/* 
	Club GTI - "common.js"
	(C) Club GTI, All Rights Reserved. 2006.
*/

////////////////////////////////////////////////////////////////
// domHelper - a class that will 
// - help find width and height properties
// - help find x & y positions 
////////////////////////////////////////////////////////////////

var domHelper = function () {
	
	var d = this;

	d.init = function () { 
		if(document.getElementById) {
			// DOM-compliant browsers
			d.getRefById = function(e) { return document.getElementById(e) };
		} else if(document.all) {
			// Older Browsers
			d.getRefById = function(e) { return document.all[e] || null };
		}
	}

	d.getElementHeight = function (p_Element) {
		var e=d.getRefById(p_Element); 
		var h=0;
		var o=document.defaultView;
		if(e) {
			// DOM-compliant browsers
			if(o && d.getComputedStyle) {
				h = d.getComputedStyle(e, null).height;
			// Older Browsers
			} else if('number' == typeof e.offsetHeight) {
				h = e.offsetHeight + 'px';
			}
		}
		return parseInt(h);
	}
	
	d.msg = function (p_Str) { 
		alert(p_Str);
	}
	
	d.init();
		
}

////////////////////////////////////////////////////////////////
// zoomImage - simple function to show large images
////////////////////////////////////////////////////////////////

function zoomImage(p_imgsrc,p_type,p_scroll){
	
	
	if ( p_type=="l") { // landscape 
		if ( p_scroll ) { 
			window.open(p_imgsrc, "zoomImageWindow", "toolbar=no, menubar=no ,location=no, scrollbars=yes, resizable=no, width=620, height=400, top=" + (screen.height/2 - 200) + ", left=" + (screen.width/2 - 310) + "\"");
		} else {
			window.open(p_imgsrc, "zoomImageWindow", "toolbar=no, menubar=no ,location=no, scrollbars=no, resizable=no, width=600, height=400, top=" + (screen.height/2 - 200) + ", left=" + (screen.width/2 - 300) + "\"");
		}
	} 
	if ( p_type=="p")  { // portrait
		window.open(p_imgsrc, "zoomImageWindow", "toolbar=no, menubar=no ,location=no, scrollbars=no, resizable=no, width=300, height=450, top=" + (screen.height/2 - 225) + ", left=" + (screen.width/2 - 150) + "\"");
	}
}

