2009-09-09 00:26:12 +00:00
//useful function that we'll be using throughout
function confirmClick ( msg )
{
var okay = confirm ( msg ) ;
if ( okay )
return true ;
else
return false ;
}
function el ( str , domain , name )
{
document . write ( '<a href="ma' + 'il' + 'to:' + str + '@' + domain + '">' + name + '</a>' ) ;
}
function em ( str , domain )
{
document . write ( '<a href="ma' + 'il' + 'to:' + str + '@' + domain + '">' + str + '@' + domain + '</a>' ) ;
}
var anyFieldHasBeenChanged = false ;
function fieldChanged ( )
{
anyFieldHasBeenChanged = true ;
}
function confirmChanges ( )
{
if ( anyFieldHasBeenChanged )
{
var okay = confirm ( '<?=i18n("You have unsaved changes. Click \"Cancel\" to return so you can save your changes, or press \"OK\" to discard your changes and continue")?>' ) ;
if ( okay )
return true ;
else
return false ;
}
else
return true ;
}
2009-09-13 08:33:54 +00:00
var _notice _id = 0 ;
var _notice _div _id = 'notice_div' ;
function notice _delete ( id )
{
2009-09-13 19:25:03 +00:00
$ ( "#notice_" + id ) . slideUp ( 'slow' , function ( ) {
$ ( "#notice_" + id ) . remove ( ) ;
} ) ;
2009-09-13 08:33:54 +00:00
}
function notice _create ( type , str , timeout )
{
_notice _id ++ ;
2009-09-13 19:25:03 +00:00
var style = "padding: 0.1em 0; text-align: center; position: relative; " ;
$ ( "#" + _notice _div _id ) . append ( "<div id=\"notice_" + _notice _id + "\" class=\"" + type + "\" style=\"" + style + "\">" + str + "</div>" ) ;
$ ( "#" + _notice _div _id ) . fadeTo ( 'fast' , 0.85 ) ;
$ ( "#notice_" + _notice _id ) . effect ( 'bounce' ) ;
setTimeout ( "notice_delete(" + _notice _id + ")" , timeout ) ;
2009-09-13 08:33:54 +00:00
}
function notice _div _id ( id )
{
2009-09-13 19:25:03 +00:00
if ( id == '' ) id = 'notice_div' ;
2009-09-13 08:33:54 +00:00
var par = $ ( "#" + id ) . parent ( ) ;
var o = par . offset ( ) ;
var w = par . outerWidth ( ) ;
2009-09-13 19:25:03 +00:00
$ ( "#" + id ) . css ( { left : o . left + "px" , top : o . top + "px" , width : w + "px" } ) ;
// $("#"+id).css( { left: 0, top: 0, width: "100%" });
2009-09-13 08:33:54 +00:00
$ ( "#" + id ) . show ( ) ;
2009-09-13 19:25:03 +00:00
_notice _div _id = id ;
2009-09-13 08:33:54 +00:00
}
2009-09-09 00:26:12 +00:00
/* Stuff to do after the document loads */
$ ( document ) . ready ( function ( )
{
} ) ;