var snippets = {
attachEventMethods : function(tgt, event, method) {
eval('var te = tgt.'+event);
if(te != null) {
var f = te.toString();
if(clientEnvironment.isIE) {
var r1 = "/^[^{]*{/g";
var r2 = "/}$/g";
eval('r1 = '+r1);
eval('r2 = '+r2);
f = f.replace(r1, '');
f = f.replace(r2, '');
fnc = new Function(method+f.toString());
} else {
f = f.replace('function anonymous() {', '');
f = f.replace('}', '');
fnc = new Function(f.toString()+method);
}
} else {
var f = '';
fnc = new Function(f.toString()+method);
}
eval('tgt.'+event+'= fnc');
},
attachGetQuery : function(href, vars) {
var qstr = '';
for(var i in vars) {
qstr += '&'+escape(i)+'='+escape(vars[i]);
}
qstr = href.indexOf('?') != -1 ? href+qstr : href+'?'+qstr.substring(1);
return qstr;
},
checkSubWindow : function(win) {
if (!!win) {
if (isIE != -1 && isWindows ) {
return win.closed;
} else {
return typeof win.document != 'object';
}
} else {
return true;
}
},
getCSSProp : function(elem, prop) {
if(elem.style && elem.style[prop]) {
return elem.style[prop];
} else if(elem.currentStyle) {
return elem.currentStyle[prop];
} else if(document.defaultView && document.defaultView.getComputedStyle) {
prop = prop.replace(/([A-Z])/g, function(match) { return '-'+match.toLowerCase() });
return document.defaultView.getComputedStyle(elem, '').getPropertyValue(prop);
} else {
return null;
}
},
getElement : function(name, nest) {
nest = nest ? 'document.'+nest+'.' : '';
var el = clientEnvironment.isW3C ? document.getElementById(name) : clientEnvironment.isIE ? document.all[name] : false;
el.css = el.style;
el.getTop = function() { return parseInt(el.css.top) || 0 };
el.setTop = function(y) { el.css.top = y+'px' };
el.getHeight = function() { return el.offsetHeight };
el.getClipHeight = function() { return el.offsetHeight };
return el;
},
getScrollLeft : function(paneName) {
if(paneName) {
return document.getElementById(paneName).scrollLeft ? document.getElementById(paneName).scrollLeft : 0 ;
} else {
return document.getElementsByTagName('body')[0].scrollLeft ? document.getElementsByTagName('body')[0].scrollLeft : 0 ;
}
},
getScrollTop : function(paneName) {
if(paneName) {
return document.getElementById(paneName).scrollTop ? document.getElementById(paneName).scrollTop : 0 ;
} else {
return document.getElementsByTagName('body')[0].scrollTop ? document.getElementsByTagName('body')[0].scrollTop : 0 ;
}
},
getElementXpos : function(el) {
var x = 0;
while(el.offsetParent) {
x += el.offsetLeft;
el = el.offsetParent;
}
return x;
},
getElementYpos : function(el) {
var y = 0;
while(el.offsetParent) {
y += el.offsetTop;
el = el.offsetParent;
}
return y;
},
getWindowWidth : function() {
if(clientEnvironment.isIE) return (document.documentElement.clientWidth) ? document.documentElement.clientWidth : document.body.clientWidth;
else return window.innerWidth;
},
getWindowHeight : function() {
if(clientEnvironment.isIE) return (document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.clientHeight;
else return window.innerHeight;
},
removeAlpha : function(str) {
var re = "/[a-zA-Z]/g";
if(clientEnvironment.isIE) {
eval('re = '+re);
}
if(str.search(re) != -1) {
result = str.replace(re, '');
}
return parseInt(result);
}
}
var clientEnvironment = {
isW3C : document.getElementById,
isIE : document.all,
isNS4 : document.layers,
isNS6 : (document.getElementById && window.navigator.appName.indexOf('Netscape') != -1),
isOpera : (navigator.userAgent.indexOf('Opera') != -1),
isWindows : (window.navigator.userAgent.indexOf('Windows 95') != -1) || (window.navigator.userAgent.indexOf('Windows 98') != -1) || (window.navigator.userAgent.indexOf('Windows NT') != -1),
isUNIX : (window.navigator.appVersion.indexOf('X11') != -1) || (window.navigator.appVersion.indexOf('Linux') != -1) || (window.navigator.appVersion.indexOf('SunOS') != -1) || (window.navigator.appVersion.indexOf('IRIX') != -1) || (window.navigator.appVersion.indexOf('HP-UX') != -1),
isMac : (window.navigator.appVersion.indexOf('Mac') != -1),
isMacIE : (document.all && window.navigator.appVersion.indexOf('Mac') != -1),
isLowSpec : (window.navigator.userAgent.indexOf('Windows 95') != -1) || (window.navigator.userAgent.indexOf('Windows 98') != -1) || (window.navigator.appVersion.indexOf('Mac') != -1),
Flash : {
hasVersion : function(requiredVersion) {
var requiredVersion = parseInt(requiredVersion);
if(navigator.plugins != null && navigator.plugins.length > 0) {
var version = 0;
var plugin = navigator.plugins['Shockwave Flash'];
if(typeof plugin == 'object') {
var description = plugin.description;
version = parseInt(description.charAt(description.indexOf('.')-1));
}
return (version >= requiredVersion) ? true : false;
} else if(navigator.appVersion.indexOf('Mac') == -1 && window.execScript) {
clientEnvironment.Flash.hasVersion_result = false;
for(var i = requiredVersion; i <= requiredVersion+5 && clientEnvironment.Flash.hasVersion_result != true; i++){
execScript('on error resume next: clientEnvironment.Flash.hasVersion_result=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))', 'vbscript');
}
return clientEnvironment.Flash.hasVersion_result;
}
return null;
},
redirect : function(requiredVersion, noFlashPage) {
if(document.referrer.indexOf(noFlashPage) != -1) return;
if(!this.hasVersion(requiredVersion)) window.location.href = noFlashPage;
},
write : function(id, file, version, width, height, align, hspace, vspace, showMenu, wmode, varsObj) {
if(!this.hasVersion(version)) {
document.write('If you are to see this Flash content the latest Flash Player must be requied.');
} else {
var fvars = vars = '';
if(varsObj) {
for(var i in varsObj) fvars += i+'='+escape(varsObj[i])+'&';
vars = '?'+fvars;
}
var swf = '