
// remap jQuery to $
(function($){

 

$("#loginform div.submit").click(function(){
	var login = $("#loginform input[name=log]").val();
	var pwd = $("#loginform input[name=pwd]").val();
	if( login!='' && pwd!='' ){
		$("#loginform").submit();
	}else{
		alert("Please fill in the form fields then try again");
	}
});

if( $("#program_wrap").length > 0 ){

	$("#program_wrap").tabs();
	$("#phase-1-groups").tabs();
}
 



})(this.jQuery);



// usage: log('inside coolFunc',this,arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
  log.history = log.history || [];   // store logs to an array for reference
  log.history.push(arguments);
  if(this.console){
    console.log( Array.prototype.slice.call(arguments) );
  }
};



// catch all document.write() calls
(function(doc){
  var write = doc.write;
  doc.write = function(q){ 
    log('document.write(): ',arguments); 
    if (/docwriteregexwhitelist/.test(q)) write.apply(doc,arguments);  
  };
})(document);



