﻿//window.onerror=function(){return true;}
window.$ = function(obj) { return typeof (obj) == "string" ? document.getElementById(obj) : obj }
var ie = document.all ? true : false;
function AttachEvent(object, eventName, func, cancelBubble) {
    var cb = cancelBubble ? true : false;
    eventName = eventName.toLowerCase();
    if (document.attachEvent) {
        object.attachEvent(eventName, func);
    } else {
        object.addEventListener(eventName.substr(2), func, cb);
    }
}

function SetCurrent() {
    var links = $("toolbar").getElementsByTagName("A");
    var href = location.href.toLowerCase();
    if (location.pathname.length < 2) href += "index.aspx";
    for (var i = 0; i < links.length; i++) {
        links[i].className = href.indexOf(links[i].href) > -1  ? "current" : "";
    }
}

function WriteFlash(flash, cid, _width, _height) {
    document.writeln("<embed src=\"" + flash + "\" id=\"" + cid + "\" wmode=\"transparent\" width=\"" + _width + "\" height=\"" + _height + "\" type=\"application/x-shockwave-flash\"></embed>");
}

function getEvent(){
if (window.event) return window.event;        
func=getEvent.caller;            
while(func!=null){    
var arg0=func.arguments[0];
    if(arg0){
        if((arg0.constructor==Event || arg0.constructor==MouseEvent)
         || (typeof(arg0)=="object" && arg0.preventDefault && arg0.stopPropagation)){    
         return arg0;
        }
    }
func=func.caller;
}
return null;
}