$(document).ready( function(){
 
  $(".subPic").mouseover(function() {
    var posi = $(this).position(); var posiL = posi.left; var posiT = (posi.top-250);  
    var imgID = $(this).attr("id");  
    $("#viewMe:hidden").css({position:'absolute', display:'block', 'background-image':'url('+imgID+')' }).css("left", posiL+"px").css("top", posiT+"px");
    //$('#message').css({ width: 550, height: 300, 'font-size': '8pt' });
  });

  $(".subPic").mouseout(function() {
    $("#viewMe:visible").hide();
  });

  $("#viewMe").click(function() {
    $("#viewMe:visible").hide();
  });
  



  $(".model").mouseover(function() {
  $(".listDiv:visible").hide();
    var posi = $(this).position(); var posiL = (posi.left+50); var posiT = (posi.top-106);  
    var ID = $(this).attr("id"); var viewMI = 'mod_'+ID; //alert(viewMI+' '+posiL+' '+posiT);
    $("#"+viewMI).css({position:'absolute', left:posiL+"px", top:posiT+"px", display:'block', 'background-color':'white', border:'thin solid #0066CC' })
    $("#"+viewMI).load("libFunc.php?do=modMI&loid="+ID);
  });


  $("body").click(function() {
    $(".listDiv:visible").hide();
  });

/*
    $(".coe").click( function(){
	var fo = $(this).attr("id"); //alert(fo);
	$("#"+fo).css("color","red"); 
	
	$(".coe").each(function(e) { 
	  var divID = "#"+$(this).attr("id"); //alert(fo+' -- '+divID);
	    if(divID!="#"+fo) { $(this).css("color","black");  } 
	    if(divID=="#"+fo) { $(this).css("color","red"); } 
	});
		
	$(".coeSub").each(function(e) { 
	  var divID = "#"+$(this).attr("id"); //alert(fo+' -- '+divID);
	    if(divID!="#sub"+fo) { if($(this).is(":visible")) { $(this).hide(500); } } 
	    if(divID=="#sub"+fo) { $(this).show(500); $("#"+fo).css("color","red"); } 
	});
    }); 	
*/
		
});


/*
jQuery.validator.addMethod("phoneUS", function(CPM_PHONE, element) {
    phone_number = CPM_PHONE.replace(/\s+/g, ""); 
	return this.optional(element) || phone_number.length > 9 &&
		phone_number.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);
}, "Please specify a valid phone number (format: xxx-xxx-xxxx)");

$(document).ready(function(){ $("#modPics").validate({ rules: { field: { required: true, phoneUS: true }} });  });

*/
	


