//include('/common/js/styleswitcher.js');
//include('/common/js/rollover.js');
//include('/common/js/togglelayer.js');
//include('/common/js/addalert.js');
//include('/common/js/tinyscrolling.js');
//include('/common/js/direct.js');
//include('/common/js/selecturl.js');

function getObj(id){
	return document.all && document.all(id) || document.getElementById && document.getElementById(id);
}

function windowOpen(theURL,winName,features, protocol){
	if(theURL.indexOf("/") == 0){
		if(!protocol) protocol = "http";
		theURL = protocol + "://" + document.location.host + theURL;
	}
	window.open(theURL,winName,features);
}	

function addEvent(eventTarget, eventName, func){
	if(eventTarget.addEventListener){
		eventTarget.addEventListener(eventName, func, false);
	}else if(window.attachEvent){
		eventTarget.attachEvent('on'+eventName, function(){func.apply(eventTarget);});
	}
}

function include(astrFile){
	var script = document.createElement('script');
	script.src = astrFile;
	script.type = 'text/javascript';
	script.defer = true;
	document.getElementsByTagName('head').item(0).appendChild(script);
}

function getCookie(key,  tmp1, tmp2, xx1, xx2, xx3) {
    tmp1 = " " + document.cookie + ";";
    xx1 = xx2 = 0;
    len = tmp1.length;
    while (xx1 < len) {
        xx2 = tmp1.indexOf(";", xx1);
        tmp2 = tmp1.substring(xx1 + 1, xx2);
        xx3 = tmp2.indexOf("=");
        if (tmp2.substring(0, xx3) == key) {
            return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1 - 1)));
        }
        xx1 = xx2 + 1;
    }
    return("");
}

function registCookie(key, val,  tmp) {
    tmp = key + "=" + escape(val) + "; ";
    // tmp += "path=" + location.pathname + "; ";
    tmp += "expires=Tue, 31-Dec-2030 23:59:59; ";
    document.cookie = tmp;
}

function clearCookie(key) {
    document.cookie = key + "=" + "xx; expires=Tue, 1-Jan-1980 00:00:00;";
}
