function getNewPM(url){

	YAHOO.util.Connect.asyncRequest('GET', url.replace('&amp;', '&'), {success: handleNewPM, failure: null, scope: null}, null);
}

function handleNewPM(http){
	
	//alert("d");
	
	var results = http.responseText.split("\n");
	
	var id = "pmIconContainter";
	
	var obj = document.getElementById(id);	
	
	if(parseInt(results) > 0 ){
	
		obj.innerHTML = '<img style="height:16px;width:16px;vertical-align:middle;" src="http://photo.am/images/inbox-new.png" alt="inbox" />';
	}else {
		obj.innerHTML = '<img style="height:16px;width:16px;vertical-align:middle;" src="http://photo.am/images/inbox.png" alt="inbox" />';
	}
}

function checkNewMessages() {
	
	getNewPM(urlPM);
	
	//setTimeout("checkNewMessages();", 30000);
  
}
