function popUp(sURL,sName,x,y,dx,dy){
 if(!sURL)return;
 window.open(sURL,sName,'left='+x+',top='+y+',screenX='+x+',screenY='+y+',width='+dx+',height='+dy+',scrollbars=1,resizable=1');
}
 function GoURL(s){
 document.location=s;
}
 function Add2Fav(){
 if(document.all)
 window.external.AddFavorite(document.location.href,document.title)
}
 function OpenPreview(sURL){
 if(!sURL)return;
 var w_s=50;
 var h_s=50;
 var w=window.screen.width;
 var h=window.screen.height;
 popUp(sURL,'Preview'+Math.floor(Math.random()*1000),w_s,h_s,w-2*w_s,h-2*h_s-50);
}
 function OpenImages(id,f){
 OpenPreview('index.php?page=images&id='+id+'&f='+f);
}
 function hwReloadCat(page,cid,hwJsCats,catbox){
 if(typeof(catbox)!="object")catbox=document.frm.cid;
 var new_cid=catbox.options[catbox.selectedIndex].value;
 var s1='|'+new_cid+'|';
 var s2='|'+cid+'|';
 var f1,f2;
 for(i=0;i<hwJsCats.length;i++){
 f1=hwJsCats[i].indexOf(s1)!=-1;
 f2=hwJsCats[i].indexOf(s2)!=-1;
 if(f1&&f2)return false;
 if(f1||f2)break;
}
 if(page!=""){
 var ch_sep=page.indexOf('?')!=-1?'&':'?';
 document.location=page+ch_sep+'cid='+new_cid;
}
 return true;
}
 function txtCount(f,countf,max){
 if(isNaN(max))return txtCountW(f,countf,max);
 if(f.value.length>max)f.value=f.value.substring(0,max);
 else countf.value=max-f.value.length;
}
 function txtCountW(f,countf,max){
 var num=0;
 for(x=0;x<f.value.length;x++){
 
 if(f.value.charAt(x)==" "&&f.value.charAt(x-1)!=" ")num++;
 if(num>250)f.value=f.value.substring(0,x);
 else countf.value=parseInt(max)-num;
}
}
 function hwGetMenuValue(ctl){
 ctl=eval('document.'+ctl);
 return ctl.options[ctl.selectedIndex].value;
}
 function SwitchItemsAdm(block){
 if(!block)block='chk_id';
 var on=document.frm.chk_all.checked;
 var el=document.frm.elements;
 for(var i=0;i<el.length;i++){
 if(el[i].name.substr(0,block.length)==block&&!el[i].disabled)el[i].checked=on;
}
}
 function LookupUserAdm(ctl){
 popUp('index.php?page=lookup_uid&tg='+escape(ctl),'LookupUID',50,50,400,window.screen.height-150);
}
 function hwGetElementById(id){
 if(document.getElementById)return(document.getElementById(id));
 else if(document.all)return(document.all[id]);
 else if((navigator.appname.indexOf("Netscape")!=-1)&&parseInt(navigator.appversion==4))return(document.layers[id]);
}
 function hwShowPass(ctl){
 alert(eval('document.frm.'+ctl).value);
}
 function SwitchBlock(Id,bShow){
 var el;
 if(document.getElementById)el=document.getElementById(Id);
 else{el=document.all?document.all[Id]:new Object()}
 if(!el)return;
 if(el.style)el=el.style;
 if(typeof(el.display)=='undefined'&&!(window.ScriptEngine&&ScriptEngine().indexOf('InScript')+1)){alert('Browser Error!');return}
 el.display=bShow?'block':'none';
}
 
 var com={};
 com.anychart={};
 var Browser=function(){};
 Browser.isIE=/(msie|internet explorer)/i.test(navigator.userAgent);
 Browser.isSafari=/safari/i.test(navigator.userAgent);
 com.anychart.AnyChart=function(){
 switch(arguments.length){
 case 0:
 this.constructor();
 break;
 case 1:
 this.constructor(arguments[0]);
 break;
 case 2:
 this.constructor(arguments[0],arguments[1]);
 break;
}
};
 var AnyChart=com.anychart.AnyChart;
 AnyChart._charts={};
 AnyChart.prototype={
 id:null,
 width:NaN,
 height:NaN,
 quality:"high",
 bgColor:"#FFFFFF",
 swfFile:null,
 preloaderSWFFile:null,
 flashObject:null,
 _containerNode:null,
 _containerId:null,
 _isWrited:false,
 preloaderInitText:null,
 preloaderLoadingText:null,
 initText:null,
 xmlLoadingText:null,
 resourcesLoadingText:null,
 noDataText:null,
 waitingForDataText:null,
 templatesLoadingText:null,
 wMode:null,
 _canDispatchEvent:false,
 _nonDispatcedEvents:null,
 _protocol:"http",
 constructor:function(){
 if(location.protocol=='https:')
 this._protocol='https';
 else
 this._protocol='http';
 
 this.id=AnyChart.getUniqueChartId();
 switch(arguments.length){
 case 0:
 this.swfFile=AnyChart.swfFile;
 this.preloaderSWFFile=AnyChart.preloaderSWFFile;
 break;
 case 1:
 this.swfFile=arguments[0];
 this.preloaderSWFFile=AnyChart.preloaderSWFFile;
 break;
 case 2:
 this.swfFile=arguments[0];
 this.preloaderSWFFile=arguments[1];
 break;
}
 this.width=AnyChart.width;
 this.height=AnyChart.height;
 this.quality='high';
 this.bgColor='#FFFFFF';
 this._xmlFile=null;
 this.loaded=false;
 this._listeners=new Array();
 this._loaded=false;
 this._created=false;
 this._canDispatchEvent=false;
 this._nonDispatcedEvents=new Array();
 this.wMode=null;
 var ths=this;
 this.addEventListener('create',function(e){
 ths._onChartLoad();
});
 this.addEventListener('draw',function(e){
 ths._onChartDraw();
});
 this._xmlSource=null;
 this._isWrited=false;
 this._containerId=null;
 this._containerNode=null;
 this.preloaderInitText=AnyChart.preloaderInitText;
 this.preloaderLoadingText=AnyChart.preloaderLoadingText;
 this.initText=AnyChart.initText;
 this.xmlLoadingText=AnyChart.xmlLoadingText;
 this.resourcesLoadingText=AnyChart.resourcesLoadingText;
 this.noDataText=AnyChart.noDataText;
 this.waitingForDataText=AnyChart.waitingForDataText;
 this.templatesLoadingText=AnyChart.templatesLoadingText;
 AnyChart._registerChart(this);
},
 write:function(){
 if(!this._checkPlayerVersion())return;
 if(this._isWrited)return;
 var htmlCode=this._getFlashObjectHTML();
 if(arguments[0]==undefined){
 this._writeToCurrentWindow(htmlCode);
}else{
 var target=arguments[0];
 if(!Browser.isIE&&(!Browser.isSafari&&target instanceof Window)){
 this._writeToWindow(target,htmlCode);
}else if(typeof(target)=='string'||(!Browser.isSafari&&target instanceof String)){
 this._writeToHTMLTarget(target,htmlCode);
}else if(Browser.isIE&&target.innerHTML==undefined){
 this._writeToWindow(target,htmlCode);
}else{
 this._writeToHTMLTarget(target,htmlCode);
}
}
 this._canDispatchEvent=true;
 for(var i=0;i<this._nonDispatcedEvents.length;i++){
 this.dispatchEvent(this._nonDispatcedEvents[i]);
}
 this._isWrited=true;
},
 
 _writeToCurrentWindow:function(htmlCode){
 this._writeToWindow(window,htmlCode);
},
 _writeToWindow:function(w,htmlCode){
 this._initFlashObject(w,htmlCode,false);
 this._initResize(w);
 if(w!=window){
 w.AnyChart=AnyChart;
}
},
 _writeToHTMLTarget:function(target,htmlCode){
 if(typeof(target)=='string'||(!Browser.isSafari&&target instanceof String)){
 target=document.getElementById(String(target));
}
 this._initFlashObject(target,htmlCode,true);
 this._initResize(window);
},
 _createContainer:function(){
 this._containerId=AnyChart._getUniqueContainerId(this.id);
 var container=document.createElement('div');
 container.setAttribute('id',this._containerId);
 this._initPrint();
 return container;
},
 _initFlashObject:function(htmlTarget,htmlCode,useInnerHTML){
 var target=(Browser.isIE)?htmlTarget:this._createContainer();
 
 if(Browser.isIE){
 try{
 var path=document;
 var obj=target;
 var hasErrorsInTree=false;
 if(obj!=undefined){
 obj=obj.parentNode;
 while(obj!=undefined&&obj!=null){
 if(obj.nodeName!=null&&obj.nodeName.toLowerCase()=='form'){
 if(obj.name==undefined||obj.name==null||obj.name.length==0){
 hasErrorsInTree=true;
 break;
}else{
 path=path.forms[obj.name];
}
}
 obj=obj.parentNode;
}
}
}catch(e){}
 if(!hasErrorsInTree){
 window[this.id]=new Object();
 window[this.id].SetReturnValue=function(){};
 try{
 if(useInnerHTML){
 target.innerHTML=htmlCode;
}else{
 target.document.write(htmlCode);
}
}catch(e){}
 window[this.id].SetReturnValue=null;
 var fncts={};
 for(var j in window[this.id]){
 if(typeof(window[this.id][j])=='function')
 fncts[j]=window[this.id][j];
}
 window[this.id]=path[this.id];
 
 this.flashObject=window[this.id];
 for(var j in fncts){
 this._rebuildExternalInterfaceFunction(this.flashObject,j);
}
 this._onHTMLCreate();
}
}else{
 target.innerHTML=htmlCode;
 this._createImage(target);
 if(useInnerHTML){
 htmlTarget.innerHTML='';
 htmlTarget.appendChild(target);
}else{
 htmlTarget.document.getElementsByTagName('body')[0].appendChild(target);
}
 this.flashObject=document.getElementById(this.id);
 this._containerNode=this.flashObject.parentNode;
 this._onHTMLCreate();
}
},
 _rebuildExternalInterfaceFunction:function(obj,functionName){
 eval('obj[functionName]=function(){return eval(this.CallFunction("<invoke name=\\"'+functionName+'\\" returntype=\\"javascript\\">"+__flash__argumentsToXML(arguments,0)+"</invoke>"))}');
},
 _getFlashObjectHTML:function(){
 return Browser.isIE?this._getObjectHTML():this._getEmbedHTML();
},
 _buildFlashVars:function(){
 var res=new String();
 res+='__externalObjId='+this.id;
 if(this._xmlFile!=null)
 res+='&XMLFile='+this._xmlFile;
 if(AnyChart.useBrowserResize&&!Browser.isIE)
 res+='&__jsresize=1';
 if(this.preloaderSWFFile!=null){
 res+='&swffile='+this.swfFile;
 if(this.preloaderInitText!=null)
 res+='&preloaderInitText='+this.preloaderInitText;
 if(this.preloaderLoadingText!=null)
 res+='&preloaderLoadingText='+this.preloaderLoadingText;
}
 if(this.initText!=null)
 res+='&initText='+this.initText;
 if(this.xmlLoadingText!=null)
 res+='&xmlLoadingText='+this.xmlLoadingText;
 if(this.resourcesLoadingText!=null)
 res+='&resourcesLoadingText='+this.resourcesLoadingText;
 if(this.waitingForDataText!=null)
 res+='&waitingForDataText='+this.waitingForDataText;
 if(this.templatesLoadingText!=null)
 res+='&templatesLoadingText='+this.templatesLoadingText;
 if(this.noDataText!=null)
 res+='&nodatatext='+this.noDataText;
 return res;
},
 updateSize:function(width,height){
 this.flashObject.setAttribute('width',width);
 this.flashObject.setAttribute('height',height);
},
 _getMoviePath:function(){
 return this.preloaderSWFFile!=null?this.preloaderSWFFile:this.swfFile;
},
 _getObjectHTML:function(){
 var source='<object id="'+this.id+'" name="'+this.id+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.width+'" height="'+this.height+'" codebase="'+this._protocol+'://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">';
 source+='<param name="movie" value="'+this._getMoviePath()+'" />';
 source+='<param name="bgcolor" value="'+this.bgColor+'" />';
 source+='<param name="allowScriptAccess" value="always" />';
 source+='<param name="FlashVars" value="'+this._buildFlashVars()+'" />';
 if(this.wMode!=null)
 source+='<param name="wmode" value="'+this.wMode+'" />';
 source+='</object>';
 return source;
},
 _getEmbedHTML:function(){
 var source='<embed type="application/x-shockwave-flash" pluginspage="'+this._protocol+'://www.adobe.com/go/getflashplayer" ';
 source+='src="'+this._getMoviePath()+'" ';
 source+='width="'+this.width+'" ';
 source+='height="'+this.height+'" ';
 source+='id="'+this.id+'" ';
 source+='name="'+this.id+'" ';
 source+='bgColor="'+this.bgColor+'" ';
 source+='allowScriptAccess="always" ';
 if(this.wMode!=null)
 source+='wmode="'+this.wMode+'" ';
 source+='flashvars="'+this._buildFlashVars()+'" />';
 return source;
},
 _onChartDraw:function(){
 if(!Browser.isIE){
 this._setPrintImage();
}else{
 this._initIEPrinting();
}
},
 _initIEPrinting:function(){
 var obj=this.flashObject;
 if(obj==null)return;
 
 window.attachEvent("onbeforeprint",function(e){
 obj.setAttribute("tmpW",obj.width);
 obj.setAttribute("tmpH",obj.height);
 
 obj.width=(obj.getWidth!=undefined)?obj.getWidth():obj.width;
 obj.height=(obj.getHeight!=undefined)?obj.getHeight():obj.height;
 
 if(obj.getAttribute("tmpW").indexOf("%")!=-1||
 obj.getAttribute("tmpH").indexOf("%")!=-1){
 
 obj.focus();
}
});
 window.attachEvent("onafterprint",function(){
 obj.width=obj.getAttribute("tmpW");
 obj.height=obj.getAttribute("tmpH");
});
},
 _createNormalCSS:function(){
 var head=document.getElementsByTagName('head');
 head=((head.length!=1)?null:head[0]);
 
 if(head==null)
 return false;
 
 if(this._containerId==null)
 return false;
 
 var style=document.createElement('style');
 style.setAttribute('type','text/css');
 style.setAttribute('media','screen');
 
 var objDescriptor='div#'+this._containerId;
 var imgDescriptor=objDescriptor+' img';
 var objRule="width: "+this.width+";\n"+
 "height: "+this.height+";"+
 "padding: 0;\n"+
 "margin: 0;";
 var imgRule="display: none;\n"+
 "width: "+this.width+";"+
 "height: "+this.height+";";
 style.appendChild(document.createTextNode(objDescriptor+'{'+objRule+"}\n"));
 style.appendChild(document.createTextNode(imgDescriptor+'{'+imgRule+'}'));
 head.appendChild(style);
 
 return true;
},
 _createPrintCSS:function(){
 var head=document.getElementsByTagName('head');
 head=((head.length!=1)?null:head[0]);
 if(this._containerId==null)
 return false;
 var style=document.createElement('style');
 style.setAttribute('type','text/css');
 style.setAttribute('media','print');
 var imgDescriptor='#'+this._containerId+' img';
 var imgRule='display: block;';
 if(this.flashObject!=null&&
 this.flashObject.getWidth!=undefined&&
 this.flashObject.getHeight!=undefined){
 imgRule+='width: '+this.flashObject.getWidth()+'px;';
 imgRule+='height: '+this.flashObject.getHeight()+'px;';
}
 style.appendChild(document.createTextNode(imgDescriptor+'{'+imgRule+'}'));
 
 var objDescriptor='#'+this._containerId+' embed';
 var objRule='display: none;';
 style.appendChild(document.createTextNode(objDescriptor+'{'+objRule+'}'));
 
 head.appendChild(style);
 return true;
},
 _initPrint:function(){
 this._createNormalCSS();
 this._createPrintCSS();
},
 _createImage:function(target){
 var img=document.createElement('img');
 target.appendChild(img);
},
 _setPrintImage:function(){
 var img=this._containerNode.getElementsByTagName('img');
 if(img.length!=1)return;
 img=img[0];
 img.src='data:image/png;base64,'+this.getPng();
},
 _resizeChart:function(){
 if(AnyChart.useBrowserResize&&this.flashObject.ResizeChart!=undefined)
 this.flashObject.ResizeChart();
},
 _initResize:function(win){
 var ths=this;
 if(Browser.isIE){
 win.attachEvent("onresize",function(){
 ths._resizeChart();
});
}else{
 addEventListener("resize",function(){
 ths._resizeChart();
},false);
}
},
 _xmlSource:null,
 setData:function(data){
 if(typeof(data)=='string'||(!Browser.isSafari&&data instanceof String)){
 if(!this._loaded||!this._created)
 this._xmlSource=data;
 else
 this.setXMLDataFromString(data);
 return;
}
},
 _checkPath:function(path){
 var currentHost=location.host;
 var currentPath=location.pathname;
 if(location.protocol=="file:")
 return path;
 var protocol=location.protocol;
 currentHost=protocol+"//"+currentHost;
 currentPath=currentHost+currentPath.substr(0,currentPath.lastIndexOf("/")+1);
 if((path.charAt(0)+path.charAt(1))=='./'){
 return currentPath+path;
}else if(path.charAt(0)=='/'){
 return currentHost+path;
}
 return path;
},
 setXMLFile:function(path){
 path=this._checkPath(path);
 if(this._created||this._loaded)
 this.setXMLDataFromURL(path);
 else
 this._xmlFile=path;
},
 _checkPresetXMLSource:function(){
 if(this._xmlSource!=null&&this._created&&this._loaded){
 var ths=this;
 setTimeout(function(){
 ths.setXMLDataFromString(ths._xmlSource);
},1);
}
},
 _onChartLoad:function(){
 this._loaded=true;
 this._checkPresetXMLSource();
},
 _onHTMLCreate:function(){
 this._created=true;
 this._checkPresetXMLSource();
},
 _created:false,
 _loaded:false,
 _listeners:null,
 addEventListener:function(event,callback){
 this._listeners.push({type:event,call:callback});
},
 dispatchEvent:function(event){
 if(!this._canDispatchEvent){
 this._nonDispatcedEvents.push(event);
};
 var type=event.type;
 event.target=this;
 for(var i=0;i<this._listeners.length;i++){
 if(this._listeners[i].type==type){
 this._listeners[i].call(event);
}
}
},
 setXMLDataFromString:function(data){
 if(this.flashObject!=null&&
 this.flashObject.SetXMLDataFromString!=null)
 this.flashObject.SetXMLDataFromString(data.toString());
},
 setXMLDataFromURL:function(url){
 if(this.flashObject!=null&&
 this.flashObject.SetXMLDataFromURL!=null)
 this.flashObject.SetXMLDataFromURL(url);
},
 setViewXMLFile:function(viewId,url){
 if(this.flashObject!=null&&
 this.flashObject.UpdateViewFromURL!=null)
 this.flashObject.UpdateViewFromURL(viewId,url);
},
 setViewData:function(viewId,data){
 if(this.flashObject!=null&&
 this.flashObject.UpdateViewFromString!=null)
 this.flashObject.UpdateViewFromString(viewId,data);
},
 setLoading:function(){
 if(this.flashObject==null||this.flashObject.SetLoading==null)return;
 switch(arguments.length){
 case 1:
 this.flashObject.SetLoading(null,arguments[0]);
 break;
 case 2:
 this.flashObject.SetLoading(arguments[0],arguments[1]);
 break;
}
},
 getPng:function(){
 return this.flashObject.GetPngScreen();
},
 getJpeg:function(){
 return this.flashObject.GetJPEGScreen();
},
 printChart:function(){
 this.flashObject.PrintChart();
},
 saveAsImage:function(){
 this.flashObject.SaveAsImage();
},
 saveAsPDF:function(){
 this.flashObject.SaveAsPDF();
},
 getInformation:function(){
 return this.flashObject.GetInformation();
},
 _checkPlayerVersion:function(){
 var version=this._getFlashPlayerVersion();
 if(version==null)return false;
 if(version.major<9)return false;
 return true;
},
 _getFlashPlayerVersion:function(){
 if(navigator.plugins!=null&&navigator.mimeTypes.length>0){
 var flashPlugin=navigator.plugins["Shockwave Flash"];
 if(flashPlugin!=null&&flashPlugin.description!=null){
 var versionInfo=flashPlugin.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split(".");
 return{major:versionInfo[0],minor:versionInfo[1],rev:versionInfo[2]};
}
 return null;
}
 var activeX=null;
 if(navigator.userAgent!=null&&navigator.userAgent.indexOf("Windows CE")!=-1){
 var versionIndex=4;
 while(true){
 try{
 activeX=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+versionIndex);
 versionIndex ++;
}catch(e){
 break;
}
}
 if(activeX==null)return null;
 return{major:versionIndex,minor:0,rev:0};
}
 var version=null;
 try{
 activeX=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
}catch(e){
 try{
 activeX=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
 version={major:6,minor:0,rev:21};
 activeX.AllowScriptAccess="always";
}catch(e){
 if(version!=null&&version.major==6)return version;
}
 try{
 activeX=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
}catch(e){}
}
 if(activeX==null)return null;
 var versionInfo=activeX.GetVariable("$version").split(" ")[1].split(",");
 return{major:versionInfo[0],minor:versionInfo[1],rev:versionInfo[2]};
}
};
 AnyChart.getChartById=function(id){
 return AnyChart._charts[id];
};
 AnyChart._chartsCount=0;
 AnyChart._registerChart=function(chart){
 AnyChart._charts[chart.id]=chart;
 AnyChart._chartsCount ++;
};
 
 AnyChart.swfFile=null;
 AnyChart.preloaderSWFFile=null;
 AnyChart.useBrowserResize=true;
 AnyChart.width=550;
 AnyChart.height=400;
 AnyChart.preloaderInitText="Initializing...";
 AnyChart.preloaderLoadingText="Loading... ";
 AnyChart.initText="Initializing...";
 AnyChart.xmlLoadingText="Loading chart...";
 AnyChart.resourcesLoadingText="Loading chart...";
 AnyChart.noDataText="No Data";
 AnyChart.waitingForDataText="Waiting for data...";
 AnyChart.templatesLoadingText="Loading templates...";
 AnyChart._replaceInfo=new Array();
 AnyChart.getUniqueChartId=function(){
 return 'chart__'+AnyChart._chartsCount;
}
 AnyChart._getUniqueContainerId=function(chartId){
 return '___CONTAINER___N'+chartId;
}
 var alternateContent = '<B>To see all baby name popularity charts, you will need Adobe Flash Player.</B><BR><BR>' + '<a href="http://www.adobe.com/go/getflash/" target="blank">Download Flash Player</a>'; 
 var requiredMajorVersion=9;
 var requiredMinorVersion=0;
 var requiredRevision=0;
 var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;
 var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;
 var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;
 function ControlVersion()
{
 var version;
 var axo;
 var e;
 
 
 
 try{
 
 axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
 version=axo.GetVariable("$version");
}catch(e){
}
 
 if(!version)
{
 try{
 
 axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
 
 
 
 
 
 
 version="WIN 6,0,21,0";
 
 
 axo.AllowScriptAccess="always";
 
 
 version=axo.GetVariable("$version");
 
}catch(e){
}
}
 
 if(!version)
{
 try{
 
 axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
 version=axo.GetVariable("$version");
}catch(e){
}
}
 
 if(!version)
{
 try{
 
 axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
 version="WIN 3,0,18,0";
}catch(e){
}
}
 
 if(!version)
{
 try{
 
 axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
 version="WIN 2,0,0,11";
}catch(e){
 version=-1;
}
}
 
 return version;
}
 
 function GetSwfVer(){
 var flashVer=-1;
 
 if(navigator.plugins!=null&&navigator.plugins.length>0){
 if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){
 var swVer2=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";
 var flashDescription=navigator.plugins["Shockwave Flash"+swVer2].description;
 var descArray=flashDescription.split(" ");
 var tempArrayMajor=descArray[2].split(".");
 var versionMajor=tempArrayMajor[0];
 var versionMinor=tempArrayMajor[1];
 var versionRevision=descArray[3];
 if(versionRevision==""){
 versionRevision=descArray[4];
}
 if(versionRevision[0]=="d"){
 versionRevision=versionRevision.substring(1);
}else if(versionRevision[0]=="r"){
 versionRevision=versionRevision.substring(1);
 if(versionRevision.indexOf("d")>0){
 versionRevision=versionRevision.substring(0,versionRevision.indexOf("d"));
}
}
 var flashVer=versionMajor+"."+versionMinor+"."+versionRevision;
 
}
}
 else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1)flashVer=4;
 else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1)flashVer=3;
 else if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1)flashVer=2;
 else if(isIE&&isWin&&!isOpera){
 flashVer=ControlVersion();
}
 return flashVer;
}
 
 function DetectFlashVer(reqMajorVer,reqMinorVer,reqRevision)
{
 versionStr=GetSwfVer();
 if(versionStr==-1){
 return false;
}else if(versionStr!=0){
 if(isIE&&isWin&&!isOpera){
 
 tempArray=versionStr.split(" ");
 tempString=tempArray[1];
 versionArray=tempString.split(",");
}else{
 versionArray=versionStr.split(".");
}
 var versionMajor=versionArray[0];
 var versionMinor=versionArray[1];
 var versionRevision=versionArray[2];
 if(versionMajor>parseFloat(reqMajorVer)){
 return true;
}else if(versionMajor==parseFloat(reqMajorVer)){
 if(versionMinor>parseFloat(reqMinorVer))
 return true;
 else if(versionMinor==parseFloat(reqMinorVer)){
 if(versionRevision>=parseFloat(reqRevision))
 return true;
}
}
 return false;
}
}
 
 
 function AC_AddExtension(src,ext)
{
 if(src.indexOf('?')!=-1)
 return src.replace(/\?/,ext+'?');
 else
 return src+ext;
}
 
 function AC_Generateobj(objAttrs,params,embedAttrs)
{
 var str='';
 if(isIE&&isWin&&!isOpera)
{
 str+='<object ';
 for(var i in objAttrs)
 str+=i+'="'+objAttrs[i]+'" ';
 for(var i in params)
 str+='><param name="'+i+'" value="'+params[i]+'" /> ';
 str+='></object>';
}else{
 str+='<embed ';
 for(var i in embedAttrs)
 str+=i+'="'+embedAttrs[i]+'" ';
 str+='> </embed>';
}
 
 document.write(str);
}
 
 var wimpyUserAgent=navigator.appName.indexOf("Microsoft");
 var wimpyButtonIDs=wimpyButtonIDs||Array();
 function wimpyButtonStopOthers(myid_in){
 for(i=0;i<wimpyButtonIDs.length;i++){
 if(wimpyButtonIDs[i]!=myid_in){
 if(wimpyUserAgent!=-1){
 window[wimpyButtonIDs[i]].js_wimpy_pause();
}else{
 document[wimpyButtonIDs[i]].js_wimpy_pause();
}
}
}
}
 function writeWimpyButton(theFile,wimpyWidth,wimpyHeight,wimpyConfigs,backgroundColor){
 var wimpyReg="NkNCMSUzRDQlNUMlN0V5JTdGcm1XT04lN0RlJTQwd2lPVktCbGVtZSUzQ255SGxYRXM5";
 var defaultWidth=35;
 var defaultHeight=35;
 var defaultConfigs="&autoplay=no&loopMe=no&playingColor=362A45&arrowColor=00FF00";
 var baseURL="http://www.quickbabynames.com/meaning/pronunciation/";
 var wimpySwf="http://www.quickbabynames.com/meaning/pronunciation/wimpy_button.swf";
 var wimpyWidth=(wimpyWidth==null)?defaultWidth:wimpyWidth;
 var wimpyHeight=(wimpyHeight==null)?defaultHeight:wimpyHeight;
 var wimpyConfigs=(wimpyConfigs==null)?defaultConfigs:wimpyConfigs;
 var backgroundColor=(backgroundColor==null)?false:backgroundColor;
 var myid="wimpybutton"+Math.round((Math.random()*1000)+1);
 wimpyButtonIDs[wimpyButtonIDs.length]=myid;
 var flashCode="";
 var newlineChar="\n";
 var backgroundColor=(backgroundColor==null)?false:backgroundColor;
 if(typeof(backgroundColor)=="string"){
 var Astring=backgroundColor.split("");
 if(Astring[0]=="#"){
 Astring.shift();
 backgroundColor=Astring.join("");
}
}
 if(backgroundColor==false){
 tptParam='<param name="wmode" value="transparent" />'+newlineChar;
 tptEmbed=' wmode="transparent"';
}else{
 tptParam='<param name="bgcolor" value="#'+backgroundColor+'" />'+newlineChar;
 tptEmbed=' bgcolor="#'+backgroundColor+'"';
}
 flashCode+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+wimpyWidth+'" height="'+wimpyHeight+'" id="'+myid+'">'+newlineChar;
 flashCode+='<param name="movie" value="'+wimpySwf+'" />'+newlineChar;
 flashCode+='<param name="loop" value="false" />'+newlineChar;
 flashCode+='<param name="menu" value="false" />'+newlineChar;
 flashCode+='<param name="quality" value="high" />'+newlineChar;
 flashCode+='<param name="wmode" value="transparent" />'+newlineChar;
 flashCode+='<param name="flashvars" value="theFile='+baseURL+theFile+wimpyConfigs+'&wimpyReg='+wimpyReg+'&myid='+myid+'" />'+newlineChar;
 flashCode+='<embed src="'+wimpySwf+'" width="'+wimpyWidth+'" height="'+wimpyHeight+'" flashvars="theFile='+baseURL+theFile+wimpyConfigs+'&wimpyReg='+wimpyReg+'&myid='+myid+'"'+tptEmbed+' loop="false" menu="false" quality="high" name="'+myid+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>'+newlineChar;
 
 document.write(flashCode);
}
 
 var adtimer
 var adcounter
 var textads=new Array()
 textads[0]='<a href=\"http://www.quickbabynames.com/top100/top-100-baby-boy-names-2006-1.html\">Top 100 Baby Boy names</a>'
 textads[1]='<a href=\"http://www.quickbabynames.com/meaning/index.php?page=search&stype=any&s_res=GO&cid=354&f_title=abigail&x=0&y=0&q=\">Why is Abigail such a special name?</a>'
 textads[2]='<a href=\"http://www.quickbabynames.com/meaning/index.php?page=search&cid=353\">Do an Advanced Search</a>'
 var adcounter=Math.floor(Math.random()*(textads.length))
 function changeRandomTextAd(){
 var oldAD=document.getElementById('randomtextadsdiv').innerHTML;
 var newAD=textads[adcounter];
 document.getElementById('randomtextadsdiv').innerHTML=newAD;
 
 if(adcounter<((textads.length)-1))
{
 adcounter++
}
 else
{
 adcounter=0
}
 adtimer=setTimeout("changeRandomTextAd()",6000)
}
