var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
	plugin = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 5;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))\n');
	document.write('</SCRIPT\> \n');
}

// BrowserCheck Object
function BrowserCheck() {
	var b = navigator.appName
	var u = navigator.userAgent	
	if (u.indexOf("Gecko")>-1) {
		this.b = "gecko";
	} else {
		if (b=="Netscape") this.b = "ns"
		else if (b=="Microsoft Internet Explorer") this.b = "ie"
		else this.b = b
	}

	this.version = navigator.appVersion
	this.v = parseInt(this.version)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="gecko" && this.v==5)
	this.ns6 = (u.indexOf('Netscape6')>0)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (this.version.indexOf('MSIE 4')>0)
	this.ie5 = (this.version.indexOf('MSIE 5')>0)
	this.ie6 = (this.version.indexOf('MSIE 6')>0)	
	this.min = (this.ns5||this.ie5||this.ie6)
}
is = new BrowserCheck()

function checkBrowserCompatibility(yesPage,noPage,frame) {
	if (is.min) {
		self.top.frames[frame].location=yesPage;
	} else {
		self.top.frames[frame].location=noPage;
	}
}

function openWindow(location,name,width,height,resizeable,scrollbars,toolbar,menu,status,directories,returnValue) {
	var featuresString = "";
	var windowHandle;
	if (width != null) featuresString += "width=" + width;
	if (height != null) featuresString += ",height=" + height;
	if (resizeable != null) featuresString += ",resizable=yes";
	if (scrollbars != null) featuresString += ",scrollbars=yes";
	if (toolbar != null) featuresString += ",toolbar=yes";
	if (menu != null) featuresString += ",menu=yes";
	if (status != null) featuresString += ",status=yes";
	if (directories != null) featuresString += ",directories=yes";
	windowHandle = window.open(location,name,featuresString);

	windowHandle.focus();

	if (returnValue != "") {
		return eval(returnValue);
	} else {
		return windowHandle;
	}
}

function debug(object) {
	var output = typeof object + " properties :\n";
	
	if (String(typeof object).indexOf("object") > -1) {	
		for (var i in object) {
			if (String(typeof object[i]).indexOf("function") > -1) { continue }
			output += i + " = " + object[i] + "\n";
		}
	} else {
		output = object;
	}
	alert(output);
	return null;
}
