function urlExists(path) {
    var mode=navigator.userAgent.indexOf('MSIE')==-1? 0:1;
    var req=mode? new ActiveXObject('Microsoft.XMLHTTP'):new     XMLHttpRequest();
    try {
  	  req.open("HEAD", path, false);                      
  	  req.send(null);
  	  if (req.readyState == 4 && req.status == 200) {                            
        return true;
      } else {                            
        return false;
      }       
  	} catch (e) {                                     
  	  return false;
  	}
}										
