String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };
var EMailValidation = "[A-Za-z0-9_\.\-]+\@[A-Za-z0-9_\.\-]+\.[A-Za-z0-9_\.\-]+";

var domOk = document.getElementById;
var IsIE = !window.innerWidth;
var IsIE7 = false;

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 swfstr = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="{width}" height="{height}"><param name="movie" value="{url}"><param name="quality" value="high"><embed src="{url}" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="{width}" height="{height}"></embed></object>';
function InitializeFlashObject(id,url,width,height) {
	try {
		//alert (swfstr.replace(/\{url\}/g, url).replace(/\{height\}/g, height).replace(/\{width\}/g, width));
		GetRef(id).innerHTML = swfstr.replace(/\{url\}/g, url).replace(/\{height\}/g, height).replace(/\{width\}/g, width);
	} catch (e) {
		//alert (e);
	}
}