var defaultValues = new Array();

$(document).ready(function() {

    $('.tellFriend ul li').each(function() {
        defaultValues.push($('input', this).attr('value'));
    });
    
    $('.tellFriend ul li input[type="text"]').focus(function() {
        listElementIndex = $('.tellFriend ul li').index($(this).parent());
        if($(this).attr('value') == defaultValues[listElementIndex]) {
           $(this).attr('value', ''); 
        }
    });
    
    $('.tellFriend ul li input[type="text"]').blur(function() {
        listElementIndex = $('.tellFriend ul li').index($(this).parent());
        if($(this).attr('value') == '') {
           $(this).attr('value', defaultValues[listElementIndex]); 
        }
    });
    
    //$('.tellFriend ul li').index(this) - Index of current li 

//

/*     init(); */
});

function init() {
    $('a.popupLink').bind('click', function(e) { popupWindow($(this).attr('href'), $(this).attr('title').replace(/[^A-z]/ig, ''),'width=550, height=400, scrollbars'); e.preventDefault(); });
}

function popupWindow(url, name, attributes){
	var newWindow = window.open(url, name, attributes);
	newWindow.focus();
}
 
 