function FlashDetector_Detect() {
var pObj = null;
var tokens, len, curr_tok;
var hasVersion = -1;
if(navigator.mimeTypes && navigator.mimeTypes['application/x-shockwave-flash'])
{
pObj = navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin;
}
if(pObj != null)
{
tokens = navigator.plugins['Shockwave Flash'].description.split(' ');
len = tokens.length;
while(len--)
{
curr_tok = tokens[len];
if(!isNaN(parseInt(curr_tok)))
{
hasVersion = curr_tok;
FlashDetector_Version = curr_tok;
break;
}
}
if(hasVersion >= FlashDetector_TargetVersion)
{
playable = true;
}
else
{
playable = false;
}
}
return playable;
}
function ymsgr_ult_beacon(u)
{
if (u)
{
u += '?.rand=' + Math.random();
var ymsgr_beacon = new Image();
ymsgr_beacon.src = u;
}
}
function ymsgr_set_vm_target(self, url)
{
if (ymsgr_is_messenger())
{
setTimeout("ymsgr_ult_beacon('"+url+"')", 10);
self.href = 'ymsgr:showvm?';
}
else
self.target = "mailmsgr";
}
function ymsgr_set_im_target(self, url)
{
if (ymsgr_is_messenger())
{
setTimeout("ymsgr_ult_beacon('"+url+"')", 10);
self.href = 'ymsgr:sendim?'+ get_target_yid();
}
else
self.target = "mailmsgr";
}
function ymsgr_set_vc_target(self, url)
{
if (ymsgr_is_messenger())
{
setTimeout("ymsgr_ult_beacon('"+url+"')", 10);
self.href = 'ymsgr:callpc?to='+ get_target_yid();
}
else
self.target = "mailmsgr";
}
function ymsgr_set_lm_beacon(self, url)
{
setTimeout("ymsgr_ult_beacon('"+url+"')", 10);
}
function get_target_yid()
{
return typeof ymsgr_tyid == "undefined" ? "" : ymsgr_tyid;
}
function ymsgr_is_messenger()
{
var ymsgr_client = messenger.detect();
var ymsgr_version = ymsgr_client.version.split(',');
if(ymsgr_client.installed && ymsgr_version[0] >= 7)
{ // < 7.0.0.182 does not support voice
return (ymsgr_version[0] > 7 || ymsgr_version[1] > 0 || ymsgr_version[2] > 0 || ymsgr_version[3] >= 182);
}
return false;
}
//date updated: 12.06.2005
//
/* msgr_detect.js
* a javascript library to figure out things about a locally installed messenger client
*/
function Messenger() {
this.startDetect();
return null;
}
Messenger.prototype.installed = 0;
Messenger.prototype.cobrand = '';
Messenger.prototype.intl = 'us';
Messenger.prototype.version = "4";
Messenger.prototype.platform = "w32";
Messenger.prototype.post = [];
Messenger.prototype.detect = function() {
// loop through post process
for (var i=0;i");
this.post[this.post.length] = "postDetectControl";
}
}
Messenger.prototype.detectBrowser = function()
{
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('opera')!=-1)
{
return 'opera';
}
else if (ua.indexOf('msie')!=-1)
{
return 'ie';
}
else if (ua.indexOf('safari')!=-1)
{
return 'safari';
}
else if (ua.indexOf('flock')!= -1)
{
return 'flock';
}
else if (ua.indexOf('firefox')!= -1)
{
return 'firefox';
}
else if (ua.indexOf('gecko')!= -1)
{
return 'gecko';
}
else
{
return false;
}
}
Messenger.prototype.postDetectControl = function() {
var w,v;
if (document.all) {
v = document.all.Ymsgr00;
} else {
v = document.getElementById("Ymsgr00");
}
if (v) {
// mutant gecko+active X case
w = document.getElementById("Ymsgr01");
if (w&&w.offsetHeight) {
this.installed = 1;
this.version = "5.02";
this.platform = "w32";
} else {
return false;
}
} else {
this.installed = 1;
this.version = "5.03";
this.platform = "w32";
}
return true;
}
Messenger.prototype.detectMime = function() {
if (navigator.mimeTypes && navigator.mimeTypes.length) {
for (var i=0; i -1) {
this.installed = 1;
this.version = "5.04";
this.platform = "w32";
return true;
}
}
}
return false;
}
Messenger.prototype.detectCapabilities = function() {
if (document.body && document.body.style && typeof document.body.style.behavior == "string") {
document.body.style.behavior = "url(#default#clientCaps)";
var ver = document.body.getComponentVersion("{E5D12C4E-7B4F-11D3-B5C9-0050045C3C96}","ComponentID");
if (ver) {
this.installed = 1;
this.version = ver;
this.platform = "w32";
return true;
}
}
return false;
}
Messenger.prototype.detectBing = function() {
if (this.detectBrowser() == 'ie')
{
document.writeln('');
this.post[this.post.length] = "postDetectBing";
}
}
Messenger.prototype.postDetectBing = function() {
var v;
if (document.all) {
v = document.all.Ymsgr02;
} else {
// gecko w/ activeX patch
v = document.getElementById("Ymsgr02");
}
if (!v) return false;
if (typeof v.installed == "undefined") return false;
if (typeof v.version == "undefined") return false;
this.installed = v.installed();
var versionstring = v.version(1);
if (!versionstring || typeof versionstring == "undefined") return false;
this.version = versionstring.split(".").join(",");
this.cobrand = v.cobrand();
this.intl = v.intl();
return true;
}
Messenger.prototype.detectRafi = function() {
if (!document.getElementById) return false;
if (!navigator.plugins["Yahoo Application State Plugin"]) return false;
document.writeln("");
this.post[this.post.length] = "postDetectRafi";
return false;
}
Messenger.prototype.postDetectRafi = function() {
var v = document.getElementById("Ymsgr03");
if (!v) return false;
if (typeof v.applicationInfo != "function") return false;
var m = v.applicationInfo("msgr");
if (!m) return false;
this.installed = m.installed();
var ver = m.version();
this.version = ver.major+","+ver.minor+","+ver.hiBuild+","+ver.loBuild;
this.cobrand = m.cobrand();
this.intl = m.internationalCode();
return true;
}
Messenger.prototype.detectCookie = function() {
// check C cookie. XXX
return false;
}
var messenger = new Messenger();
// Spelling stuff
function loadSpellCorrections( req, transactionID, args )
{
var message = null;
try {
var scriptToRun = req.responseText.replace( /<\!--.*-->/g, "" );
eval( scriptToRun );
speller.setText( document.Compose.Body.value );
} catch ( e ) {
if ( e.message.toLowerCase() == "syntax error" ) {
speller = new Speller([]);
} else {
message = e.toString() + " (" + e.message + ")";
}
}
if ( args == null ) {
args = [0];
}
var editBox = null;
if ( typeof RTE_EDITOR_COMPOSITION_PREFIX != "undefined" ) {
editBox = document.getElementById( RTE_EDITOR_COMPOSITION_PREFIX + args[0] );
} else {
editBox = document.getElementById( "bodyfield" );
}
SpellController.showController( editBox, editBox.tagName );
speller.setEditor( editBox, args[0] );
speller.update();
}
function Speller( newCorrections )
{
this.text = "";
this.corrections = newCorrections;
this.changes = "";
this.current = 0;
this.ignore = new Object();
this.formatted = true;
this.state = 0;
var self = this;
// The following are all different if editor is an iframe
// They will be one and the same if it is a textarea
this.editBox = null; // Outer frame for editor sizing & event capture
this.editDoc = null; // Document for event capture
this.editContent = null; // Container for setting innerHTML
this.isText = false;
this.useAX = false;
this.thumbMgr = null; // Callback to fix things up after an update
this.setText = function( newText )
{
this.current = 0;
this.text = newText;
}
this.setNoSuggestions = function( noSuggText )
{
this.noSuggestions = noSuggText;
}
this.spellingActive = function()
{
return ( this.state );
}
this.hideShim = function( leMenu )
{
hideIFrameShim();
}
this.onChange = function()
{
if ( this.current < this.corrections.length ) {
this.changeWord( this.current );
this.nextWord();
}
}
this.onChangeAll = function()
{
var cur = this.corrections[this.current];
if ( this.current < this.corrections.length ) {
var currentWord = this.text.substr( cur.b, cur.l );
this.changeWord( this.current );
for ( var i = this.current + 1; i < this.corrections.length; i++ ) {
var corr = this.corrections[i];
if ( ! this.ignore[i] && this.text.substr( corr.b, corr.l ) == currentWord ) {
this.changeWord( i );
this.ignore[i] = true;
}
}
this.nextWord();
}
}
this.onIgnore = function()
{
if ( this.current < this.corrections.length ) {
this.nextWord();
}
}
this.onIgnoreAll = function()
{
var cur = this.corrections[this.current];
if ( this.current < this.corrections.length ) {
var currentWord = this.text.substr( cur.b, cur.l );
for ( var i = this.current + 1; i < this.corrections.length; i++ ) {
var corr = this.corrections[i];
if ( ! this.ignore[i] && this.text.substr( corr.b, corr.l ) == currentWord ) {
this.ignore[i] = true;
}
}
this.nextWord();
}
}
this.onKeyPressWord = function( evt )
{
if ( evt.keyCode == 13 ) {
this.onChange();
}
}
this.nextWord = function()
{
while ( this.current++ < this.corrections.length && this.ignore[this.current] )
;
this.update();
}
this.setEditor = function( editBox, id )
{
this.editBox = editBox;
this.isText = false;
if ( editBox.tagName == "IFRAME" ) {
this.editDoc = editBox.contentWindow.document;
this.editContent = this.editDoc.body;
} else if ( editBox.tagName == "TEXTAREA" ) {
this.editDoc = editBox;
this.editContent = editBox;
this.isText = true;
} else if ( editBox.tagName == "OBJECT" ) {
var editObj = rteEditorMap[id];
this.editDoc = editObj.GetDocument();
if ( editObj.Wrapper && editObj.Wrapper.Visible ) {
this.editContent = editObj.Wrapper.Content;
this.thumbMgr = editObj.ThumbnailManager;
} else {
this.editContent = this.editDoc.body;
}
this.useAX = true;
} else {
alert( "Speller.setEditor: unknown editBox type: " + editBox.tagName + " (" + typeof editBox + ")" );
}
self.trapFocus( true );
}
this.trapFocus = function( trapping )
{
var evtToTrap = this.isText? "click" : (( document.all )? "focus" : "mousedown" );
var theFrame = (document.all)? this.editBox : this.editDoc;
if ( theFrame != null ) {
if ( trapping ) {
addEvent( theFrame, evtToTrap, this.disableSpell, true );
} else {
removeEvent( theFrame, evtToTrap, this.disableSpell, true );
}
}
}
this.disableSpell = function( evt )
{
HideMenu();
if ( evt == null ) {
evt = window.event;
}
self.trapFocus( false );
self.state = 1;
self.finish();
disableItem( "changeButton", true );
disableItem( "ignoreButton", true );
SpellController.showMessage( "SPELL_DISABLED" );
var doneButton = document.getElementById( "doneButton" );
if ( doneButton != null ) {
doneButton.innerHTML = SpellController.getString( "RESUME_BTN" );
doneButton.onclick = self.enableSpell;
}
return true;
}
this.enableSpell = function( evt )
{
disableItem( "doneButton", true );
SpellController.hideMessage();
var doneButton = document.getElementById( "doneButton" );
if ( doneButton != null ) {
doneButton.innerHTML = SpellController.getString( "CLOSE_BTN" );
doneButton.onclick = spellDone;
}
self.state = 0;
SpellCheck_Click( this.editorID );
}
this.finish = function()
{
if ( this.corrections != null ) {
this.current = this.corrections.length; // jump to the end
this.update();
this.text = null;
}
if ( self.editDoc != null ) {
self.trapFocus( false );
}
}
this.update = function()
{
// var theDoc = rteEditorMap[ this.editorID ].GetDocument();
var theDoc = this.editDoc;
var word = document.getElementById( "word" );
var suggSelect = document.getElementById( "suggestions" );
if ( this.corrections != null && this.current < this.corrections.length ) {
var cur = this.corrections[this.current];
if ( ! this.isText ) {
var html = "";
html += this.text.substr(0, cur.b);
html += '';
html += this.text.substr(cur.b, cur.l);
html += '';
html += this.text.substr(cur.b + cur.l, this.text.length - (cur.b + cur.l));
// theDoc.body.innerHTML = html;
this.editContent.innerHTML = html;
var foundWord = theDoc.getElementById( "misspelled" );
foundWord.scrollIntoView( false );
} else {
this.editDoc.value = this.text;
if ( document.all ) {
var selectedWord = this.editBox.createTextRange();
if ( selectedWord != null ) {
selectedWord.collapse( true );
selectedWord.moveStart( "character", cur.b );
selectedWord.moveEnd( "character", cur.l );
}
selectedWord.select();
} else {
this.editBox.selectionStart = cur.b;
this.editBox.selectionEnd = cur.b + cur.l;
}
this.editBox.focus();
}
suggSelect.options.length = 0;
var n = cur.s.length;
if ( n == 0 ) {
word.value = this.text.substr(cur.b, cur.l);
suggSelect.options[0] = new Option( SpellController.getString( "NO_SUGGESTIONS" ), "", true, true );
} else {
word.value = cur.s[0];
for (var i = 0; i < n; i++) {
var thisWord = cur.s[i]
suggSelect.options[i] = new Option( thisWord, thisWord, (i == 0), (i == 0));
}
suggSelect.selectedIndex = 0;
}
if ( ! this.isText ) {
word.select();
}
} else {
if ( this.text != null && this.text != "" ) {
if ( ! this.isText ) {
this.editContent.innerHTML = this.text;
} else {
this.editDoc.value = this.text;
}
}
var message = (this.corrections.length > 0)? "NO_MORE_MISSPELLINGS" : "NO_MISSPELLINGS";
SpellController.showMessage( message );
disableItem( "changeButton", true );
disableItem( "ignoreButton", true );
}
if ( this.thumbMgr ) {
this.thumbMgr.RestoreThumbnails();
}
}
this.changeWord = function( index )
{
var newText = "";
var word = document.getElementById( "word" );
var cur = this.corrections[index];
newText += this.text.substr( 0, cur.b );
newText += word.value;
newText += this.text.substr( cur.b + cur.l, this.text.length - (cur.b + cur.l) );
this.adjustOffsets( word.value.length - cur.l, index + 1 );
this.text = newText;
/*
this.changes += cur.b + ," + cur.l + "," + word.value + ";";
*/
}
this.adjustOffsets = function( delta, start )
{
for (i = start; i < this.corrections.length; i++) {
this.corrections[i].b += delta;
}
}
this.getStyles = function()
{
var html = "";
var styles = document.getElementsByTagName( "STYLE" );
for ( var i = 0; i < styles.length; i++ ) {
html += "";
}
return html;
}
}
var SpellController =
{
UIStrings : {
NO_SUGGESTIONS : "No Suggestions",
NO_MORE_MISSPELLINGS : "No more misspellings",
NO_MISSPELLINGS : "No misspellings found",
SPELL_DISABLED : "Spelling disabled, click Resume to continue",
CHANGE_LABEL : "Change to:",
SUGG_LABEL: "Suggestions:",
CHANGE_BTN : "Change",
IGNORE_BTN : "Ignore",
CLOSE_BTN : "Close",
RESUME_BTN : "Resume",
CHANGE_ONE_ITEM : "Change this word",
CHANGE_ALL_ITEM : "Change all occurrences",
IGNORE_ONE_ITEM : "Ignore this word",
IGNORE_ALL_ITEM : "Ignore all occurrences"
},
oldHeight : null,
setString : function( id, str )
{
this.UIStrings[id] = str;
},
getString : function( id )
{
var result = this.UIStrings[id];
if ( result == null ) {
return id;
}
return result;
},
addController : function( container )
{
if ( typeof container == "string" ) {
container = document.getElementById( container );
}
var html = "";
html += '';
html += '
';
html += '
';
html += '
';
html += '
';
html += '
';
html += '
';
html += '
';
html += '
';
html += '';
html += '';
html += '
';
html += '
';
html += '';
html += '';
container.innerHTML = html;
var oChangeMenu = MenuButton( 'changeButton', changeClick, 'changemenu', changeMenuClick );
var oSkipMenu = MenuButton( 'ignoreButton', ignoreClick, 'ignoremenu', ignoreMenuClick );
},
showController : function( editBox )
{
var spellBox = document.getElementById( "spellbox" );
if ( spellBox == null ) {
SpellController.addController( "spellcontrol" );
spellBox = document.getElementById( "spellbox" );
}
if ( spellBox != null ) {
spellBox.style.display = "block";
if ( typeof editBox != "undefined" && editBox != null ) {
if ( this.oldHeight == null ) {
this.oldHeight = editBox.clientHeight;
this.editBox = editBox;
editBox.style.height = editBox.clientHeight - spellBox.offsetHeight + "px";
}
// If it's a TEXTAREA, the user may have set the size. We need to match that.
if ( editBox.tagName == "TEXTAREA" ) {
this.setBoxWidth( editBox, spellBox );
}
}
this.hideMessage();
// Make sure everything is enabled!
disableItem( "changeButton", false );
disableItem( "ignoreButton", false );
disableItem( "doneButton", false );
disableItem( "word", false );
disableItem( "suggestions", false );
}
},
setBoxWidth : function( editBox, spellBox )
{
// We only need to do this once...
if ( spellBox.getAttribute( "width_set" ) != null ) {
return;
}
var width = editBox.offsetWidth;
spellBox.style.width = width + "px";
// You'd think that since we've set the width, we're done!
// But the W3C in its infinite wisdom won't set the width
// the the value you asked for! We need to see what width
// we ended up with and subtract any offsets that were added in...
var delta = spellBox.offsetWidth - width;
if ( delta != 0 ) {
width -= delta;
spellBox.style.width = width + "px";
}
var btnbox = document.getElementById( "btnbox" );
var slbox = document.getElementById( "slbox" );
if ( btnbox != null && slbox != null ) {
var delta = ( width - ( btnbox.offsetWidth + slbox.offsetWidth) ) / 2;
var word = document.getElementById( "word" );
var suggestions = document.getElementById( "suggestions" );
if ( delta > 0 && word != null ) {
word.style.width = (word.offsetWidth + delta) + "px";
}
if ( suggestions != null ) {
suggestions.style.width = (suggestions.offsetWidth + delta) + "px";
}
}
spellBox.setAttribute( "width_set", "1" );
},
hideController : function( id )
{
var spellBox = document.getElementById( "spellbox" );
if ( spellBox != null ) {
// var editBox = document.getElementById( id );
if ( this.editBox != null && this.oldHeight != null ) {
this.editBox.style.height = this.oldHeight + "px";
this.oldHeight = null;
}
spellBox.style.display = "none";
}
},
disableItem : function( itemID, disabled )
{
},
onChangeSuggestions : function()
{
var suggSelect = document.getElementById( "suggestions" );
var suggestion = suggSelect.options[suggSelect.selectedIndex].value;
if ( suggestion != "" ) {
document.getElementById( "word" ).value = suggestion;
}
},
showMessage : function( msg )
{
var messageArea = document.getElementById( "spellmsg" );
if ( messageArea != null ) {
messageArea.innerHTML = this.getString( msg );
var theBox = document.getElementById( "correction" );
if ( theBox != null ) {
theBox.style.display = "none";
}
theBox = document.getElementById( "sugglabel" );
if ( theBox != null ) {
theBox.style.display = "none";
}
theBox = document.getElementById( "suggestions" );
if ( theBox != null ) {
theBox.style.display = "none";
}
messageArea.style.display = "block";
}
},
hideMessage : function()
{
var messageArea = document.getElementById( "spellmsg" );
if ( messageArea != null ) {
messageArea.style.display = "none";
// messageArea.innerHTML = msg;
var theBox = document.getElementById( "correction" );
if ( theBox != null ) {
theBox.style.display = "";
}
theBox = document.getElementById( "sugglabel" );
if ( theBox != null ) {
theBox.style.display = "";
}
theBox = document.getElementById( "suggestions" );
if ( theBox != null ) {
theBox.style.display = "";
}
}
}
}
function spellDone( id )
{
if ( typeof speller != 'undefined' && speller != null ) {
speller.finish();
SpellController.hideController( id );
speller = null;
}
enableSpell( true );
}
function disableItem( itemID, disabled )
{
var color = ( (disabled)? "#999" : "#000" );
var theItem = document.getElementById( itemID );
if ( theItem != null ) {
theItem.disabled = disabled;
theItem.style.color = color;
}
}
function changeClick()
{
var mainWidth = parseInt( this.offsetWidth );
mainWidth -= 22;
var nOffsetX = (this.Event.layerX) ? (this.Event.layerX) : this.Event.offsetX;
if ( nOffsetX > mainWidth ) {
var leMenu = this.Menu;
if ( leMenu != null ) {
leMenu.style.zIndex = 100;
leMenu.Show();
leMenu.hideCB = speller.hideShim;
showIFrameShim( leMenu );
}
} else {
speller.onChange();
}
}
function changeMenuClick()
{
switch( this.Sender.value ) {
case 0: speller.onChange();
break;
case 1: speller.onChangeAll();
break;
default: alert( "Unknown change option: " + this.Sender.value );
break;
}
HideMenu();
}
function ignoreClick()
{
var mainWidth = parseInt( this.offsetWidth );
mainWidth -= 22;
var nOffsetX = (this.Event.layerX) ? (this.Event.layerX) : this.Event.offsetX;
if ( nOffsetX > mainWidth ) {
var leMenu = this.Menu;
if ( leMenu != null ) {
leMenu.style.zIndex = 100;
leMenu.Show();
leMenu.hideCB = speller.hideShim;
showIFrameShim( leMenu );
}
} else {
speller.onIgnore();
}
}
function ignoreMenuClick()
{
switch( this.Sender.value ) {
case 0: speller.onIgnore();
break;
case 1: speller.onIgnoreAll();
break;
default: alert( "Unknown this.ignore option: " + this.Sender.value );
break;
}
HideMenu();
}