
jQuery.extend({
	
	showAkModal:function(navurl,title,box_width,box_height)
	{
	    var offset={};
	    var options ={
	    margin:1,
	    border:1,
	    padding:1,
	    scroll:0
	    };
		
	    var win_width =$(window).width();
	    var scrollToLeft=$(window).scrollLeft();
	    var win_height =$(window).height();
	    var scrollToBottom=$(window).scrollTop();
	   

	    $('body').append("<div id='ak_modal_div' style='padding-top:130px;border:0px solid black;position: absolute;z-index:1000;display:none;'><iframe width='"+box_width+"' height='"+box_height+"'  frameborder=0 marginwidth='0' marginheight='0' scrolling='NO'  name='frmTest' src='"+navurl+"'></iframe></div>");

	    $('#ak_modal_div').css({left:(((win_width/2-box_width/2))+scrollToLeft)+'px',top:(((win_height/2-box_height/2))+scrollToBottom)+'px'});
	  
	    $('#close').click( function() {
	       // 
	       $('#ak_modal_div').Puff(500);
	       $('#ak_modal_div').remove();
	        $.dimScreenStop();
	    });
	    $.dimScreen(500, 0.7, function() {
			$('#ak_modal_div').Grow(500);
	    });
	    
		var offset = {}
	    $("#ak_modal_div").offset({ scroll: false }, offset)

  	    X_left=offset.left+box_width-16;
	    X_top=offset.top-1;

	    $('#close').css({left:X_left,top:X_top});

	},
	//--------------------------condition---------------------------------------
	
		
	commentpost:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	  //alert(document.getElementById.('user_id').value);
	   //window.location="dormroom_members.php?userid=";
	},
	moveindex:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="index.php";
	},
	moveenroll:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="enroll.php";
	},
	movedormroom:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="dormrooms.php";
	},
	
	movebuybark:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="buybark.php";
	},
	movegreenlist:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="greenlist.php";
	},
	movecampusinformation:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="campusinformation.php";
	},
	
	movecampusclub:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="campusclubs.php";
	},
	akModalRemove:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="dormrooms.php";
	},
	paypalRemove:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="https://www.sandbox.paypal.com/cgi-bin/webscr";
	},
	akModalRemove_ref:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="login.php?actions=myprofileview";
	},
	akModalRemove_child:function(name,id)
	{
	
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="login.php?actions=myprofileview";
	},
	akModalRemove_child_ref:function(name,id)
	{
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="condition.php?nav=con&act1=load&nav_name="+name+"&child_id="+id;
	},
	//--------------------------medication---------------------------------------
	akModalRemove_med:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="medication.php?nav=med";
	},
	akModalRemove_med_ref:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="medication.php?nav=med&act=load";
	},
	akModalRemove_med_child:function(name,id)
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="medication.php?nav=med&nav_name="+name+"&child_id="+id;
	},
	akModalRemove_med_child_ref:function(name,id)
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="medication.php?nav=med&act1=load&nav_name="+name+"&child_id="+id;
	},
	//--------------------------allergies---------------------------------------
	akModalRemoveall:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="allergies.php?nav=all";
	},
	akModalRemoveall_ref:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="allergies.php?nav=all&act=load";
	},
	akModalRemoveall_child:function(name,id)
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="allergies.php?nav=all&nav_name="+name+"&child_id="+id;
	},
	akModalRemoveall_child_ref:function(name,id)
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="allergies.php?nav=all&act1=load&nav_name="+name+"&child_id="+id;
	},
	//--------------------------procedures---------------------------------------
	akModalRemove_pro:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="procedures.php?nav=pro";
	},
	accept_friend:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="dormrooms.php?accept=success";
	},
	
		friendinvite:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="dormrooms.php?friend=sends";
	},
	
	
	
	
	akModalRemove_pro_ref:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="procedures.php?nav=pro&act=load";
	},
	akModalRemove_pro_child:function(name,id)
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="procedures.php?nav=pro&nav_name="+name+"&child_id="+id;
	},
	akModalRemove_pro_child_ref:function(name,id)
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="procedures.php?nav=pro&act1=load&nav_name="+name+"&child_id="+id;
	},
	//--------------------------test results---------------------------------------
	akModalRemove_test:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="test_results.php?nav=test";
	},
	akModalRemove_test_ref:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="test_results.php?nav=test&act=load";
	},
	akModalRemove_test_child:function(name,id)
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="test_results.php?nav=test&nav_name="+name+"&child_id="+id;
	},
	akModalRemove_test_child_ref:function(name,id)
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="test_results.php?nav=test&act1=load&nav_name="+name+"&child_id="+id;
	},
	//--------------------------immunization---------------------------------------
	akModalRemove_imm:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="immunization.php?nav=imm";
	},
	akModalRemove_imm_ref:function()
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="immunization.php?nav=imm&act=load";
	},
	akModalRemove_imm_child:function(name,id)
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="immunization.php?nav=imm&nav_name="+name+"&child_id="+id;
	},
	akModalRemove_imm_child_ref:function(name,id)
	{
		
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="immunization.php?nav=imm&act1=load&nav_name="+name+"&child_id="+id;
	},
	//--------------------------------------------------------------------------------------
	akModalRemove_contact:function()
	 {
	   $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="medical_contacts.php?nav=madical&act=loading";	 
    
	 },
	 akModaleditdoctor:function()
	 {
	  $('#ak_modal_div').Puff(500);
	   $.dimScreenStop();
	   window.location="doctor_profile.php?refresh=ref";	 	 
	 },
	 akbookappoint_pro:function()
	  {
		  $('#ak_modal_div').Puff(500);
	      $.dimScreenStop();
	      window.location="find_a_doctor.php?nav=find";	
	  },
	   akbookappoint_pro2:function()
	  {
		  $('#ak_modal_div').Puff(500);
	      $.dimScreenStop();
	      window.location="doctor_appointment.php";	
	  },
	   akModalRemove_profile:function()
	  {
		  $('#ak_modal_div').Puff(500);
	      $.dimScreenStop();
	      window.location="patient_profile.php";	
	  },
	   akModalRemove_profile_ref:function()
	  {
		  $('#ak_modal_div').Puff(500);
	      $.dimScreenStop();
	      window.location="patient_profile.php?act=load";	
	  },
	  
	akModalHideAndRedirect:function(redirect_url)
	{
	    $('#ak_modal_div').Puff(500);
	    $.dimScreenStop();
	    window.location=redirect_url;
	}
	
});	