$("document").ready(function(){
	$("div.offset a[href='#']").click(function(){
		var loc = document.location.href.replace(/\([0-9]+\)(#.*)?$/,'');
		document.location = loc+"("+$(this).attr("offset")+")";
		return false;
	});
  $("a.sendpage").click(function(){return sendPage()});
  $("a.printpage").click(function(){return printPage()});
});

function isValidEmail(email,required){
  required = required || true;
  email = email || '';
  return /^[a-z0-9._-]+@([a-z0-9-]{2,})([.][a-z0-9-]{2,})*[.][a-z]{2,6}$/.exec(email);
}

function popup(mylink,windowname,width,height,otherparam){
    if (! window.focus)return false;
    if(width == undefined) width = 690;
    if(height == undefined) height = 550;;
    if(otherparam == undefined) otherparam = "scrollbars=yes";
    var href;
    if (typeof(mylink) == 'string')
       href=mylink;
    else
       href=mylink.href;
    if(windowname == undefined) windowname = href;
    window.open(href, windowname, 'width='+width+',height='+height+','+otherparam);
    return false;
}

function sendPage(){
	return popup('/Send','send',600,500,"scrollbars=no,resizable=no");
}

function printPage(){
	return popup('/Print','print',600,500,"scrollbars=no,resizable=no");
}
