/////////////////////////////////////////////////////////////////////
/* Document contains core javascript functions used by home.template.js, base.template.js etc
////////////////////////////////////////////////////////////////////*/

function myAlert(strCaption, strWhat) {
	Modalbox.show('<div class=\'warning\'><p>' + strWhat + '</p><input type=\'button\' value=\'OK\' onclick=\'Modalbox.hide()\' />', {title: strCaption, width: 300});	
}

function assignRoundedCorners() {
	// assign rounded corners
    settings = {
      tl: { radius: 10 },
      tr: { radius: 10 },
      bl: { radius: 10 },
      br: { radius: 10 },
      antiAlias: false,
      autoPad: true
    }
	
	$$('.rounded').each(function(s, index) {
		var cornersObj = new curvyCorners(settings, s);
   		 cornersObj.applyCornersToAll();	
	});	
}

function assignClearForms() {
	// Go through all clear buttons on the page (class=reset) and force previous form to clear
	$$('input.reset').each(function(s) {										
		s.observe('click',function(e) {
			this.up(1).reset();
			e.stop();			
		});
	});
}

function assignPageButtons() {
	
	setupZoom();
	
	// assign print
	Event.observe('print', 'click', function() { window.print();});
	
	// assign home
	$('logo').observe('click', function() { location.href='/'; } );		
}
