var detect = navigator.userAgent.toLowerCase();
bw=new lib_bwcheck(); //Browsercheck object

function lib_bwcheck(){ 
  this.ver=navigator.appVersion;
  this.agent=navigator.userAgent;
  this.dom=document.getElementById?1:0;
  this.opera=this.agent.indexOf("Opera")>-1;
  this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera)?1:0; 
  this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera)?1:0;
  this.ie4=(document.all && !this.dom && !this.opera)?1:0;
  this.ie=this.ie4||this.ie5||this.ie6;
  this.mac=this.agent.indexOf("Mac")>-1;
  this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
  this.ns4=(document.layers && !this.dom)?1:0;
  this.mozilla = (this.agent.indexOf("Mozilla")>-1 && !this.opera && !this.ie && !this.ns4)?1:0;
  this.bw=(this.ie6||this.ie5||this.ie4||this.ns4||this.ns6||this.opera);
  return this;
}

function makeflash(flashfile,flashheight,flashwidth){
var opent = "<";var close = ">";var flashobj = "";

if(bw.opera||bw.ns4||bw.ns6||bw.mozilla){//do this only for browsers that uses Deprecated embed tag
flashobj += opent+'embed src=\"'+flashfile+'\" quality=\"high\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"'+flashwidth+'\" height=\"'+flashheight+'\"'+close;
flashobj += opent+'/emb'+'ed'+close;
if(bw.mozilla){}//for some strange reason mozilla don't work without a alert box, try it your self.. when this line is present it works
}else{//do this if the browser uses the new object tag
	if(checkIt('mac')){
		flashobj += opent+'embed src=\"'+flashfile+'\" quality=\"high\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"'+flashwidth+'\" height=\"'+flashheight+'\"'+close;
		flashobj += opent+'/emb'+'ed'+close;
	}else{
		flashobj += opent+'obje'+'ct classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\"';
		flashobj += 'width=\"'+flashwidth+'\" height=\"'+flashheight+'\"'+close;
		flashobj += opent+'param name=\"movie\" value=\"'+flashfile+'\"'+close;
		flashobj += opent+'param name=\"quality\" value=\"high\"'+close;
		flashobj += opent+'/obje'+'ct'+close;
	}

}

return flashobj;
}

function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}
function openlarger(flashfile,flashheight,flashwidth){
var opent = "<";var close = ">";var flashobj = "";

		flashobj += 'width=\"'+flashwidth+'\" height=\"'+flashheight+'\"'+close;
		flashobj += opent+'param name=\"pic\" value=\"'+flashfile+'\"'+close;
		flashobj += opent+'/obje'+'ct'+close;
	}

}

return flashobj;
}

function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}