﻿
/**
*
*/
window.onresize = onResize;
var minHeight = 0;

function onResize() {
	var obj 				= document.getElementById('flashcontent');	
		obj.style.height 	= "100%"; // gives correct 100% calculation
	var h					= (obj.offsetHeight) ? obj.offsetHeight : obj.clientHeight;
		obj.style.height	= (h < minHeight) ? minHeight + "px" : "100%";
}

/**
*
*/
function updateMinHeight($height) {
	minHeight = $height;
	onResize();
}

/**
*
*/
function getHeight() {
	var h = 0;
	if (window.innerWidth) //if browser supports window.innerWidth
		h = window.innerHeight;
	else if (document.all) //else if browser supports document.all (IE 4+)
		h = document.body.clientHeight;
	return h;
}
























/**
*
*/
function flashObj() {
	return swfobject.getObjectById("flashcontent") ;
}

/**
* Pipped from SWFAddress popup()
*/
var popupwindow;
function popup (main, w, h, isBlocked) {
	var ww,hh;
	if (navigator.appName.indexOf("Microsoft") != -1) {
		ww=document.body.clientWidth/2;
		hh=document.body.clientHeight/2;
	}else{
		ww=window.innerWidth/2;
		hh=window.innerHeight/2;
	}	
	popupwindow = window.open(main,'','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=' + w + ', height=' + h);
	
	return (popupwindow)?true:false;
}

/**
* returns isClosed (true if popup closed, false if open)
*/
function checkPopup() {
	return popupwindow.closed;
}

/**
* Update the size of the HTML (uses browser scroll)
*/
function updateSize(height) {
	var docH = (window.innerHeight || document.body.offsetHeight);
	document.getElementsByTagName("body")[0].style.height = (docH <= height) ? height + "px" : "100%";
}

var newWindow = new Array();
/**
*
*/
function getLocation(url,target) {
	newWindow[target] = window.open(url,target,'');
	if(newWindow[target]) newWindow[target].focus();
	return false;
}

/**
* convert site query-string to a hash-array
*/
function querySt(ji) {
	hu = window.location.search.substring(1);
	gy = hu.split("&");
	if(!ji) {
		return gy;
	}else {
		for (i=0;i<gy.length;i++) {
			ft = gy[i].split("=");
			if (ft[0] == ji) {
				return ft[1];
			}
		}
	}
}

/**
* Google tracking. 
*/
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
function trackPage(page) {
	try {
		var pageTracker = _gat._getTracker("UA-1575735-4"); // ("UA-7695801-3");
		pageTracker._trackPageview(page);
	} catch(err) {}
}
trackPage();
