/*
* // old functions edied by jeff 4/17/07 in order to fix shared object issue for flash 7 * 8
* function fembed(movie, width, height, quality, bgcolor) {
	document.write("<object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 width=" + width + " height=" + height + "><param name=allowScriptAccess value=sameDomain><param name=movie value=" + movie + "><param name=quality value=" + quality + "><param name=bgcolor value=" + bgcolor + "><embed src=" + movie + " quality=" + quality + " bgcolor=" + bgcolor + " width=" + width + " height=" + height + " allowScriptAccess=sameDomain type=application/x-shockwave-flash></object><br>");
}
function fembedt(movie, width, height, quality, bgcolor) {
	document.write("<object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 width=" + width + " height=" + height + "><param name=wmode value=transparent><param name=allowScriptAccess value=sameDomain><param name=movie value=" + movie + "><param name=quality value=" + quality + "><param name=bgcolor value=" + bgcolor + "><embed src=" + movie + " quality=" + quality + " bgcolor=" + bgcolor + " width=" + width + " height=" + height + " wmode=transparent allowScriptAccess=sameDomain type=application/x-shockwave-flash></object><br>");
}
*/



function fembed(movie, width, height, quality, bgcolor) {
	if (document.URL.indexOf("http://") > -1 && document.URL.indexOf("http://localhost") == -1){
		var prefix_url = getURLWithWWW(document.URL);
		var base_url = getBaseDir(prefix_url);
		movie = base_url + movie;
	}
	//document.write(movie + "<br>");
	document.write("<object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 width=" + width + " height=" + height + "><param name=allowScriptAccess value=sameDomain><param name=movie value=" + movie + "><param name=quality value=" + quality + "><param name=bgcolor value=" + bgcolor + "><embed src=" + movie + " quality=" + quality + " bgcolor=" + bgcolor + " width=" + width + " height=" + height + " allowScriptAccess=sameDomain type=application/x-shockwave-flash></object><br>");
}

function fembedt(movie, width, height, quality, bgcolor) {
	if (document.URL.indexOf("http://") > -1 && document.URL.indexOf("http://localhost") == -1){
		var prefix_url = getURLWithWWW(document.URL);
		var base_url = getBaseDir(prefix_url);
		movie = base_url + movie;
	}
	//document.write(movie + "<br>");
	document.write("<object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 width=" + width + " height=" + height + "><param name=wmode value=transparent><param name=allowScriptAccess value=sameDomain><param name=movie value=" + movie + "><param name=quality value=" + quality + "><param name=bgcolor value=" + bgcolor + "><embed src=" + movie + " quality=" + quality + " bgcolor=" + bgcolor + " width=" + width + " height=" + height + " allowScriptAccess=sameDomain wmode=transparent type=application/x-shockwave-flash></object><br>");
}

function getURLWithWWW(url_in){
	var url_out = url_in;
	return url_out;
}
function isIP(url_in){
	//strip off 'http://'
	var url_part = url_in.substring(7, url_in.length)
	var dotArr = url_part.split(".");
	var out = isInteger(dotArr[0]);
	//alert("is " + dotArr[0] + " an integer? " + out);
	return out;
	
}

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function getBaseDir(url_in){
	var len = url_in.length;
	var i = len - 1;

	// look for the first slash
	for (i = len - 1; i >= 0; i--) {
		var comp = url_in.substr(i, 1);
		if (comp == "/"){
			i++;
			break;
		}
	}
	var out_str = url_in.substring(0, i);
	return out_str;
}
