
var domOk = document.getElementById;
var IsIE = !window.innerWidth;
var IsIE7 = false;
var IsIE6 = false;
var IsTextMode = false;
var IEBody = (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body;



function GetRef(id) {
    return document.getElementById(id);
}

function PadWithZeros(i) {
    if (i<10) { return "0"+i; } else { return ""+i; }
}

function DoNothing() {}

function OpenLink(url) {
    window.open(url,null,'width=750,height=500,status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes');
}

function OpenLink2(url) {
    window.open(url,null,'width=750,height=500,status=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes');
}


function ShowElement(id) { GetRef(id).style.display = "block"; }
function HideElement(id) { GetRef(id).style.display = "none"; }

function CurrentTime() { return (new Date().getTime()); }

function ToInteger(value) {
    value = value + "";
    var i = parseInt(value.match(/\d+/), 10);
    return isNaN(i) ? 0 : i;
}

function FindPosition(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return {Left: curleft, Top: curtop};
}

function ElementDefault(ref) {	ref.className = ref.className.replace(/Over/g, "Default"); }
function ElementOver(ref) { ref.className = ref.className.replace(/Default/g, "Over");  }

var swf='<object id="FlashMovie" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="{sizeWidth}" height="{sizeHeight}" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="{path1}" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="{path1}" quality="high" wmode="transparent" bgcolor="#ffffff" width="{sizeWidth}" height="{sizeHeight}" name="Hetronic" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
function SwitchMovie(id, path1, sizeWidth, sizeHeight) {
try {
		swfmoviestr = swf.replace(/\{path1\}/g, path1);
		swfmoviestr = swfmoviestr.replace(/\{sizeHeight\}/g, sizeHeight);
		swfmoviestr = swfmoviestr.replace(/\{sizeWidth\}/g, sizeWidth);
		document.getElementById(id).innerHTML = swfmoviestr;
	}
	catch (e) {
	}
}





function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function changeSize(size) {
    var href = location.href + "";
    href = href.replace(/\?size=minimise/g, "");
    href = href.replace(/\?size=maximise/g, "");
    href = href.replace(/\&size=minimise/g, "");
    href = href.replace(/\&size=maximise/g, "");
    location = href + (href.indexOf("?")>-1 ? "&" : "?") + "size=" + size;
}

function BrowserWidth() {
	if (window.innerWidth) {
		return window.innerWidth;
	} else if (document.all) {
		return IEBody.clientWidth;
	} else {
		return 999;
	}
}

function BrowserHeight() {
	if (window.innerHeight) {
		return window.innerHeight;
	} else if (document.all) {
		return IEBody.clientHeight;
	} else {
		return 999;
	}
}

function resizeSite() {
	preProcess();
    var Website = GetRef("Website");
    var width = BrowserWidth();
    if (width<1124) {
        Website.style.width = "1124px";
	}
    postProcess();

}

function preProcess() {}
function postProcess() {}
