function loadmywork(url) {

   var destination = $("#workviewer").offset().top;
   $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination-20}, 1000 );


  $('#workviewer').html('<p><img src="_images/ajax-loader.gif" width="128" height="15" style="margin-top: 100px;" /></p>');
  $('#workviewer').load('_work/' + url);





};

function scrollto(id) {

   var destination = $(id).offset().top;
   $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination-00}, 1000 );


	}

function loadimage(url) {

   var destination = $("#largeimages").offset().top;


  $('#largeimages').html('<img src="' + url +'" width="128" height="15" />');

	};


function loadvideo(url) {

//requires .jpg .ogv and .mp4 files in _video sub-folder


  $('#largeimages').html('<video controls="controls" width="960" poster="' + url + '.jpg"><source src="' + url + '.mp4"></source><source src="' + url + '.ogv"></source></video>');

	};


function loginform(form){


	
	var Password = form.password.value;

	if (Password == 'lumens') {
	
	$('#workicons').load('_includes/work.html');
	
	
	
	} else {
		$('#loginerror').fadeIn(200);
		$("#logindiv").animate({marginLeft: "-300px"}, 100, function(){
			
		$("#logindiv").animate({marginLeft: "-200px"}, 100, function(){
				
		$("#logindiv").animate({marginLeft: "-250px"}, 100);
				
			});
			
				});

	
	}
	}


function clearText(field){

    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;

}



function checkEnter(e){
 e = e || event;
 return (e.keyCode || event.which || event.charCode || 0) !== 13;
}



