
function IsIeFirefox() {    
    var userAgentString = navigator.userAgent;
	
    if (userAgentString.indexOf("MSIE") > 0) {
	    return "IE";
    }
    else if (userAgentString.indexOf("Firefox") > 0) {
	    return "FIREFOX";
    }
    else {
	    return "UNKNOWN";
    }
}

function CreateBrowseButton(obj) {		
    var objectString = null;
    var browserString = IsIeFirefox();
    
    //alert(browserString);
    if (browserString == "FIREFOX") {
	    objectString = "<iframe frameborder=\"0\" style=\"display: block; height: 25px;\" name=\"ifu_oboutTxt\" id=\"ifu_oboutTxt\" src=\"/apps/wiki/SaveFileToIdfsNoFlash.aspx?uploadType=oboutTxt&indexInXML=ifu_oboutTxt\"/>";
    }
    else {
	    objectString = "<INPUT class=button onclick=\"var ifUpload; ifUpload = (typeof ifu_oboutTxt.document == 'undefined') ? ifu_oboutTxt.contentWindow.document.form1 : ifu_oboutTxt.document.form1; ifUpload.entityLocationID.value = '0'; ifUpload.uploadHash.value = '0'; ifUpload.indexInXML.value = 'oboutTxt'; ifUpload.uploadType.value = 'oboutTxt'; ifUpload.fileTitle.value = ''; ifUpload.myFile.click();\" value=browse type=button /><IFRAME style=\"DISPLAY: none\" id=ifu_oboutTxt src=\"/apps/wiki/SaveFileToIdfsNoFlash.aspx\" frameBorder=0 name=ifu_aboutTxt>"			    
    }

    obj.document.getElementById('oboutInsertImage').innerHTML = objectString;
}

function oboutEditorServerCallBack(oboutAction, serverOutput)
{
    if(oboutAction == 'insertImage')
    {
        $('iframe').each( function() 
            {
                try
                {
                    var txt = this.contentWindow.document.getElementById('txtFileName')
                    if(txt != null)
                    {
                        txt.value = serverOutput;
                    }
                }catch(e)
                {
                }
            }
        );
    }
    
    hideLoader();
}
