

function popoff (url, name, width, height) {
    window.name = 'PUMain';
    tearWin=window.open(url, name, 'personalbar=no,toolbar=no,status=no,scrollbars=yes,location=no,resizable=yes,menubar=no,width=' + width + ',height=' + height);
	   if(window.focus) {
    	tearWin.focus();
    }
}

function changeclass(ID, clsn) {
	if (document.getElementById(ID).className != 'clicked')
	 {
	 document.getElementById(ID).className = clsn;
	 }	
}

function swapclass(ID, clsn) {
	//only allow this to switch if something is checked and it is yes
	for (i =0; i <= document.requestakit.rbMail.length -1; i++) {
	 	if (document.requestakit.rbMail[i].checked && document.requestakit.rbMail[i].value == "yes") {
			document.getElementById(ID).className = clsn;			
 		}
	}
 }	
	 
function swapall(clsn) {
	//this behaves differently if user is a consumer (no partner is logged in)
	for (i =0; i <= document.requestakit.i_am_a.length -1; i++) {
	 	if (document.requestakit.i_am_a[i].checked && document.requestakit.i_am_a[i].value != "consumer") {
			document.getElementById('req_company').className = clsn;
 		}
    }
	document.getElementById('req_street').className = clsn;
	document.getElementById('req_city').className = clsn;
	document.getElementById('req_state').className = clsn;
	document.getElementById('req_zip').className = clsn;
}	



function addEvent( obj, type, fn ) { 	// http://ejohn.org/projects/flexible-javascript-events/
	if ( obj.attachEvent ) {
		obj['e'+type+fn] = fn;
		obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
		obj.attachEvent('on'+type, obj[type+fn] );
	} else
		obj.addEventListener( type, fn, false );
}