var t;
var temp_left,temp_right;

function call_wait_div()
{
    //$('#loadingDiv').css('display','block');
    if($('#loadingDiv').css("display")=='block')
    {
        $('#loadingDiv').html="Still Working...";
        clearTimeout(t);
        return;
    }
    if($('#loadingDiv').css("display")=='none')
    {
        if(t!=undefined)
        {
          clearTimeout(t);
          return;
        }
        $('#loadingDiv').css('display','block');
    }
    t = setTimeout("call_wait_div()",5000);
}
function hide_wait_div()
{
    $('#loadingDiv').css('display','none');
    clearTimeout(t);
    t = undefined;
}

function call_thickbox(type, extra_param1, extra_param2,extra_param3,extra_param4,extra_param5,extra_param6)
{

    var html="";
	call_wait_div();
	if(type=="leave_school")
	{
	      html += '<div class="thickbox-content" >Are you sure you want to remove this role from your profile?';
        html += '<br><br><div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="event_leave(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Remove Role", "#TB_inline?height=115&width=325&inlineId=hiddenDialogText&modal=true", false);
	}
	else if(type=="delete_group_anounce")
	{
	     html += '<div class="thickbox-content" >Are you sure you want to remove this announcements?';
	     html += '<br><br><div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="remove_announce(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
	     $('#hiddenDialogText').html(html);
	     tb_show("Remove Announcements", "#TB_inline?height=80&width=325&inlineId=hiddenDialogText&modal=true", false);

	}
	else if(type=="msg_group_anounce")
	{
	     html += '<div class="thickbox-content" >'+extra_param1;
	     html += '<br><br><div class="button-area"  align="center">&nbsp;&nbsp;<input type="button" value="Ok" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
	     $('#hiddenDialogText').html(html);
	     tb_show("Remove Announcements", "#TB_inline?height=80&width=325&inlineId=hiddenDialogText&modal=true", false);
	}
	else if(type=="delete_group_events")
	{
	     html += '<div class="thickbox-content" >Are you sure you want to remove this events?';
	     html += '<br><br><div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="remove_group_event(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
	     $('#hiddenDialogText').html(html);
	     tb_show("Remove Events", "#TB_inline?height=80&width=325&inlineId=hiddenDialogText&modal=true", false);
	}
	else if(type=="msg_group_events")
	{
	     html += '<div class="thickbox-content" >'+extra_param1;
	     html += '<br><br><div class="button-area"  align="center">&nbsp;&nbsp;<input type="button" value="Ok" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
	     $('#hiddenDialogText').html(html);
	     tb_show("Remove Events", "#TB_inline?height=80&width=325&inlineId=hiddenDialogText&modal=true", false);
	}
	else if(type=="remove_group_exercise")
	{
	     html += '<div class="thickbox-content" >Are you sure you want to remove this Exercise?';
	     html += '<br><br><div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="remove_group_exercise(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
	     $('#hiddenDialogText').html(html);
	     tb_show("Remove Group Exercise", "#TB_inline?height=80&width=325&inlineId=hiddenDialogText&modal=true", false);

	}
	else if(type=="remove_class_exercise")
	{
	     html += '<div class="thickbox-content" >Are you sure you want to remove this Exercise?';
	     html += '<br><br><div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="remove_class_exercise(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
	     $('#hiddenDialogText').html(html);
	     tb_show("Remove Class Exercise", "#TB_inline?height=80&width=325&inlineId=hiddenDialogText&modal=true", false);

	}
	else if(type=="msg_group_exercise")
	{
	     html += '<div class="thickbox-content" >'+extra_param1;
	     html += '<br><br><div class="button-area"  align="center">&nbsp;&nbsp;<input type="button" value="Ok" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
	     $('#hiddenDialogText').html(html);
	     tb_show("Remove Group Exercise", "#TB_inline?height=80&width=325&inlineId=hiddenDialogText&modal=true", false);
	}
	else if(type=="msg_class_exercise")
	{
	     html += '<div class="thickbox-content" >'+extra_param1;
	     html += '<br><br><div class="button-area"  align="center">&nbsp;&nbsp;<input type="button" value="Ok" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
	     $('#hiddenDialogText').html(html);
	     tb_show("Remove Group Exercise", "#TB_inline?height=80&width=325&inlineId=hiddenDialogText&modal=true", false);
	}
	else if(type=="remove_group_lesson")
	{
	     html += '<div class="thickbox-content" >Are you sure you want to remove this Lesson?';
	     html += '<br><br><div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="remove_group_lesson(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
	     $('#hiddenDialogText').html(html);
	     tb_show("Remove Group Lesson", "#TB_inline?height=80&width=325&inlineId=hiddenDialogText&modal=true", false);

	}
	else if(type=="remove_class_lesson")
	{
	     html += '<div class="thickbox-content" >Are you sure you want to remove this Lesson?';
	     html += '<br><br><div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="remove_class_lesson(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
	     $('#hiddenDialogText').html(html);
	     tb_show("Remove Class Lesson", "#TB_inline?height=80&width=325&inlineId=hiddenDialogText&modal=true", false);

	}
	else if(type=="msg_group_lesson")
	{
	     html += '<div class="thickbox-content" >'+extra_param1;
	     html += '<br><br><div class="button-area"  align="center">&nbsp;&nbsp;<input type="button" value="Ok" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
	     $('#hiddenDialogText').html(html);
	     tb_show("Remove Group Lesson", "#TB_inline?height=80&width=325&inlineId=hiddenDialogText&modal=true", false);
	}
	else if(type=="msg_class_lesson")
	{
	     html += '<div class="thickbox-content" >'+extra_param1;
	     html += '<br><br><div class="button-area"  align="center">&nbsp;&nbsp;<input type="button" value="Ok" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
	     $('#hiddenDialogText').html(html);
	     tb_show("Remove Class Lesson", "#TB_inline?height=80&width=325&inlineId=hiddenDialogText&modal=true", false);
	}
	else if(type=="leave_yes")
	{
		    html += '<div class="thickbox-content" >'+extra_param1;
        html += '<br><br><div class="button-area"  align="center">&nbsp;&nbsp;&nbsp;<input type="button" value="OK" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        if(extra_param1=="You have successfully deleted this role from your profile.")
		tb_show("Delete a Role", "#TB_inline?height=115&width=325&inlineId=hiddenDialogText&modal=true", false);
	  else
	      tb_show("You Cannot Remove This Role", "#TB_inline?height=115&width=325&inlineId=hiddenDialogText&modal=true", false);

	}
     else if(type=="join_groups")
     {
        // Done
        html += '<div class="thickbox-content" >Are you sure you want to <br> join this group?</div>';
        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_yes" value="Yes" id="btn_yes" onclick="join_group(\''+extra_param1+'\',\''+extra_param2+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Join Group", "#TB_inline?height=115&width=325&inlineId=hiddenDialogText&modal=true", false);
     }
	else if(type=="delete_school_event")
     {
        //Done
        html += '<div class="thickbox-content">Are you sure you want to delete this event ?';
        html += '<br><br><label valign="absmiddle"><input type="checkbox" name="chk_del" id="chk_del">Delete Permenantely.</label></div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="event_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Add Child", "#TB_inline?height=100&width=325&inlineId=hiddenDialogText&modal=true", false)
     }
	else if(type=="join_school")
     {
        // Done
        html += '<div class="thickbox-content" style="border:0px solid red;">';
        html += 'Enter Your Email(UserName) : ';
    	   html += '<input type="text" name="vEmail" id="vEmail" size="30"><br><br>';
        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_yes" value="Submit" id="btn_yes" onclick="join_school(\''+extra_param1+'\',\''+$('#vEmail').val()+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Join School", "#TB_inline?height=79&width=450&inlineId=hiddenDialogText&modal=true", false)
     }
     else if(type=="show_map")
     {
        // Done
    	  html += '<div class="thickbox-content" style="border:0px solid red;">';
		    $('#hiddenDialogText').html(html);
    		tb_show("Maps","ajax_file/show_map?height=365&width=600&iSchoolId="+extra_param3+"&iDistrictId="+extra_param1+"&type="+extra_param2+"&KeepThis=true&TB_iframe=true", false);
     }
     else if(type=="exercise_ref")
     {
        // Done
    	  html += '<div class="thickbox-content" style="border:0px solid red;">';
		    $('#hiddenDialogText').html(html);
    		tb_show("Add a New Source","ajax_file/exercise_ref_add?height=365&width=600&iDistrictId="+extra_param1+"&type="+extra_param2+"&KeepThis=true&TB_iframe=true", false);
     }
     else if(type=="tutor_payment_view")
     {
        // Done

    	  html += '<div class="thickbox-content" style="border:0px solid red;">';
		    $('#hiddenDialogText').html(html);
    		tb_show("Class Payment","ajax_file/tutor_payment_view?height=365&width=600&iTutorAppointmentId="+extra_param1+"&type="+extra_param2+"&KeepThis=true", false);
     }
     else if(type=="add_parent")
     {
        // Done
        html += '<div class="thickbox-content" >Are you sure you want to add this user as your parent?';
        html += '<br><br>Personal Message&nbsp;<textarea name="per_msg" id="per_msg" rows=2 cols=40></textarea></div>';
		    html += '<div class="button-area" align="center"><br><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="add_parent(\''+extra_param1+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
	      tb_show("Add Parent", "#TB_inline?height=180&width=360&inlineId=hiddenDialogText&modal=true", false)
     }
	else if(type=="add_teacher")
     {
        // Done
        html += '<div class="thickbox-content">Are you sure you want to add this user as one of your teachers?';
		    html += '<br><br>Personal Message:<br/><textarea name="per_msg" id="per_msg" rows=2 cols=40></textarea></div>';
        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="add_teacher(\''+extra_param1+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Add Teacher", "#TB_inline?height=180&width=360&inlineId=hiddenDialogText&modal=true", false)
     }
	else if(type=="add_student")
     {
        // Done
        html += '<div class="thickbox-content">Are you sure you want to add this user as one of your students?';
    		html += '<br><br>Personal Message:<br/><textarea name="per_msg" id="per_msg" rows=2 cols=40></textarea></div>';
        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="add_student(\''+extra_param1+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Add Student", "#TB_inline?height=140&width=360&inlineId=hiddenDialogText&modal=true", false)
     }
  else if(type=="add_child")
     {
        // Done
        html += '<div class="thickbox-content">Are you sure you want to add this user as your child?';
    		html += '<br><br>Personal Message:<br/><textarea name="per_msg" id="per_msg" rows=2 cols=40></textarea></div>';
        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="add_child(\''+extra_param1+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Add Child", "#TB_inline?height=140&width=360&inlineId=hiddenDialogText&modal=true", false)
     }   
	else if(type=="add_friend")
     {
        // Done
        html += '<div class="thickbox-content" >Are you sure you want to add '+extra_param2+' as a friend?';
        html += '<br><br>Personal Message:<br/><textarea name="per_msg" id="per_msg" rows=2 cols=40></textarea></div>';
		    html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="add_friend(\''+extra_param1+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Add Friend", "#TB_inline?height=155&width=360&inlineId=hiddenDialogText&modal=true", false)
     }
	else if(type=="del_comment")
     {
        // Done
        html += '<div class="thickbox-content">Are you sure you want to delete this comment?</div>';
        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_yes" value="Yes" id="btn_yes" onclick="del_comment(\''+extra_param1+'\',\''+extra_param2+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Delete User Comment?","#TB_inline?height=80&width=300&inlineId=hiddenDialogText&modal=true", false);
     }
     else if(type=="del_lesson_comment")
     {
        // Done
        html += '<div class="thickbox-content">Are you sure you want to delete this comment?</div>';
        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_yes" value="Yes" id="btn_yes" onclick="del_comment(\''+extra_param1+'\',\''+extra_param2+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Delete Lesson Comment?","#TB_inline?height=80&width=300&inlineId=hiddenDialogText&modal=true", false);
     }

     else if(type=="del_img_comment")
     {
        // Done
        html += '<div class="thickbox-content">Are you sure you want to delete this comment?</div>';
        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_yes" value="Yes" id="btn_yes" onclick="del_img_comment(\''+extra_param1+'\',\''+extra_param2+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Delete User Comment?","#TB_inline?height=80&width=300&inlineId=hiddenDialogText&modal=true", false);
     }
     else if(type=="del_group_img_comment")
     {
          // Done
          html += '<div class="thickbox-content">Are you sure you want to delete this comment?</div>';
          html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_yes" value="Yes" id="btn_yes" onclick="post_comment(\'Delete\',\''+extra_param1+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
          $('#hiddenDialogText').html(html);
          tb_show("Delete User Comment?","#TB_inline?height=80&width=300&inlineId=hiddenDialogText&modal=true", false);
     }
	else if(type=="del_school_comment")
     {
          // Done
		html += '<div class="thickbox-content">Are you sure you want to delete this comment?</div>';
          html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_yes" value="Yes" id="btn_yes" onclick="del_school_comment(\''+extra_param1+'\',\''+extra_param2+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
          $('#hiddenDialogText').html(html);
          tb_show("Delete School Comment?","#TB_inline?height=75&width=300&inlineId=hiddenDialogText&modal=true", false);
     }
     else if(type=="del_group_discussion")
     {
        // Done
        html += '<div class="thickbox-content">Are you sure you want to Delete this Discussion?</div>';
        html += '<div class="button-area"   align="center"><input type="button" class="button" name="btn_yes" value="Yes" id="btn_yes" onclick="del_comment(\''+extra_param1+'\',\''+extra_param2+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Delete this Discussion?","#TB_inline?height=75&width=300&inlineId=hiddenDialogText&modal=true", false);
     }
	else if(type=="edit_photo")
     {
        // Done
        html += '<div class="thickbox-content">';
        html += 'Upload your photo from here.<br></div>';
        html += '<div class="button-area"><input type="submit" class="button" name="btn_upload" value="Upload Image" id="btn_upload" />&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Edit the photo?","#TB_inline?KeepThis=true&TB_iframe=true&height=68&width=300&inlineId=hiddenDialogText&modal=true", false);
    }
	else if(type=="leave_group")
    {
        // Done
        html += '<div class="thickbox-content" >Are you sure you want to <br> leave this Group?</div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="leave_group(\''+extra_param1+'\',\''+extra_param2+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Leave Group", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
        // #TB_inline?height=155&width=300&inlineId=hiddenModalContent&modal=true
    }
  else if(type=="leave_class")
    {
        // Done
        html += '<div class="thickbox-content" >Are you sure you want to <br> leave this Class?</div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="leave_class(\''+extra_param1+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Leave Class", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
	else if(type=="approve_friend")
    {
        //Done
        html += '<div class="thickbox-content">Are you sure you want to approve this friend?</div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="friend_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Approve Friend", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
	  else if(type=="block_friend")
    {
        //Done
        html += '<div class="thickbox-content">Are you sure you want to block this user?</div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="friend_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Block Friend", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
	else if(type=="block_parent")
    {
        //Done
        html += '<div class="thickbox-content">Are you sure you want to block this parent?</div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="parent_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Block Parent", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
	else if(type=="block_student")
    {
        //Done
        html += '<div class="thickbox-content">Are you sure you want to block this student?</div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="student_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Block Student", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
	else if(type=="block_teacher")
    {
        //Done
        html += '<div class="thickbox-content">Are you sure you want to block this teacher?</div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="student_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Block teacher", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
	else if(type=="block_children")
    {
        //Done
        html += '<div class="thickbox-content">Are you sure you want to block this children?</div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="children_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Block Children", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
    else if(type=="approve_class_member")
    {
        //Done
        html += '<div class="thickbox-content">Are you sure you want to approve this member?</div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="class_member_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Approve member for class", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
    else if(type=="delete_class_member")
    {
        //Done
        //html += '<div class="thickbox-content">Are you sure you want to delete '+extra_param2+' this member from class?</div>';
        html += '<div class="thickbox-content">Are you sure you want to delete '+extra_param2+' from this class?  This action will remove this member\'s attendance and grading information from our database.</div>'
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Delete" id="btn_ok" onclick="delete_class_member(\''+extra_param1+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Don\'t Delete" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Remove member from class", "#TB_inline?height=115&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
	 else if(type=="decline_class_member")
    {
        //Done

        html += '<div class="thickbox-content">Are you sure you want to reject this user\'s request to join this class?</div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Reject" id="btn_ok" onclick="class_member_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Don\'t Reject" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Reject Member", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
	  else if(type=="delete_friend")
    {
        //Done
        html += '<div class="thickbox-content">Are you sure you want to delete this user from your friend list?';
        html += '<br><br><label valign="absmiddle"><input type="checkbox" name="chk_del" value="Delete&Block" id="chk_del">Delete and Block Permenantely.</label></div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="friend_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Remove Friend From List", "#TB_inline?height=120&width=350&inlineId=hiddenDialogText&modal=true", false)
    }
	else if(type=="delete_parent")
    {
        html += '<div class="thickbox-content">Are you sure you want to delete this user from your parent list?';
        html += '<br><br><label valign="absmiddle"><input type="checkbox" name="chk_del" value="Delete&Block" id="chk_del">Delete and Block Permenantely.</label></div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="parent_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Remove Parent From List", "#TB_inline?height=120&width=350&inlineId=hiddenDialogText&modal=true", false)
    }
    else if(type=="delete_student")
    {
        html += '<div class="thickbox-content">Are you sure you want to delete this user from your student list?';
        html += '<br><br><label valign="absmiddle"><input type="checkbox" name="chk_del" value="Delete&Block" id="chk_del">Delete and Block Permenantely.</label></div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="student_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Remove Parent From List", "#TB_inline?height=120&width=350&inlineId=hiddenDialogText&modal=true", false)
    }
    else if(type=="delete_teacher")
    {
        html += '<div class="thickbox-content">Are you sure you want to delete this user from your teacher list?';
        html += '<br><br><label valign="absmiddle"><input type="checkbox" name="chk_del" value="Delete&Block" id="chk_del">Delete and Block Permenantely.</label></div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="teacher_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Remove Teacher From List", "#TB_inline?height=120&width=350&inlineId=hiddenDialogText&modal=true", false)
    }
	else if(type=="delete_children")
    {
        html += '<div class="thickbox-content">Are you sure you want to delete this user from your list of children?';
        html += '<br><br><label valign="absmiddle"><input type="checkbox" name="chk_del" value="Delete&Block" id="chk_del">Delete and Block Permenantely.</label></div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="children_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Remove Child From List", "#TB_inline?height=120&width=350&inlineId=hiddenDialogText&modal=true", false)
    }
	  else if(type=="approve_parent")
    {
        //Done
        html += '<div class="thickbox-content">Are you sure you want to approve this user as your parent?</div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="parent_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Approve Parent?", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
	  else if(type=="reject_parent")
    {
        //Done
        html += '<div class="thickbox-content" >Are you sure you want to reject this user as your parent?</div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="parent_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Reject Parent?", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
	  else if(type=="approve_children")
    {
        //Done
        html += '<div class="thickbox-content">Are you sure you want to approve this user as your child?</div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="children_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Approve Child?", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
	  else if(type=="reject_children")
    {
        //Done
        html += '<div class="thickbox-content" >Are you sure you want to reject this user as your child?</div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="children_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Reject Child?", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
	else if(type=="approve_teacher")
    {
        //Done
        html += '<div class="thickbox-content">Are you sure you want to approve this user as one of your teachers?</div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="teacher_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Approve Teacher?", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
	else if(type=="reject_teacher")
    {
        //Done
        html += '<div class="thickbox-content">Are you sure you want to reject this user as one of your teachers?</div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="teacher_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Reject Teacher?", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
	  else if(type=="approve_student")
    {
        //Done
        html += '<div class="thickbox-content">Are you sure you want to approve this user as one of your students?</div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="student_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Approve Student?", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
	else if(type=="reject_student")
    {
        //Done
        html += '<div class="thickbox-content">Are you sure you want to reject this user as one of your students?</div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="student_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Reject Student?", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
	  else if(type=="reject_parent")
    {
        //Done
        html += '<div class="thickbox-content">Are you sure you want to reject this user as your parent?</div>';
        html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="parent_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Reject Parent?", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
     else if(type=="Report_Abuse")
    {
        //Done
        html += '<div class="thickbox-content">If you know that this user is not associated with one of the schools listed in his/her biographical information section, or if there is inappropriate information listed on this page, please report the problem here.  Provide any relevant details below so we can continue to ensure the integrity of this site.  Thank you.</div>';
            html += '<div id="personal_message" style="text-align:center;"><textarea id="vPersonalMessage" rows=4 cols=60 name="vPersonalMessage" ></textarea></div>';
  		  html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="report_abuse(\''+type+'\',\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Report A Problem","#TB_inline?height=220&width=490&inlineId=hiddenDialogText&modal=true", false)
    }
	else if(type=="Report_Abuse_Course")
    {
        //Done
        html += '<div class="thickbox-content">This user is not affiliated with this course.</div>';
  	    html += "<div class=button-area align=center><input type=button class=button name=btn_ok value=Submit id=btn_ok onclick=report_abuse_course('"+extra_param1+"','"+extra_param2+"','"+extra_param3+"','"+extra_param4+"');>&nbsp;&nbsp;&nbsp;<input type=button value=Cancel class=button name=btn_cancel id=btn_cancel onclick=tb_remove(); /></div>";
		    $('#hiddenDialogText').html(html);
        tb_show("Report A Problem","#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
  else if(type=="Report_Abuse_School")
    {
        //Done
		try{
        html += '<div>';
            html += '<div>If you have found an error in the information on this page and are unable to correct it, please report it.  Describe your problem in detail below so we can find it and fix it.  <br> Thank you.</div>';
            html += '<div class="thickbox-content"><textarea id="vPersonalMessage" rows=4 cols=60 name="vPersonalMessage" ></textarea></div>';
  	        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_ok" value="OK" id="btn_ok" onclick="report_abuse_school(\''+extra_param1+'\');">&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
  	    html += '</div>';
		    $('#hiddenDialogText').html(html);
		    tb_show("Report A Problem","#TB_inline?height=190&width=350&inlineId=hiddenDialogText&modal=true", false);
		}catch(err){}

    }
     else if(type=="Report_Inappropriate")
    {
        //Done
         html += '<div class="thickbox-content">This lesson is not appropriate.Please Contact Administrator.</div>';
         html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_yes" value="Yes" id="btn_yes" onclick="report_inappropriate(\''+type+'\',\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
         $('#hiddenDialogText').html(html);
         tb_show("Report Inappropriate","#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
    else if(type=="Request_Join_Class")
    {
        //Done
        //var ListId = $('#iListId').val();
      	$.post('ajax_file/confirm_join/',{'iClassId':extra_param1, 'vClassName':extra_param2}, function(data){
			$('#hiddenDialogText').html(data);
			tb_show("Request to Join Class","#TB_inline?height=100&width=350&inlineId=hiddenDialogText&modal=true", false);
        });
        
        
        //html += '<div class="thickbox-content">Are you sure you want to join this class?</div>';
        //html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="request_class(\''+type+'\',\''+extra_param1+'\',\''+extra_param2+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        //$('#hiddenDialogText').html(html);
        //tb_show("Request to Join Class", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
	else if(type=="del_album")
    {
        //Done
        html += '<div class="thickbox-content">Are you sure you want to Delete this Album?</div>';
        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_yes" value="Yes" id="btn_yes" onclick="del_album(\''+extra_param1+'\',\''+extra_param2+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Delete Album?","#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false);
    }

    else if(type=="del_album_image")
    {
		//Done
		html += '<div class="thickbox-content">Are you sure you want to Delete this Album?</div>';
        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_yes" value="Yes" id="btn_yes" onclick="del_album_image(\''+extra_param1+'\',\''+extra_param2+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Delete Album?","#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false);
    }

	else if(type=="notification_role_register_mail")
    {
        //Done
        html += '<div class="thickbox-content">Role and School has been successfully added in profile.</div>';
        html += '<div class="button-area" align="center"><input type="button" value="Ok" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        setTimeout('tb_show("School has been successfully added in the role.","#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)',2000);
    }
    /*vice vera for school and role :)*/
	else if(type=="notification_add_role_success")
    {
        //Done

        if(extra_param1=="duplicate")
        {
	        html += '<div class="thickbox-content">You are already a member of this school!';
	        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="tb_remove();" /></div>';
        }
        else
        {
	        html += '<div class="thickbox-content">';
	        if(extra_param1=="Active")
		  	html += 'You have successfully joined this school.!';
		  else if(extra_param1=="Pending")
		  	html += 'Your request to join this school has been submitted and is pending confirmation of your email address.  Watch for a confirmation email and click the link to activate this school in your profile.';
	        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="tb_remove();" /></div>';
        }

        $('#hiddenDialogText').html(html);
        if(extra_param1=="Pending")
        	setTimeout('tb_show("Join School","#TB_inline?height=75&width=400&inlineId=hiddenDialogText&modal=true", false);',2000);
   	  else
	  	setTimeout('tb_show("Join School","#TB_inline?height=130&width=400&inlineId=hiddenDialogText&modal=true", false);',2000);
    }

    /*vice vera for school and role :)*/
	else if(type=="notification_add_school")
    {
        //Done
        html += '<div class="thickbox-content">As a student, you can only switch schools once in three months.  You have recently switched schools and so cannot do so again right now.';
        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
		setTimeout('tb_show("Join School","#TB_inline?height=105&width=400&inlineId=hiddenDialogText&modal=true", false);',2000);
    }
	else if(type=="notification_add_school_success")
    {
        //Done
        if(extra_param1=="duplicate")
        {
	        html += '<div class="thickbox-content">You have previously added this role to your profile!';
	        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="tb_remove();" /></div>';
        }
        else
        {
	        html += '<div class="thickbox-content">You have successfully added this role to your profile!  If a school email address was required, your new role will not appear in your profile until you click the link in the confirmation email sent to the address you provided.';
	        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="tb_remove();" /></div>';
        }

        $('#hiddenDialogText').html(html);
        setTimeout('tb_show("New Role Confirmation","#TB_inline?height=75&width=400&inlineId=hiddenDialogText&modal=true", false);',2000);
    }
	else if(type=="notification_school_register_mail")
    {
        //Done
        html += '<div class="thickbox-content">Your request to add '+extra_param1+' has been submitted and is now pending approval.<br> <br> You may add this school as your school by selecting it from the input box.</div>';
        html += '<div class="button-area" align="center"><input type="button" value="Ok" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        setTimeout('tb_show("School Request","#TB_inline?height=125&width=340&inlineId=hiddenDialogText&modal=true", false)',2000);
    }
	else if(type=="notification_course_registration_mail")
    {
        //Done
        html += '<div class="thickbox-content">Your request to add the course : <b>'+extra_param1+'</b> has been sent.<br> <br></div>';
        html += '<div class="button-area" align="center"><input type="button" value="Ok" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        setTimeout('tb_show("Add A Course","#TB_inline?height=90&width=290&inlineId=hiddenDialogText&modal=true", false)',2000);
    }
	else if(type=="course_alreay_exists")
    {
        //Done
       	html += '<div class="thickbox-content">The course you have entered already exists in this school\'s course catalog.</div>';
			  html += '<div>&nbsp;<br></div>';
        html += '<div class="button-area" align="center"><input type="button" value="Ok" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        setTimeout('tb_show("Course Already Exists","#TB_inline?height=90&width=290&inlineId=hiddenDialogText&modal=true", false)',2000);
    }
	else if(type == "set_fav")
	{
	      //Done
		    html += '<div class="thickbox-content">'+extra_param1+'</b><br>';
        html += '<div class="button-area" align="center"><input type="button" value="Ok" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        setTimeout('tb_show("Set As Favorite","#TB_inline?height=60&width=290&inlineId=hiddenDialogText&modal=true", false)',200);

	}
	else if(type == "remove_fav")
	{
	      //Done
		    html += '<div class="thickbox-content">'+extra_param1+'</b><br>';
        html += '<div class="button-area" align="center"><input type="button" value="Ok" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        setTimeout('tb_show("Remove From Favorite","#TB_inline?height=60&width=290&inlineId=hiddenDialogText&modal=true", false)',200);

	}
	else if(type=="send_invitation")
    {
    	  html += '<div class="thickbox-content">Request for joininig school networking  has been sent to <b>'+extra_param1+'</b>';
        html += '<div class="button-area" align="center"><input type="button" value="Ok" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        setTimeout('tb_show("Invitation For Join School","#TB_inline?height=90&width=290&inlineId=hiddenDialogText&modal=true", false)',2000);
    }
	else if(type=="send_user_invitation")
    {
    	  html += '<div class="thickbox-content">An invitation has been sent to <b>'+extra_param1+'</b><br/>';
        html += '<div class="button-area" align="center"><input type="button" value="OK" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        setTimeout('tb_show("Invitation Sent","#TB_inline?height=90&width=290&inlineId=hiddenDialogText&modal=true", false)',2000);
    }
	else if(type=="del_user_album")
    {
	     //Done
        html += '<div class="thickbox-content">Are you sure you want to Delete this Image?</div>';
        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_yes" value="Yes" id="btn_yes" onclick="del_user_album(\''+extra_param1+'\',\''+extra_param2+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Delete Album Image?","#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false);
    }
    else if(type=="add_to_profile")
    {
        //Done
        setTimeout('tb_show("Add To Profile","ajax_file/add_to_profile?height=75&width=290&inlineId=hiddenDialogText&iPrimaryId='+extra_param1+'&eType='+extra_param2+'", false)',500);
    }
    else if(type=="add_lesson_pictures")
    {
        //Done
        var html='';
        $('#hiddenDialogText').html(html);
        setTimeout('tb_show("Add Lesson Pictures","ajax_file/add_lesson_pictures?height=150&width=290&iLessonId='+extra_param1+'&TB_iframe=true&inlineId=hiddenDialogText", false)',500);
    }
    else if(type=="view_lesson_pictures")
    {
        //Done
        var html='';
        $('#hiddenDialogText').html(html);
        setTimeout('tb_show("View Pictures","ajax_file/view_lesson_pictures?height=500&width=600&iLessImageId='+extra_param1+'&iLessonId='+extra_param2+'&TB_iframe=true&inlineId=hiddenDialogText", false)',500);
    }
    else if(type=="delete_class_category")
    {
        // Done
        html += '<div class="thickbox-content">Are you sure you want to remove <b>'+extra_param1+'</b> category?<br/> It will remove all the assignment and its marks from our database.';
        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_yes" value="Yes" id="btn_yes" onclick="remove_category(\''+extra_param1+'\', \''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Remove Category","#TB_inline?height=100&width=360&inlineId=hiddenDialogText&modal=true", false);
    }
    else if(type=="delete_class_assignment")
    {
        // Done
        html += '<div class="thickbox-content">Are you sure you want to remove <b>'+extra_param1+'</b> Assignment?<br/> this action will remove all assignment details and will delete any associated files from our database.  <br>It will also remove any associated grading information.';
        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_yes" value="Yes" id="btn_yes" onclick="remove_assignment(\''+extra_param1+'\', \''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Delete Class Assignment","#TB_inline?height=125&width=370&inlineId=hiddenDialogText&modal=true", false);
    }
    else if(type=="delete_class_handouts")
    {
        // Done
        html += '<div class="thickbox-content">Are you sure you want to remove <b>'+extra_param1+'</b> Handout?<br/>';
        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_yes" value="Yes" id="btn_yes" onclick="remove_handouts(\''+extra_param1+'\', \''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Delete Class Handouts","#TB_inline?height=75&width=370&inlineId=hiddenDialogText&modal=true", false);
    }
     else if(type=="delete_publication")
    {
    		// Done
        html += '<div class="thickbox-content">Are you sure you want to remove <b>'+extra_param1+'</b>?<br/> It will remove this publication from our database.';
        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_yes" value="Yes" id="btn_yes" onclick="remove_publication(\''+extra_param1+'\', \''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Delete Publication?","#TB_inline?height=75&width=370&inlineId=hiddenDialogText&modal=true", false);
    }
    else if(type=="delete_athletic")
    {
    		// Done
        html += '<div class="thickbox-content">Are you sure you want to remove <b>'+extra_param1+'</b>?';
        html += '<div class="button-area" align="center"><input type="button" class="button" name="btn_yes" value="Yes" id="btn_yes" onclick="remove_athletic(\''+extra_param1+'\', \''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Delete Athletic?","#TB_inline?height=75&width=370&inlineId=hiddenDialogText&modal=true", false);
    }
    else if(type=="delete_event")
    {
    		// Done
        html += '<div class="thickbox-content" style="text-align:center;" >Are you sure you want to remove <b>'+extra_param1+'</b> event ?';
        html += '<br><div class="button-area" align="center"><input type="button" class="button" name="btn_yes" value="Yes" id="btn_yes" onclick="remove_event(\''+extra_param1+'\', \''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Delete Event","#TB_inline?height=75&width=440&inlineId=hiddenDialogText&modal=true", false);
    }
    else if(type=="delete_job")
    {
        // Done
    		html += '<div class="thickbox-content" style="text-align:center;" >Are you sure you want to remove <b>'+extra_param1+'</b> job?<br/> It will remove this job from our database.';
        html += '<br><div class="button-area" align="center"><input type="button" class="button" name="btn_yes" value="Yes" id="btn_yes" onclick="remove_job(\''+extra_param1+'\', \''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Delete Job","#TB_inline?height=75&width=370&inlineId=hiddenDialogText&modal=true", false);
    }
    else if(type=="delete_college")
    {
        // Done
    		html += '<div class="thickbox-content" style="text-align:center;" >Are you sure you want to remove <b>'+extra_param1+'</b> college?<br/> It will remove this college from our database.';
        html += '<br><div class="button-area" align="center"><input type="button" class="button" name="btn_yes" value="Yes" id="btn_yes" onclick="remove_college(\''+extra_param1+'\', \''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Delete College Detail","#TB_inline?height=85&width=370&inlineId=hiddenDialogText&modal=true", false);
     }
     /****************************** delete group **********************************/
     else if(type=="remove_group")
	{
	     html += '<div class="thickbox-content" >Are you sure you want to delete this Group?';
	     html += '<br><br><div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="remove_group(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
	     $('#hiddenDialogText').html(html);
	     tb_show("Delete Group", "#TB_inline?height=80&width=325&inlineId=hiddenDialogText&modal=true", false);
	}
	/******************************************************************************/
	else if(type=="add_profile_message")
    {
        //Not Used
        html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
        html += '<div class="button-area" align="center"><input type="button" value="Ok" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        setTimeout('tb_show("Add To Profile","#TB_inline?height=100&width=300&inlineId=hiddenDialogText&iLessonId='+extra_param1+'", false)',500);
    }
	else if(type=="add_to_class")
    {
        //Done
        html += '<div class="thickbox-border">';
    		html += '<div class="thickbox-heading">Add To Class</div>';
        $('#hiddenDialogText').html(html);
        setTimeout('tb_show("Add To Class","ajax_file/add_to_class?height=500&width=730&inlineId=hiddenDialogText&iPrimaryId='+extra_param1+'&eType='+extra_param2+'", false)',500);
    }
  else if(type=="lesson_to_class")
    {
        //Done
        html += '<div class="thickbox-border">';
    		html += '<div class="thickbox-heading">Add To Class</div>';
        $('#hiddenDialogText').html(html);
        setTimeout('tb_show("Add Lesson To Class","ajax_file/lesson_to_class?height=500&width=730&inlineId=hiddenDialogText&iClassId='+extra_param1+'&eType='+extra_param2+'", false)',500);
    }
  else if(type=="exercise_to_class")
    {
        //Done
        html += '<div class="thickbox-border">';
    		html += '<div class="thickbox-heading">Add To Exercise</div>';
        $('#hiddenDialogText').html(html);
        setTimeout('tb_show("Add Exercise To Class","ajax_file/exercise_to_class?height=500&width=730&inlineId=hiddenDialogText&iClassId='+extra_param1+'&eType='+extra_param2+'", false)',500);
    }
	else if(type=="add_class_message")
    {
        //Not Used
        html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
        html += '<div class="button-area" align="center"><input type="button" value="Ok" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        setTimeout('tb_show("Add To Class","#TB_inline?height=100&width=300&inlineId=hiddenDialogText&iLessonId='+extra_param1+'", false)',500);
    }
    else if(type=="add_to_group")
    {
        //Done
    		html += '<div class="thickbox-border">';
    		html += '<div class="thickbox-heading">Add To Group</div>';
        $('#hiddenDialogText').html(html);
        setTimeout('tb_show("Add To Group","ajax_file/add_to_group?height=500&width=700&inlineId=hiddenDialogText&iPrimaryId='+extra_param1+'&eType='+extra_param2+'", false)',500);
    }
    else if(type=="add_lesson_to_group")
    {
        //Done
    		html += '<div class="thickbox-border">';
    		html += '<div class="thickbox-heading">Add Lesson To Group</div>';
        $('#hiddenDialogText').html(html);
        tb_show("Add Lesson To Group","ajax_file/add_lesson_to_group?height=500&width=920&inlineId=hiddenDialogText&iGroupId="+extra_param1, false);
    }
    else if(type=="add_exercise_to_group")
    {

    		html += '<div class="thickbox-border">';
    		html += '<div class="thickbox-heading">Add Exercise To Group</div>';
        $('#hiddenDialogText').html(html);
        tb_show("Add Exercise To Group","ajax_file/add_exercise_to_group?height=500&width=920&inlineId=hiddenDialogText&iGroupId="+extra_param1, false);
    }
	else if(type=="add_group_message")
    {
        //Not Used
        html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
        html += '<div class="button-area" align="center"><input type="button" value="Ok" class="button" name="btn_no" id="btn_no" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        setTimeout('tb_show("Add To Group","#TB_inline?height=100&width=300&inlineId=hiddenDialogText&iLessonId='+extra_param1+'", false)',500);
    }
    else if(type=="add_flashcard")
    {
        //Done
        //html += '<div class="thickbox-border">';
        //html += '<div class="thickbox-heading"><div style="float:left;">Quiz Options</div><div style="float:right;"><a href="javascript:;" onclick="tb_remove();">Close</a></div></div>';
        $.get(site_url+'ajax_file/add_flashcard/',{'iFlashCardId':extra_param1,'isSetup':extra_param2},
			  function(data){
				    html += data;
				    $('#hiddenDialogText').html(html);
				    tb_show("Add Flash Card","#TB_inline?height=340&width=730&inlineId=hiddenDialogText&modal=true", false);
	        });
        //html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
    }
    else if(type=="add_textual_data")
    {
        //Done
        $.get(site_url+'ajax_file/add_textual_data/',{'iTextualId':extra_param1,'iQuestionId':extra_param2,'mode':extra_param3},
			  function(data){
				  var html = data;
				  $('#hiddenDialogText').html(html);
				    tb_show("Add Question(s)","#TB_inline?height=520&width=920&inlineId=hiddenDialogText&modal=true", false);
  	        });
        //html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
    }else if(type=="add_visualquestion")
    {

    		//html += '<div class="thickbox-border">';
    		//html += '<div class="thickbox-heading"><div style="float:left;">Add Visual data</div><div style="float:right;"><a href="javascript:;" onclick="tb_remove();">Close</a></div></div>';
          	$.get('ajax_file/add_visual_data/',{'iVisualId':extra_param1,'iQuestionId':extra_param2,'mode':extra_param3}, function(data){
				var html1 = data;
				$('#hiddenDialogText').html(data);
				tb_show("Add Question(s)","#TB_inline?height=620&width=790&inlineId=hiddenDialogText", false);
	        });
        	//html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
    }
	else if(type=="review_visual_exercise_setup")
    {
        //Done
		    visualId = $('#iVisualId').val();
      	$.post('ajax_file/review_visual_exercise_setup/',{'iVisualId':visualId}, function(data){
			  $('#hiddenDialogText').html(data);
			  tb_show("Review","#TB_inline?height=650&width=830&inlineId=hiddenDialogText", false);
        });
    }
	else if(type=="quiz_visual_exercise_setup")
    {
		call_visual_quiz(extra_param1,extra_param2,extra_param3)
    }
	else if(type=="add_listquestion")
    {
        //Inprocess
    	//html += '<div class="thickbox-border">';
    	//html += '<div class="thickbox-heading"><div style="float:left;">Add Visual data</div><div style="float:right;"><a href="javascript:;" onclick="tb_remove();">Close</a></div></div>';
    	//alert(extra_param1+"="+extra_param2+"="+extra_param3);
      	$.post('ajax_file/add_list_data/',{'iListId':extra_param1,'iQuestionId':extra_param2,'mode':extra_param3}, function(data){
    		var html = data;
    		$('#hiddenDialogText').html(html);
    		tb_show("Add Question(s)","#TB_inline?height=520&width=730&inlineId=hiddenDialogText", false);
        });
        //html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
    }
	else if(type=="quiz_list_exercise")
    {
      //Inprocess
  		var ListId = $('#iListId').val();
      	$.post('ajax_file/quiz_list_exercise/',{'iListId':ListId}, function(data){
			$('#hiddenDialogText').html(data);
			tb_show("Quiz","#TB_inline?height=500&width=900&inlineId=hiddenDialogText&modal=true", false);
        });
    }
    else if(type=="add_blank_data")
    {
          	$.post('ajax_file/add_blank_data/',{'iBlankId':extra_param1,'iQuestionId':extra_param2,'mode':extra_param3},
			function(data){
				html += data;
				$('#hiddenDialogText').html(html);
				tb_show("Add Question(s)","#TB_inline?height=520&width=730&inlineId=hiddenDialogText&modal=true", false);
	        });
        	//html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
    }
    else if(type=="quiz_setup")
    {
	    	if(extra_param3=="No")
	    	{
	    		alert("Please upload a reading passage or an audio/video file before starting the review or quiz.");
	    		hide_wait_div();
	    		return false;
		}
	  	$.get(site_url+'ajax_file/flashcard_quizsetup/',{'iFlashCardId':extra_param1,'isSetup':extra_param2},
			function(data){
				var html = data;
				$('#hiddenDialogText').html(html);
				tb_show("Quiz Options","#TB_inline?height=420&width=830&inlineId=hiddenDialogText&modal=true", false);
	        });
        	//html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
    }
    else if(type=="visual_quiz_setup")
    {
		     //Done
        if($('#isExerciseInAssignmentForDo').val()=="1")
        {
	      	html += '<div class="thickbox-content" >This exercise is in your class <font color="black"><u>'+$('#ClassName').val()+'</u></font> Do you want to consider this exercise as a assignment?';
	        html += '<br><br><div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="call_visual_quiz_setup(\'Consider\',\''+extra_param2+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_cancel" id="btn_cancel" onclick="call_visual_quiz_setup(\'NotConsider\',\''+extra_param2+'\');" /></div>';
	        $('#hiddenDialogText').html(html);
	        tb_show("Consider as Assignment?", "#TB_inline?height=115&width=325&inlineId=hiddenDialogText&modal=true", false);
	}
	else
	{
		call_visual_quiz_setup('NotConsider',extra_param2);
	}

        	//html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
    }
    else if(type=="quiz_fluency_setup")
    {
        $.get(site_url+'ajax_file/fluency_quizsetup/',{'iRFluencyId':extra_param1},
			function(data){
				html += data;
				$('#hiddenDialogText').html(html);
				tb_show("Quiz Options","#TB_inline?height=420&width=730&inlineId=hiddenDialogText&modal=true", false);
	        });
        	//html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
    }else if(type=="fluency_quiz_start")
    {
        //alert(1);

		     //Done
        if($('#isExerciseInAssignmentForDo').val()=="1")
        {
	      	html += '<div class="thickbox-content" >This exercise is in your class <font color="black"><u>'+$('#ClassName').val()+'</u></font> Do you want to consider this exercise as a assignment?';
	      	//,'iRFluencyId':extra_param1,'iExerciseScoreId':extra_param2,'vSpeed':extra_param3,'eHighlight':extra_param4,'eAudio':extra_param5
	        html += '<br><br><div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="call_fluency_quiz(\'Consider\',\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\',\''+extra_param5+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_cancel" id="btn_cancel" onclick="call_fluency_quiz(\'NotConsider\',\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\''+extra_param4+'\',\''+extra_param5+'\');" /></div>';
	        $('#hiddenDialogText').html(html);
	        tb_show("Consider as Assignment?", "#TB_inline?height=115&width=325&inlineId=hiddenDialogText&modal=true", false);
      	}
      	else
      	{
      		  call_fluency_quiz('NotConsider',extra_param1,extra_param2,extra_param3,extra_param4,extra_param5);
      	}

        	//html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
    }else if(type=="quiz_start")
    {
	    	if(extra_param3=="No")
	    	{
	    		alert("Please upload a reading passage or audio/video file before starting a review or quiz.");
	    		hide_wait_div();
	    		return false;
		}
	        if($('#isExerciseInAssignmentForDo').val()=="1")
	        {
		      	html += '<div class="thickbox-content" >This exercise is in your class <font color="black"><u>'+$('#ClassName').val()+'</u></font> Do you want to consider this exercise as a assignment?';
		        html += '<br><br><div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="call_flash_quiz(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\'Consider\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_cancel" id="btn_cancel" onclick="call_flash_quiz(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\'NotConsider\');" /></div>';
		        $('#hiddenDialogText').html(html);
		        tb_show("Consider as Assignment?", "#TB_inline?height=115&width=325&inlineId=hiddenDialogText&modal=true", false);
		}
		else
		{
			call_flash_quiz(extra_param1,extra_param2,extra_param3,'NotConsider');
		}
        	//html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
    }
    else if(type=="add_mode_flash_data")
    {
        //alert(1);
          	$.get(site_url+'ajax_file/addmode_flash_data/',{'iFlashCardId':extra_param1,'isSetup':extra_param2},				function(data){
				html += data;
				$('#hiddenDialogText').html(html);
				tb_show("Add Flash Card(s)","#TB_inline?height=420&width=730&inlineId=hiddenDialogText&modal=true", false);
	        });
        	//html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
    }
    else if(type=="add_flash_data")
    {
        //alert(1);
          	$.get('ajax_file/add_flash_data/',{'iFlashCardId':extra_param1,'mode':extra_param2,'iFlashCardFieldsId':extra_param3,'iFlashRowId':extra_param4},
			function(data){
				html += data;
				$('#hiddenDialogText').html(html);
				tb_show("Add Flash Card","#TB_inline?height=470&width=780&inlineId=hiddenDialogText&modal=true", false);
	        });
        	//html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
    }
	else if(type=="review_exercise")
    {
    	if(extra_param3=="No")
    	{
    		alert("Please upload a reading passage or audio/video file before starting a review or quiz.");
    		hide_wait_div();
    		return false;
	}
      $.get('ajax_file/review_flash/',{'iFlashCardId':extra_param1,'eExerciseType':extra_param2},

      function(data){
				html += data;
				$('#hiddenDialogText').html(html);
				tb_show("Review Options","#TB_inline?height=470&width=780&inlineId=hiddenDialogText&modal=true", false);
	        });
        	//html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
      }

	else if(type=="review_textual_exercise_setup")
    {
        //alert(1);
          	$.post('ajax_file/review_textual_exercise_setup/',{'iTextualId':extra_param1,'eExerciseType':'review_textual_exercise'},
			function(data){
				html += data;
				$('#hiddenDialogText').html(html);
				tb_show("Review Textual Exercise Setup","#TB_inline?height=250&width=480&inlineId=hiddenDialogText&modal=true", false);
	        });
        	//html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
    }
	else if(type=="review_textual_exercise_setup_file")
    {
	    	if(extra_param2=="No")
	    	{
	    		alert("Please upload an image file before starting the review or quiz.");
	    		hide_wait_div();
	    		return false;
		}
          	$.post('ajax_file/review_textual_exercise_setup_file/',{'iVisualId':extra_param1,'eExerciseType':'review_textual_exercise'},
			function(data){
				html += data;
				$('#hiddenDialogText').html(html);
				tb_show("Visual Exercise Review Setup","#TB_inline?height=250&width=480&inlineId=hiddenDialogText&modal=true", false);
	        });
        	//html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
    }
	else if(type=="review_flash_exercise")
    {
      $.post('ajax_file/review_flash_exercise/',{'iFlashCardId':extra_param1,'eExerciseType':extra_param2},
			function(data){
				html += data;
				$('#hiddenDialogText').html(html);
				tb_show("Review Flash Cards","#TB_inline?height=450&width=750&inlineId=hiddenDialogText&modal=true", false);
	        });
        	//html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
    }
	else if(type=="review_textual_exercise")
    {
        //alert(1);
          	$.post('ajax_file/review_textual_exercise/',{'iTextualId':extra_param1,'eExerciseType':'review_textual_exercise'},
			function(data){
				html += data;
				$('#hiddenDialogText').html(html);
				tb_show("Review Textual Exercise","#TB_inline?height=470&width=780&inlineId=hiddenDialogText&modal=true", false);
	        });
        	//html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
    }
	else if(type=="quiz_textual_exercise")
  {

        if($('#isExerciseInAssignmentForDo').val()=="1")
        {
	      	html += '<div class="thickbox-content" >This exercise is in your class <font color="black"><u>'+$('#ClassName').val()+'</u></font> Do you want to consider this exercise as a assignment?';
	        html += '<br><br><div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="call_textual_quiz(\''+extra_param1+'\',\'Consider\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_cancel" id="btn_cancel" onclick="call_textual_quiz(\''+extra_param1+'\',\'NotConsider\');" /></div>';
	        $('#hiddenDialogText').html(html);
	        tb_show("Consider as Assignment?", "#TB_inline?height=115&width=325&inlineId=hiddenDialogText&modal=true", false);
	}
	else
	{
		call_textual_quiz(extra_param1,'NotConsider');
	}
  }
  else if(type=="view_distribution")
  {
      //Done
      $.post('ajax_file/viewdistribution_graph/'+extra_param2+'/'+extra_param3,{'iAssignmentId':extra_param2,'iClassId':extra_param3},
			function(data){
				html += data;
				$('#hiddenDialogText').html(html);
				tb_show("Grade Distribution Summary [ "+extra_param1 + " ] " ,"#TB_inline?height=470&width=780&inlineId=hiddenDialogText&modal=true", false);
	        });
  }
  else if(type=="view_grade_distribution")
  {
      //Done
      $.post('ajax_file/viewdistributiongrade_graph/',{'graph':extra_param1,'iClassId':extra_param2,'student_grade_str':extra_param3},
			function(data){
				$('#hiddenDialogText').html(data);
				tb_show("Grade Distribution Summary [ Student Grade ] " ,"#TB_inline?height=470&width=780&inlineId=hiddenDialogText&modal=true", false);
	        });
  }  
  
	else if(type=="quiz_blank_exercise")
    {
        //alert(1);
        if($('#isExerciseInAssignmentForDo').val()=="1")
        {
	      	html += '<div class="thickbox-content" >This exercise is in your class <font color="black"><u>'+$('#ClassName').val()+'</u></font> Do you want to consider this exercise as a assignment?';
	        html += '<br><br><div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Yes" id="btn_ok" onclick="call_quiz(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\'Consider\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="No" class="button" name="btn_cancel" id="btn_cancel" onclick="call_quiz(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\',\'NotConsider\');" /></div>';
	        $('#hiddenDialogText').html(html);
	        tb_show("Consider as Assignment?", "#TB_inline?height=115&width=325&inlineId=hiddenDialogText&modal=true", false);
	}
	else
	{
		call_quiz(extra_param1,extra_param2,extra_param3,'NotConsider');
	}

        	//html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
    }
    else if(type=="display_advertise")
    {
		html += '<div>';
				if(extra_param1=='Image'){
					html += '<img id="imgadv" src="'+extra_param3+'" border="0" alt="Advertise Image" />';
					//height = parseInt(extra_param5);
					width = parseInt(extra_param4);
					if(width > 900)
						width = 900;
				}else if(extra_param1=='Flash'){
					width = parseInt(extra_param4);
					html += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+width+'" height="400"><param name="movie" value="'+extra_param3+'" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="'+extra_param3+'" width="'+width+'" height="400" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed></object>';
					if(width > 900)
						width = 900;
				}
		html += '</div>';
		$('#hiddenDialogText').html(html);
		tb_show("Advertise","#TB_inline?height=525&width="+width+"&inlineId=hiddenDialogText&modal=true", false);
    }
	else if(type=="review_exercise_from_class")
    {
      $.post('ajax_file/review_flash_exercise_result/'+extra_param3+'/'+extra_param1+'/'+extra_param2,{'iClassId':extra_param4,'iUserId':extra_param5},
      function(data){
				$('#hiddenDialogText').html(data);

				setTimeout(function(){tb_show("Review Exercise","#TB_inline?height=470&width=730&inlineId=hiddenDialogText&modal=true", false);},700);
	        });
        	//html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
      }
	   else if(type=="view_exercise_detail")
    {
          $.post('ajax_file/review_exercise_detail/',{'iAssignmentId':extra_param1,'iPrimaryId':extra_param2,'eType':extra_param3,'iClassId':extra_param4,'iExerciseId':extra_param5},
          function(data){
    				$('#hiddenDialogText').html(data);
    				setTimeout(function(){tb_show("Exercise Summary","#TB_inline?height=470&width=730&inlineId=hiddenDialogText&modal=true", false);},700);
	        });
        	//html += '<div class="thickbox-content"><b>'+extra_param1+'</b> </div>';
      }      
    else if(type=="display_execise_land")
    {
		html += '<div>';
				if(extra_param1=='image'){
					html += '<img id="imgadv" src="'+extra_param3+'" border="0" alt="Advertise Image" />';
					width = parseInt(extra_param4);
					if(width > 900)
						width = 900;
				}
		html += '</div>';
		$('#hiddenDialogText').html(html);
		tb_show("Exercise Image","#TB_inline?height=525&width="+width+"&inlineId=hiddenDialogText&modal=true", false);
    }
    else if(type=="add_assignment")
    {
        //Done
        html += '<div class="thickbox-content">';
        html += 'Add Assignment.<br>';
        html += '<div class="button-area"><input type="submit" class="button" name="btn_ass" value="Add Assignment" id="btn_ass" />&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Add Assignment","ajax_file/add_class_assignment/?height=400&width=700&iUserId="+extra_param2+"&iClassId="+extra_param1+"&from=grade&KeepThis=true&modal=true", false);
		    $('html,body').animate({scrollTop: 0}, 0);
    }
    else if(type=="print_grades")
    {
        //Done
        tb_show("Print Grades","ajax_file/print_grades/?height=450&width=850&iClassId="+extra_param1+"&iSchoolId="+extra_param2+"&KeepThis=true&modal=true", false);
		    $('html,body').animate({scrollTop: 0}, 0);
    }
    else if(type=="drop_grades")
    {
        //Done
        html += '<div class="thickbox-content">';
        html += 'Set Grades<br>';
        html += '<div class="button-area"><input type="submit" class="button" name="btn_grade" value="Drop Grades" id="btn_grade" />&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Set Grades","ajax_file/add_class_gradescale/?height=500&width=700&iUserId="+extra_param2+"&iClassId="+extra_param1+"&from=grade&KeepThis=true&from=grade&modal=true", false);
    }
    else if(type=="exercise_source")
    {
        tb_show("Add a New Source","ajax_file/exercise_ref_add/?height=300&amp;width=475&amp;modal=true", false);
        m_ajax_options_hide_close();
    }
    else if(type=="drop_scores")
    {
        //Done
        html += '<div class="thickbox-content">';
        html += 'Drop Scores<br>';
        html += '<div class="button-area"><input type="submit" class="button" name="btn_grade_score" value="Drop Scores" id="btn_grade_score" />&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Drop Scores","ajax_file/add_drop_score/?height=450&width=600&iUserId="+extra_param2+"&iClassId="+extra_param1+"&from=grade&KeepThis=true&from=grade&modal=true", false);
    }
    else if(type=="Add_Exercise_Class"){
        $.get('ajax_file/add_exercise_class/',{'iClassId':extra_param1,'iExcerciseId':extra_param2},
		function(data){
			html += data;
			$('#hiddenDialogText').html(html);
			tb_show("Add Exercise to Class","#TB_inline?height=520&width=780&inlineId=hiddenDialogText&modal=true", false);
        });
    }
  else if(type=="Add_Exercise_Class_Grade"){
        $("#exename_click").html('');
        $.get('ajax_file/add_exercise_class/',{'iClassId':extra_param1,'iExcerciseId':extra_param2,'excercise_remove':false},
		function(data){
			html += data;
			if(html!='')
          $("#exename_click").html('');

			$('#hiddenDialogText').html(html);
			tb_show("Add Exercise to Class","#TB_inline?height=520&width=780&inlineId=hiddenDialogText&modal=true", false);
        });
    }
	else if(type=="Add_Exercise_Prize"){
	$.get('ajax_file/add_exercise_class/',{'from':extra_param1},
		function(data){
			html += data;
			$('#hiddenDialogText').html(html);
			tb_show("Add a Prize","#TB_inline?height=520&width=780&inlineId=hiddenDialogText&modal=true", false);
        });
    }
   else if(type=="Add_Exercise_Lesson"){
        $.get('ajax_file/add_exercise_class/',{'from':extra_param1},
		function(data){
			html += data;
			$('#hiddenDialogText').html(html);
			tb_show("Add Exercise Lesson","#TB_inline?height=520&width=780&inlineId=hiddenDialogText&modal=true", false);
        });
    }
  else if(type=="Add_Assignment_Prize"){
        $.get('ajax_file/add_assignment_prize/',{},
		function(data){
			html += data;
			$('#hiddenDialogText').html(html);
			tb_show("Add Assignment Prize","#TB_inline?height=520&width=780&inlineId=hiddenDialogText&modal=true", false);
        });
    }
	else if(type=="tutor_schedule_set"){
        $.post(secure_url+'ajax_file/tutor_schedule_set/'+extra_param1,{},
		function(data){
			html += data;
			$('#hiddenDialogText').html(html);
			tb_show("Request a Tutoring Appointment","#TB_inline?height=450&width=750&inlineId=hiddenDialogText&modal=true", false);
			$('html,body').animate({scrollTop: 0}, 0);
        });
    }
    else if(type=="add_wrong_answer")
    {
        //Done
        $.post('ajax_file/add_wrong_answer/',{'iFlashCardId':extra_param1,'mode':extra_param2,'iexeId':extra_param3,'iFlashRowId':extra_param4},
		function(data){
			html += data;
			$('#hiddenDialogText').html(html);
			tb_show("View/Add wrong answer","#TB_inline?height=450&width=750&inlineId=hiddenDialogText&modal=true", false);
        });
    }
  else if(type=="visual_print")
    {
        //Done
        html += '<div class="thickbox-content">';
        html += 'Visual Print<br>';
        html += '<div class="button-area"><input type="submit" class="button" name="btn_grade" value="print" id="btn_print" />&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Visual Print","ajax_file/ex_visual_print/?height=500&width=800&iExerciseId="+extra_param1+"&from=grade&KeepThis=true&from=grade&modal=true", false);
    }
  else if(type=="flashcard_print")
    {
        $.get(site_url+'ajax_file/print_layout_flashcard/',{'iFlashCardId':extra_param1,'isSetup':extra_param2},
			  function(data){
				    html += data;
				    $('#hiddenDialogText').html(html);
				    tb_show("Select Printing Format","#TB_inline?height=340&width=760&inlineId=hiddenDialogText&modal=true", false);
	        });
    }
  else if(type=="fill_blank_print")
    {
        //Done
        html += '<div class="thickbox-content">';
        html += 'Print<br>';
        html += '<div class="button-area"><input type="submit" class="button" name="btn_grade" value="print" id="btn_print" />&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';

        $('#hiddenDialogText').html(html);
        tb_show("Print","ajax_file/ex_fillblank_print/?height=500&width=700&iExerciseId="+extra_param1+"&from=grade&KeepThis=true&from=grade&modal=true", false);
    }
  else if(type=="flashcard_proceed_print")
    {
        //Done
        html += '<div class="thickbox-content">';
        html += 'Print Flash Cards<br>';
        html += '<div class="button-area"><input type="submit" class="button" name="btn_grade" value="print" id="btn_print" />&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Print Flash Cards","ajax_file/print_flashcard/?height=500&width=760&iFlashCardId="+extra_param1+"&print_opt="+extra_param2+"&from=grade&KeepThis=true&modal=true", false);
    }
    else if(type=="new_school_registration")
    {
        tb_show("New school registration request","ajax_file/school_register/?TB_iframe=true&height=480&width=680&KeepThis=true", false);
    }
    else if(type=="list_print")
    {
        //Done
        html += '<div class="thickbox-content">';
        html += 'List Print<br>';
        html += '<div class="button-area"><input type="submit" class="button" name="btn_grade" value="print" id="btn_print" />&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Print","ajax_file/ex_list_print/?height=500&width=700&iExerciseId="+extra_param1+"&from=grade&KeepThis=true&from=grade&modal=true", false);
    }
    else if(type=="Join_Paid_Class"){
    	 html += '<div class="thickbox-content">';
        html += 'List Print<br>';
        html += '<div class="button-area"><input type="submit" class="button" name="btn_grade" value="print" id="btn_print" />&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
        $('#hiddenDialogText').html(html);
        tb_show("Join Paid Class",secure_url+"ajax_file/join_paid_class/?height=420&width=900&iClassId="+extra_param1+"&KeepThis=true&TB_iframe=true", false);
    }
    /*ddddddddddddddddddddddddddddddddddddd */
     else if(type=="delete_member")
     {
          //Done
          html += '<div class="thickbox-content">Are you sure you want to delete this member?</div>';
          html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="group_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
          $('#hiddenDialogText').html(html);
          tb_show("Delete Member", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
    else if(type=="block_member")
     {
          //Done
          html += '<div class="thickbox-content">Are you sure you want to block this member?</div>';
          html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="group_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
          $('#hiddenDialogText').html(html);
          tb_show("Block Member", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
     }
     else if(type=="approve_member")
     {
          //Done
          html += '<div class="thickbox-content">Are you sure you want to approve this member?</div>';
          html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="group_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
          $('#hiddenDialogText').html(html);
          tb_show("Approve Member", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
     }
     else if(type=="reject_member")
     {
          //Done
          html += '<div class="thickbox-content">Are you sure you want to reject this member?</div>';
          html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="group_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
          $('#hiddenDialogText').html(html);
          tb_show("Reject Member", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
     else if(type=="delete_moderator_member")
     {
          //Done
          html += '<div class="thickbox-content">Are you sure you want to delete this member?</div>';
          html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="group_moderator_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
          $('#hiddenDialogText').html(html);
          tb_show("Delete Member", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
    else if(type=="block_moderator_member")
     {
          //Done
          html += '<div class="thickbox-content">Are you sure you want to block this member?</div>';
          html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="group_moderator_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
          $('#hiddenDialogText').html(html);
          tb_show("Block Member", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
     }
     else if(type=="approve_moderator_member")
     {
          //Done
          html += '<div class="thickbox-content">Are you sure you want to approve this member?</div>';
          html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="group_moderator_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
          $('#hiddenDialogText').html(html);
          tb_show("Approve Member", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
     }
     else if(type=="reject_moderator_member")
     {
          //Done
          html += '<div class="thickbox-content">Are you sure you want to reject this member?</div>';
          html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="group_moderator_action(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
          $('#hiddenDialogText').html(html);
          tb_show("Reject Member", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
    else if(type=="remove_group_file")
     {
          //Done
          html += '<div class="thickbox-content">Are you sure you want to remove this file?</div>';
          html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="remove_group_file(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
          $('#hiddenDialogText').html(html);
          tb_show("Remove File", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
    else if(type=="remove_lesson_file")
     {
          //Done
          html += '<div class="thickbox-content">Are you sure you want to remove this file?</div>';
          html += '<div class="button-area"  align="center"><input type="button" class="button" name="btn_ok" value="Ok" id="btn_ok" onclick="remove_lesson_file(\''+extra_param1+'\',\''+extra_param2+'\',\''+extra_param3+'\');"/>&nbsp;&nbsp;&nbsp;<input type="button" value="Cancel" class="button" name="btn_cancel" id="btn_cancel" onclick="tb_remove();" /></div>';
          $('#hiddenDialogText').html(html);
          tb_show("Remove File", "#TB_inline?height=75&width=290&inlineId=hiddenDialogText&modal=true", false)
    }
    /*ppppppppppppppppppppppppppppppppppppp */
    else if(type=="add_user_type"){
			tb_show("Join Another School","ajax_file/add_role/?height=500&width=700&from=grade&KeepThis=true&from=grade&modal=true",false);
			//"ajax_file/add_role/?height=490&width=700&modal=true"
   	}
   	
   	else if(type=="calender_schedule_school")
   	{   //var a;
          //$('#loaderdiv').css('display','block');
	//id_val = $('#iTeacherSchoolId_hidden').val();
	       //alert(site_url+'ajax_file/add_exception_periods/');
	       if(extra_param4 != '')
	       {
               $.post(site_url+'ajax_file/add_exception_periods/'+extra_param1+'/'+extra_param2+'/'+extra_param3+'/'+extra_param4, function(data){
	           $('#hiddenDialogText').html(data);
                tb_show("Calendar Schedule", "#TB_inline?height=130&width=450&inlineId=hiddenDialogText&modal=true", false);
               hide_wait_div();                               
               });
            }
            else
            {
               $.post(site_url+'ajax_file/add_exception_periods/'+extra_param1+'/'+extra_param2+'/'+extra_param3, function(data){
	           $('#hiddenDialogText').html(data);
                tb_show("Calendar Schedule", "#TB_inline?height=130&width=450&inlineId=hiddenDialogText&modal=true", false);
               hide_wait_div();                               
               });
            }  

    }
	else{
        tb_show(type,extra_param1, false);
    }
}
function Trim(s)
{
	return s.replace(/^\s+/g, '').replace(/\s+$/g, '');
}
function display_edit(ed_id)
{
    $('#'+ed_id).css('display','block');
}
function hide_edit(ed_id)
{
    $('#'+ed_id).css('display','none');
}
function setCalVal(obj)
{
	var id = obj.id;
	var len = id.length-3;
	var caltextboxid = id.substr(0, len );
  //alert(document.getElementById(caltextboxid+'_mm').value);
  if(caltextboxid+'_mm' == id)
  {
    if(document.getElementById(caltextboxid+'_mm') && document.getElementById(caltextboxid+'_mm').value=='02')
    {
        for(i=document.getElementById(caltextboxid+'_dd').options.length-1;i>=0;i--)
        {
            if(document.getElementById(caltextboxid+'_dd').options[i].value>29)
                document.getElementById(caltextboxid+'_dd').remove(i);
        }
    }
    else
    {
            month1 = new Array('01', '03', '05', '07', '08', '10', '12');
            month2 = new Array('04', '06', '09', '11');
            var oddvar=false;
            for(j=0;j<month1.length;j++)
            {
                if(document.getElementById(caltextboxid+'_mm').value==month1[j])
                {
                    oddvar=true;
                }
            }
            if(oddvar == true)
            {
                for(i=document.getElementById(caltextboxid+'_dd').options.length-1;i>0;i--)
                {
                        document.getElementById(caltextboxid+'_dd').remove(i);
                }
                for(p=1;p<=31;p++)
                {
                    addOption(document.getElementById(caltextboxid+'_dd'),p,p);
                }
            }
            else if(oddvar == false)
            {
                for(i=document.getElementById(caltextboxid+'_dd').options.length-1;i>0;i--)
                {
                        document.getElementById(caltextboxid+'_dd').remove(i);
                }
                for(p=1;p<=30;p++)
                {
                    addOption(document.getElementById(caltextboxid+'_dd'),p,p);
                }
            }
            //document.getElementById(caltextboxid+'_dd').remove(i);
    }
  }

	if(document.getElementById(caltextboxid+'_time'))
		var str = document.getElementById(caltextboxid+'_yy').value+'-'+document.getElementById(caltextboxid+'_mm').value+'-'+document.getElementById(caltextboxid+'_dd').value+' '+document.getElementById(caltextboxid+'_time').value;
	else
	{
		var month = getMonthName(document.getElementById(caltextboxid+'_mm').value);
		var str_comp = month +' '+ document.getElementById(caltextboxid+'_dd').value+', '+document.getElementById(caltextboxid+'_yy').value;
		var str = document.getElementById(caltextboxid+'_yy').value+'-'+document.getElementById(caltextboxid+'_mm').value+'-'+document.getElementById(caltextboxid+'_dd').value;
	}
	document.getElementById(caltextboxid).value=str;
}

function getMonthName(mm)
{
	var month_array = new Array( "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
	return month_array[mm-1];
}

function addOption(selectbox,text,value )
{
    var optn = document.createElement("OPTION");
    optn.text = text;
    optn.value = value;
    selectbox.options.add(optn);
}
function check_teacher_email_validation()
{
	$('#loaderdiv').css('display','block');
	id_val = $('#iTeacherSchoolId_hidden').val();
	$.post(site_url+'ajax/check_teacher_email_validation/',{'iTeacherSchoolId_hidden':id_val}, function(data){
       $('#loaderdiv').html(data);
       setTimeout("tb_remove();",2000);
       hide_wait_div();
  });
}
function check_student_email_validation()
{
	$('#loaderdiv').css('display','block');
	id_val = $('#iStudentSchoolId_hidden').val();
	$.post(site_url+'ajax/check_student_email_validation/',{'iStudentSchoolId_hidden':id_val}, function(data){
       $('#loaderdiv').html(data);
       setTimeout("tb_remove();",2000);
       hide_wait_div();
  });
}
function check_district_email_validation()
{
	$('#loaderdiv').css('display','block');
	id_val = $('#iDistrictId_hidden').val();
	$.post(site_url+'ajax/check_district_email_validation/',{'iDistrictId_hidden':id_val}, function(data){
       $('#loaderdiv').html(data);
       setTimeout("tb_remove();",2000);
       hide_wait_div();
  });
}
function check_role_email_validation(role)
{
	$('#loaderdiv').css('display','block');
	id_val = $('#iSchoolId_hidden').val();
	vEmail = $('#vUserEmail').val();

	$.post(site_url+'ajax/check_role_email_validation/',{'iSchoolId_hidden':id_val,'vEmail':vEmail,'role':role}, function(data){
       $('#loaderdiv').html(data);
       setTimeout("tb_remove();",2000);
       hide_wait_div();
  });
}
function checkValidNumber(obj, msg)
{
	chk1="1234567890";
	flag=false;
	if(obj)
	{
		value=obj.value;
		if(Trim(value)!="")
		{
			len=obj.value.length;
			//alert(len);
			for(i=0;i<len;i++)
			{
				ch1=value.charAt(i);
				rtn1=chk1.indexOf(ch1);
				if(rtn1==-1)
					flag=true;
			}
		}
	}else{
		flag=true;
		msg='Object is not available';
	}
	if(flag)
	{
		alert(msg);
		obj.focus();
		return false;
	}
	return true;
}
function checkValidFloatNumber(obj, msg)
{
	chk1="1234567890.";
	flag=false;
	if(obj)
	{
		value=obj.value;
		if(Trim(value)!="")
		{
			len=obj.value.length;
			//alert(len);
			for(i=0;i<len;i++)
			{
				ch1=value.charAt(i);
				rtn1=chk1.indexOf(ch1);
				if(rtn1==-1)
					flag=true;
			}
		}else flag=true;
	}else{
		flag=true;
		msg='Object is not available';
	}
	if(flag)
	{
		alert(msg);
		obj.focus();
		return false;
	}
	return true;
}

// This code was written by Tyler Akins and has been placed in the
// public domain.  It would be nice if you left this header intact.
// Base64 code from Tyler Akins -- http://rumkin.com

var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

function encode64(input) {
   var output = "";
   var chr1, chr2, chr3;
   var enc1, enc2, enc3, enc4;
   var i = 0;

   do {
      chr1 = input.charCodeAt(i++);
      chr2 = input.charCodeAt(i++);
      chr3 = input.charCodeAt(i++);

      enc1 = chr1 >> 2;
      enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
      enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
      enc4 = chr3 & 63;

      if (isNaN(chr2)) {
         enc3 = enc4 = 64;
      } else if (isNaN(chr3)) {
         enc4 = 64;
      }

      output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) +
         keyStr.charAt(enc3) + keyStr.charAt(enc4);
   } while (i < input.length);

   return output;
}

function decode64(input) {
   var output = "";
   var chr1, chr2, chr3;
   var enc1, enc2, enc3, enc4;
   var i = 0;

   // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
   input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

   do {
      enc1 = keyStr.indexOf(input.charAt(i++));
      enc2 = keyStr.indexOf(input.charAt(i++));
      enc3 = keyStr.indexOf(input.charAt(i++));
      enc4 = keyStr.indexOf(input.charAt(i++));

      chr1 = (enc1 << 2) | (enc2 >> 4);
      chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
      chr3 = ((enc3 & 3) << 6) | enc4;

      output = output + String.fromCharCode(chr1);

      if (enc3 != 64) {
         output = output + String.fromCharCode(chr2);
      }
      if (enc4 != 64) {
         output = output + String.fromCharCode(chr3);
      }
   } while (i < input.length);

   return output;
}

function checkValidFile(valid_ext,valu,validExtension)
{
    if(valid_ext == 'Yes')
    {
        var val1,vx;
        var giveAlert="Yes";
        var no;
    	val1=valu.split(".");
    	var splitvalu=validExtension;
    	vx=splitvalu.split(",");
    	no=parseInt((val1.length)-1);
    	for(l=0;l<vx.length;l++)
    	{
    		if(val1[no].toUpperCase()==vx[l].toUpperCase())
    		{
    			giveAlert="No";
    			break;
    		}
    	}
    	if(giveAlert == "Yes")
    	{
    		alert("Please upload a file with one of the following valid extensions: " + validExtension + ".");
    		return false;
    	}
    }
    return true;
}

function ClearBrowseContent(control)
{
   var browse=document.getElementById(control);
	 var newbrowse= browse.cloneNode(false);
   browse.parentNode.replaceChild(newbrowse ,browse);
}

function AlphaNumericValue(eve,temp)
{
   val = eve.keyCode;
	if(!val)
		val=eve.which;
	if(temp=='num'){
		if(val > 47 && val < 58){
			return true;
		}
	}else if(temp=='alpha'){
		if(val > 64 && val < 91 || val > 96 && val < 123){
			return true;
		}
	}else{
		if(val > 47 && val < 58 || val > 64 && val < 91 || val > 96 && val < 123){
			return true;
		}
	}
	if(val==9 || val==8){
		return true;
	}else{
		return false;
	}
}

function start_clock(que_time,rightpoint)
{
	//alert(que_time)
	if(que_time=="")
		return false;
	point = parseInt(que_time)+parseInt(rightpoint);
	//alert(rightpoint);
	ratio = que_time/point;
	$('#clock_pointid').html(point);
	$('#clock_timeid').html(que_time);
	clock = setTimeout("decrease_clock("+que_time+","+ratio+","+point+")",1000);
	//setTimeout("decrease_point("+ratio+", "+point+");",ratio*1000);
}
function decrease_clock(que_time)
{
	if(que_time=="")
		return false;
		que_time--;
	$('#clock_timeid').html(que_time);
	//if(que_time%ratio==0)
	{
		decrease_point();
	}
	clock = setTimeout("decrease_clock("+que_time+")",1000);
}
function decrease_point()
{
	if(point=="")
		return false;
	point--;
	$('#clock_pointid').html(point);
	total_point = $('#hiddenpoint').val();
	total_point += $('#hiddenpoint').val(point);
	$('#total_point').val(total_point);
}
function stop_clock()
{
	clearTimeout(clock);
}
function CheckPhoneDetail(frm)
{
 var len = frm.length;
 alert(len);
 for(var i = 0; i < len; i++)
 {
 alert(frm.elements[i].name);
 	 if((frm.elements[i].name == "vCountryExt[vMainPhone]" && frm.elements[i].value == "") || (frm.elements[i].name == "vArea[vMainPhone]" && frm.elements[i].value == "") || (frm.elements[vMainPhone].name == "vPrefixExt[]" && frm.elements[i].value == "") || (frm.elements[i].name == "vRest[vMainPhone]" && frm.elements[i].value == "") /* || (frm.elements[i].name == "vExtension[]" && frm.elements[i].value == "") */ )
  	{
  		alert("Please provide a complete phone number.");
  		frm.elements[i].focus();
  		return false;
  	}
   	if(frm.elements[i].name == "vCountryExt[]" && isNaN(frm.elements[i].value))
  	{
  		alert("Please provide a phone number with a valid country code.");
  		frm.elements[i].focus();
  		return false;
  	}
  	if(frm.elements[i].name == "vArea[]" && isNaN(frm.elements[i].value))
  	{
  		alert("Please provide a phone number with a valid area code.");
  		frm.elements[i].focus();
  		return false;
  	}
  	if(frm.elements[i].name == "vPrefixExt[]" && isNaN(frm.elements[i].value))
  	{
  		alert("Please provide a phone number with a valid prefix.");
  		frm.elements[i].focus();
  		return false;
  	}
  	if(frm.elements[i].name == "vRest[]" && isNaN(frm.elements[i].value))
  	{
  		alert("Please provide a valid phone number.");
  		frm.elements[i].focus();
  		return false;
  	}
  	if(frm.elements[i].name == "vExtension[]" && isNaN(frm.elements[i].value))
  	{
  		alert("Please provide a phone number with a valid extension.");
  		frm.elements[i].focus();
  		return false;
  	}
  }
  	return true;
}
function getkeyboard_data(iSubjectId)
{
	if(iSubjectId==undefined)
		iSubjectId="";
    $('#make_keyboard').css('display','block');
    $('#make_keyboard').html('<img src="images/loader.gif"/>');
    $.post('ajax/get_keyboard/',{'iSubjectId':iSubjectId}, function(data){
  		  $('#make_keyboard').show('slow');

        $('#make_keyboard').html(data);
  		  //$('#selectiLangTeachId').val(iSubjectId);
    });
}
function getkeyboard_data_popup(iSubjectId)
{
	if(iSubjectId==undefined)
		iSubjectId="";
  	$.post('ajax/get_keyboard/',{'iSubjectId':iSubjectId}, function(data)
    {
  	  $('#make_popup_keyboard').show('slow');
		  $('#make_popup_keyboard').html(data);
		  //$('#selectiLangTeachId').val(iSubjectId);
    });
}

function dateformat(cdate){

	date_arr = cdate.split("-");
	date_year = date_arr[0];
	date_month = date_arr[1];
	date_day = date_arr[2];
	html = date_month+'-'+date_day+'-'+date_year;
	return html;
}
function insertAtCaret(areaId,text) {
    var txtarea = areaId;
    var scrollPos = txtarea.scrollTop;
    var strPos = 0;
    try{
    	var br = ((txtarea.selectionStart || txtarea.selectionStart == '0') ?
        "ff" : (document.selection ? "ie" : false ) );
    }
    catch(err){}
    if (br == "ie") {
        txtarea.focus();
        var range = document.selection.createRange();
        range.moveStart ('character', -txtarea.value.length);
        strPos = range.text.length;
    }
    else if (br == "ff") strPos = txtarea.selectionStart;

    var front = (txtarea.value).substring(0,strPos);
    var back = (txtarea.value).substring(strPos,txtarea.value.length);
    txtarea.value=front+text+back;
    strPos = strPos + text.length;
    if (br == "ie") {
        txtarea.focus();
        var range = document.selection.createRange();
        range.moveStart ('character', -txtarea.value.length);
        range.moveStart ('character', strPos);
        range.moveEnd ('character', 0);
        range.select();
    }
    else if (br == "ff") {
        txtarea.selectionStart = strPos;
        txtarea.selectionEnd = strPos;
        txtarea.focus();
    }
    txtarea.scrollTop = scrollPos;
}

function show_hide_audio(type1,inputid,flashid)
{
	if(type1=='upload')
	{
		$('#upload_audio_id'+flashid).css('display','block');
		$('#record_id'+flashid).css('display','none');
		$("#vMediaFile").css('display','block');
	}
	else
	{
		$('#upload_audio_id'+flashid).css('display','none');
		$('#record_id'+flashid).css('display','block');
		//alert(inputid);
		$('#'+inputid).attr('lang','');
		$("#vMediaFile").css('display','none');
	}
}
function getsetFocus()
{
	$('input, textarea').focus(
		function(){
			selectedObj = this;
		}
	)
	//setTimeout("getsetFocus();",500);
}
function GetSchoolGrades(iSchoolId)
{
  $.post( 'ajax/grade_combo/',{'iSchoolId':iSchoolId},
  function(data){
      //alert(data);
      $('#school_grade').html(data);
  });
}
function call_disctict_func(iDistrictId,mode)
{
      call_wait_div();
      if(mode=="")
      	mode = 'school';
      else
      	mode = 'register';
      $.post('ajax_file/districtdetail/',{'iDisctrictId':iDistrictId,'mode':mode}, function(data){
      $('#district_info').html(data);
      hide_wait_div();
    });
}

function setFav(iPrimaryId,Lid, eType)
{
	var url = "ajax/setFavourite";
	$.post(url, {'iPrimaryId': iPrimaryId, 'eType' : eType}, function(data) {
		$("#favid"+Lid).html('<a href="javascript://" onclick="removeFav(\''+iPrimaryId+'\','+Lid+',\''+eType+'\');">Remove Favorite</a>');
	});
	return false;
}

function removeFav(iPrimaryId,Lid,eType)
{
	var url = "ajax/removeFavourite";
	$.post(url, {iPrimaryId : iPrimaryId, eType : eType}, function(data) {
		$("#favid"+Lid).html('<a href="javascript://" onclick="setFav(\''+iPrimaryId+'\','+Lid+',\''+eType+'\');">Make Favorite</a>');
	});
}


function leave(iGroupId,MemberId)
{
	//alert(iGroupId);
	var url = "ajax/leave_group";
	$.post(url, {iGroupId : iGroupId, MemberId: MemberId}, function(data) {
		alert(data);
		$("#Group"+iGroupId).html('<a href="javascript://" onclick="join(\''+iGroupId+'\','+MemberId+'\');">Join Group</a>');
	});
}

function call_flash_quiz(extra_param1,extra_param2,extra_param3,extra_param4)
{
        var Consider="";
        if(extra_param4=="Consider")
                Consider = "Yes";
	       else
		            Consider = "No";
    tb_remove();			            
  	$.post(site_url+'ajax_file/flashcard_quiz/',{'iFlashCardId':extra_param1,'isSetup':extra_param2,'eSetupType':extra_param3,'Consider':Consider},
		function(data){
	
			var html = data;
			$('#hiddenDialogText').html(html);
			setTimeout('tb_show("Quiz","#TB_inline?height=600&width=900&inlineId=hiddenDialogText&modal=true", false);',2000);
     });
}
function call_quiz(extra_param1, extra_param2, extra_param3, extra_param4)
{
	tb_remove();
        var Consider="";
        if(extra_param4=="Consider")
                Consider = "Yes";
	else
		Consider = "No";

  	$.post('ajax_file/quiz_blank_exercise/',{'iBlankId':extra_param1,'eExerciseType':'quiz_textual_exercise','Consider':Consider},
	function(data){
		$('#hiddenDialogText').html(data);
		tb_show("Fill-in-the-Blanks Quiz","#TB_inline?height=570&width=780&inlineId=hiddenDialogText&modal=true", false);
        });
}
function call_visual_quiz_setup(extra_param1,extra_param2)
{
	tb_remove();
	  	$.get(site_url+'ajax_file/visual_quiz_setup/',{'Consider':extra_param1,'iVisualId':extra_param2},
			function(data){
				    $('#hiddenDialogText').html(data);
				    tb_show("Visual Quiz Setup","#TB_inline?height=320&width=630&inlineId=hiddenDialogText&modal=true", false);
	        });
}
function call_fluency_quiz(extra_param1,extra_param2,extra_param3,extra_param4,extra_param5,extra_param6)
{
    tb_remove();
        if(extra_param1=="Consider")
                Consider = "Yes";
	       else
		            Consider = "No";
		
       $.post('ajax_file/fluency_quiz/',{'Consider':Consider,'iRFluencyId':extra_param2,'iExerciseScoreId':extra_param3,'vSpeed':extra_param4,'eHighlight':extra_param5,'eAudio':extra_param6},
			function(data){
				$('#hiddenDialogText').html(data);
				  tb_show("Quiz","#TB_inline?height=520&width=900&inlineId=hiddenDialogText&modal=true", false);
	      });
} 
function call_visual_quiz(extra_param4,extra_param2,extra_param3)
{
	tb_remove();
        var Consider="";
        if(extra_param2=="Consider")
                Consider = "Yes";
	else
		Consider = "No";

        visualId = $('#iVisualId').val();
      	$.post('ajax_file/quiz_visual_exercise_setup/',{'iVisualId':visualId,'Consider':Consider,'vAnswerOption':extra_param3}, function(data){
			  $('#hiddenDialogText').html(data);
			  tb_show("Quiz","#TB_inline?height=690&width=800&inlineId=hiddenDialogText&modal=true", false);
        });
}
function call_textual_quiz(extra_param1,extra_param2)
{
	tb_remove();
        var Consider="";
        if(extra_param2=="Consider")
                Consider = "Yes";
	else
		Consider = "No";

      $.post('ajax_file/quiz_textual_exercise/',{'iTextualId':extra_param1,'eExerciseType':'quiz_textual_exercise','Consider':Consider},
			function(data){
				var html = data;
				$('#hiddenDialogText').html(html);
				tb_show("Quiz","#TB_inline?height=600&width=780&inlineId=hiddenDialogText&modal=true", false);
	        });
}

function show_loadingsmall_div(obj)
{
		try{
			$('body').append('<div id="aaa" align="center"><img src="images/loading_spin.gif"><br>Loading..</div>');
		        $('#aaa').css({
		                position: 'absolute',
		                zIndex: 5000,
		                left:(temp_left-46)+'px',
		                top:(temp_right-35)+'px'
		    	});
		}
		catch(err)
		{
		        alert(err);
		}
}
function hide_loadingsmall_div(obj)
{
	try{
        	$('#aaa').remove();
	}
	catch(err)
	{

	}
}
//getsetFocus();

   $(document).mousemove(function(e){
      //$('#status').html(e.pageX +', '+ e.pageY);
      temp_left = e.pageX;
      temp_right = e.pageY;
	if($('#aaa'))
	{
		$('#aaa').css({
	                position: 'absolute',
                 zIndex: 5000,
	                left:(e.pageX-46)+'px',
	                top:(e.pageY-35)+'px'
	    	});
	}
   });
