
function vSF(f) {
	return true;
}

function initHighlight() {
    if (!document.getElementsByTagName){ return; }
    var allfields = document.getElementsByTagName("input");
    for (var i=0; i<allfields.length; i++){
        var field = allfields[i];
        if ((field.getAttribute("type") == "text") || (field.getAttribute("type") == "password") ) {
            field.onfocus = function () {
            	if (this.className != "filingdateinput")
            		this.className = 'highlightActiveField';
            }
            field.onblur = function () {
            	if (this.className != "filingdateinput")
            		this.className = 'highlightInactiveField';
            }
        }
    }
}

function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function'){
        window.onload = func;
    } else {
        window.onload = function(){
        oldonload();
        func();
        }
    }
}

function hidestatus() {
    window.status = '';
    return true;
}

function core_popup(domain, w) {
	website_window=window.open(domain, 'website_window', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+w+', height=600');
	website_window.focus();
}

function core_popupNew(domain, w) {
	website_window=window.open(domain, '_blank', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+w+', height=600');
	website_window.focus();
}

function core_popup2(domain, w, h) {
	website_window=window.open(domain, 'website_window', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+w+', height='+h+'');
	website_window.focus();
}

function core_popup3(domain, w, h) {
	website_window=window.open(domain, '_blank', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+w+', height='+h+'');
	website_window.focus();
}

function core_popup4(domain, w, h, wname) {
	website_window=window.open(domain, wname, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+w+', height='+h+'');
	website_window.focus();
}

function core_popup_fullheight(domain, w) {
	
	website_window=window.open(domain, 'website_window', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+w+', height='+screen.height+'');
	website_window.focus();
}


// -->


function kp(f, t, L) {
	if (f.value.length==L)
	{
		t.focus();
	}

}

function shSw() {
	var d1 = null;
	var d2 = null;
	eval("d1 = document.getElementById('sh')");
	eval("d2 = document.getElementById('shr')");
	if (d1 == null)
		return;

	d1.innerHTML = d2.innerHTML;

}

addLoadEvent(initHighlight);
document.onmouseover = hidestatus;

/* utility class to get by class name */
function getElementsByClassName(className, tag, elm) {
	var testClass = new RegExp("(^|\\s)" + className + "(\\s|$)");
	var tag = tag || "*";
	var elm = elm || document;
	var elements = (tag == "*" && elm.all)? elm.all : elm.getElementsByTagName(tag);
	var returnElements = [];
	var current;
	var length = elements.length;
	for(var i=0; i<length; i++) {
		current = elements[i];
		if(testClass.test(current.className)) {
			returnElements.push(current);
		}	
	}
	return returnElements;
}

// Array support for the push method in IE 5
if(typeof Array.prototype.push != "function") {
	Array.prototype.push = ArrayPush;
	function ArrayPush(value) {
		this[this.length] = value;
	}
}

/* utility function to get input values */
function getFormInputValuesByParent(elm) {
	var elm = elm || document;
	var elements;
	var i;
	var returnValues = "";	
	elements = elm.getElementsByTagName("input");
	for (i=0; i<elements.length; i++) {
		var name = elements[i].getAttribute("name");
		var attr = elements[i].getAttribute("type");
		if ((name != "") && ((attr == "text") || (attr == "password") || (attr == "hidden") || (((attr == "checkbox") || (attr = "radio")) && elements[i].checked))) {
			if (returnValues != "")
				returnValues += ";";
			returnValues += (name + "=" + elements[i].value);
		}
	}	
	elements = elm.getElementsByTagName("select");
	for (i=0; i<elements.length; i++) {
		var name = elements[i].getAttribute("name");
		if (name != "") {
			var options = elements[i].options;
			for (var j=0; j<options.length; j++) {
				if (options[j].selected) {
					if (returnValues != "")
						returnValues += ";";
					returnValues += (name + "=" + options[j].value);
					break;
				}
			}
		}
	}	
	return returnValues;
}

/* utility class to create select items (options) on the fly */
function addOption(objSel, text, value, selected) {
	var opt = document.createElement("option");

	if (opt) {
		opt.text = text;
		opt.value = value;
		opt.selected = selected;
		try {
			objSel.add(opt, null); // compliant
		} catch (ex) {
			objSel.add(opt); // IE only
		}
	}
}

