
// Simple go to url function
function goToUrl(url) {
	if (url != "") {
		location = url;
	}
}

// Window opener code
function openWindow(url) {
	window.open(url, '', 'width=800, height=577, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no');
}

// Smooth way of returning user to top of page.
function backToTop() {
    var x1 = x2 = x3 = 0;
    var y1 = y2 = y3 = 0;
    if (document.documentElement) {
        x1 = document.documentElement.scrollLeft || 0;
        y1 = document.documentElement.scrollTop || 0;
    }
    if (document.body) {
        x2 = document.body.scrollLeft || 0;
        y2 = document.body.scrollTop || 0;
    }
    x3 = window.scrollX || 0;
    y3 = window.scrollY || 0;
    var x = Math.max(x1, Math.max(x2, x3));
    var y = Math.max(y1, Math.max(y2, y3));
    window.scrollTo(Math.floor(x / 2), Math.floor(y / 2));
    if (x > 0 || y > 0) {
        window.setTimeout("backToTop()", 100);
    }
}

// Write flash without IE putting border around when mousing over
function writeFlash(id, width, height, movie, quality, bgcolor) {
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width+'" height="'+height+'" id="'+id+'">\n');
    document.write('<param name="allowScriptAccess" value="sameDomain">\n');
    document.write('<param name="movie" value="'+movie+'">\n');
	document.write('<param name="quality" value="'+quality+'">\n');
	document.write('<param name="bgcolor" value="'+bgcolor+'">\n');
	document.write('<embed src="'+movie+'" quality="'+quality+'" width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'" name="'+id+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>\n');
	document.write('</object>\n');
}

// Write embedded video without IE putting border around when mousing over
function writeEmbeddedVideo(width, height, movie, wmode) {
	document.write('<object width="'+width+'" height="'+height+'">\n');
    document.write('<param name="movie" value="'+movie+'"></param>\n');
	document.write('<param name="wmode" value="'+wmode+'"></param>\n');
	document.write('<embed src="'+movie+'" type="application/x-shockwave-flash" wmode="'+wmode+'" width="'+width+'" height="'+height+'"></embed>\n');
	document.write('</object>\n');
}
