Cufon.replace('.cp',{ fontFamily: 'copperplate', hover:true });


$('#images img').preload({
    find: '.jpg',
    replace: '_over.jpg'
});

			
$(function(){ 
	// find all the input elements with title attributes
	$('input[title!=""]').hint();
	$('input').focus(function() { 
		$(this).select(); 
	});
	
	findimg();
	
	$('img.roll').preload({
		find: '.gif',
		replace: '_ro.gif'
	});
	
});
				   
function findimg()
{
 var imgs,i;
// loop through all images of the document
 imgs=document.getElementsByTagName('img');
 for(i=0;i<imgs.length;i++)
 {
// test if the class 'roll' exists
  if(/roll/.test(imgs[i].className))
  {
// add the function roll to the image onmouseover and onmouseout and send
// the image itself as an object
   imgs[i].onmouseover=function(){roll(this);};
   imgs[i].onmouseout=function(){roll(this);};
  }
 }
}


function roll(o){
 var src,ftype,newsrc;
 // get the src of the image, and find out the file extension
 

	 src = o.src;
	 ftype = src.substring(src.lastIndexOf('.'), src.length);
	 // check if the src already has an _on and delete it, if that is the case 
	 if(/_ro/.test(src)){
	  newsrc = src.replace('_ro','');
	  $(o).removeClass('on');
	  }else{
	  // else, add the _on to the src 
	  newsrc = src.replace(ftype, '_ro'+ftype);
	  $(o).addClass('on');
	  }
	 o.src=newsrc;
}

