$('#fullMap img[alt]').qtip({
	content: {
		text: false // Use each elements alt attribute
	},
	show: { 
		delay: 0,
		when: { 
			event: 'mouseover' 
		}
	},
	hide: 'mouseout',
	position: {
		corner: {
			target: 'topRight',
			tooltip: 'bottomLeft'
		}
	},
	style: { 
		padding: 2,
		background: '#dddddd',
		color: 'black',
		textAlign: 'left',
		border: {
			width: 4,
			radius: 5,
			color: '#dddddd'
		},
		tip: {
			corner:	'bottomLeft',
			color: false,
			size: {x:12,y:12}
		},
		name: 'dark' // Inherit from preset style
	}
});
$('#fullMap .showVillage img[alt]').qtip("destroy"); 
$('#fullMap .showVillage img[alt]').qtip({
	content: {
		text: false // Use each elements alt attribute
	},
	show: { 
		ready: true,
		delay: 0,
		when: { 
			target: $('html'),
			event: 'load' 
		}
	},
	hide: 'mouseout',
	position: {
		corner: {
			target: 'topRight',
			tooltip: 'bottomLeft'
		}
	},
	style: { 
		padding: 2,
		background: '#dddddd',
		color: 'black',
		textAlign: 'left',
		border: {
			width: 4,
			radius: 5,
			color: '#dddddd'
		},
		tip: {
			corner:	'bottomLeft',
			color: false,
			size: {x:12,y:12}
		},
		name: 'dark' // Inherit from preset style
	}
});
$('#linksBox input.username').focus(function(){
	if ($('.username').attr('value') == ' Username') {
		$('.username').attr('value', ''); 
	}
});
$('#linksBox input.username').blur(function(){	
	if ($('.username').attr('value') == '') {
		$('.username').attr('value', ' Username');
	}
});
$('#linksBox input.password').focus(function(){
	if ($('.password').attr('value') == ' Password') {
		$('.password').attr('value', ''); 
	}
});
$('#linksBox input.password').blur(function(){	
	if ($('.password').attr('value') == '') {
		$('.password').attr('value', ' Password');
	}
});

function addRow() {
    $('.editItems tr:last').after('<tr><td></td><td><input class="itemDescription" type="text" name="item_description[]" value="" /></td><td><input class="itemQuantity" type="text" name="item_quantity[]" value="" /></td><td><input class="itemPrice" type="text" name="item_price[]" value="" /></td><td><input class="itemOrder" type="text" name="new_order[]" value="" /><input type="hidden" name="item_id[]" value="" /></td><td></td><td><input type="hidden" name="item_sold[]"></td><td></td><td></td><td></td><td></td><td></td></tr>');
	$('.editItems .itemDescription').unbind('focus', addRow);
    $('.editItems .itemDescription:last').bind('focus', addRow);
	$('.editItems .itemSold').unbind('focus', addRow);
    $('.editItems .itemSold:last').bind('focus', addRow);
	$('.editItems .itemQuantity').unbind('focus', addRow);
    $('.editItems .itemQuantity:last').bind('focus', addRow);
	$('.editItems .itemPrice').unbind('focus', addRow);
    $('.editItems .itemPrice:last').bind('focus', addRow);
}
$('.editItems .itemDescription:last').bind('focus', addRow);
$('.editItems .itemSold:last').bind('focus', addRow);
$('.editItems .itemQuantity:last').bind('focus', addRow);
$('.editItems .itemPrice:last').bind('focus', addRow);
